1 |
commit: f4449b8ff9220f2c57f1ebe5ecad2fd86cd98ac2 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jul 9 23:38:57 2014 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jul 9 23:38:57 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/linux-patches.git;a=commit;h=f4449b8f |
7 |
|
8 |
Linux patch 3.10.48 |
9 |
|
10 |
--- |
11 |
0000_README | 4 + |
12 |
1047_linux-3.10.48.patch | 1525 ++++++++++++++++++++++++++++++++++++++++++++++ |
13 |
2 files changed, 1529 insertions(+) |
14 |
|
15 |
diff --git a/0000_README b/0000_README |
16 |
index 3f75e5c..7ca8043 100644 |
17 |
--- a/0000_README |
18 |
+++ b/0000_README |
19 |
@@ -230,6 +230,10 @@ Patch: 1046_linux-3.10.47.patch |
20 |
From: http://www.kernel.org |
21 |
Desc: Linux 3.10.47 |
22 |
|
23 |
+Patch: 1047_linux-3.10.48.patch |
24 |
+From: http://www.kernel.org |
25 |
+Desc: Linux 3.10.48 |
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/1047_linux-3.10.48.patch b/1047_linux-3.10.48.patch |
32 |
new file mode 100644 |
33 |
index 0000000..1da735f |
34 |
--- /dev/null |
35 |
+++ b/1047_linux-3.10.48.patch |
36 |
@@ -0,0 +1,1525 @@ |
37 |
+diff --git a/Makefile b/Makefile |
38 |
+index 6a3b46d1863c..f7e5680740f9 100644 |
39 |
+--- a/Makefile |
40 |
++++ b/Makefile |
41 |
+@@ -1,6 +1,6 @@ |
42 |
+ VERSION = 3 |
43 |
+ PATCHLEVEL = 10 |
44 |
+-SUBLEVEL = 47 |
45 |
++SUBLEVEL = 48 |
46 |
+ EXTRAVERSION = |
47 |
+ NAME = TOSSUG Baby Fish |
48 |
+ |
49 |
+diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c |
50 |
+index f82cf878d6af..94c2f6d17dae 100644 |
51 |
+--- a/arch/arm/mach-omap2/mux.c |
52 |
++++ b/arch/arm/mach-omap2/mux.c |
53 |
+@@ -183,8 +183,10 @@ static int __init _omap_mux_get_by_name(struct omap_mux_partition *partition, |
54 |
+ m0_entry = mux->muxnames[0]; |
55 |
+ |
56 |
+ /* First check for full name in mode0.muxmode format */ |
57 |
+- if (mode0_len && strncmp(muxname, m0_entry, mode0_len)) |
58 |
+- continue; |
59 |
++ if (mode0_len) |
60 |
++ if (strncmp(muxname, m0_entry, mode0_len) || |
61 |
++ (strlen(m0_entry) != mode0_len)) |
62 |
++ continue; |
63 |
+ |
64 |
+ /* Then check for muxmode only */ |
65 |
+ for (i = 0; i < OMAP_MUX_NR_MODES; i++) { |
66 |
+diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S |
67 |
+index 6ad781b21c08..7cd589ebca2a 100644 |
68 |
+--- a/arch/arm64/kernel/entry.S |
69 |
++++ b/arch/arm64/kernel/entry.S |
70 |
+@@ -275,7 +275,6 @@ el1_sp_pc: |
71 |
+ * Stack or PC alignment exception handling |
72 |
+ */ |
73 |
+ mrs x0, far_el1 |
74 |
+- mov x1, x25 |
75 |
+ mov x2, sp |
76 |
+ b do_sp_pc_abort |
77 |
+ el1_undef: |
78 |
+diff --git a/arch/unicore32/mm/alignment.c b/arch/unicore32/mm/alignment.c |
79 |
+index de7dc5fdd58b..24e836023e6c 100644 |
80 |
+--- a/arch/unicore32/mm/alignment.c |
81 |
++++ b/arch/unicore32/mm/alignment.c |
82 |
+@@ -21,6 +21,7 @@ |
83 |
+ #include <linux/sched.h> |
84 |
+ #include <linux/uaccess.h> |
85 |
+ |
86 |
++#include <asm/pgtable.h> |
87 |
+ #include <asm/tlbflush.h> |
88 |
+ #include <asm/unaligned.h> |
89 |
+ |
90 |
+diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h |
91 |
+index 3741c653767c..8b320722de7a 100644 |
92 |
+--- a/arch/x86/include/asm/kvm_host.h |
93 |
++++ b/arch/x86/include/asm/kvm_host.h |
94 |
+@@ -92,7 +92,7 @@ |
95 |
+ #define KVM_REFILL_PAGES 25 |
96 |
+ #define KVM_MAX_CPUID_ENTRIES 80 |
97 |
+ #define KVM_NR_FIXED_MTRR_REGION 88 |
98 |
+-#define KVM_NR_VAR_MTRR 8 |
99 |
++#define KVM_NR_VAR_MTRR 10 |
100 |
+ |
101 |
+ #define ASYNC_PF_PER_VCPU 64 |
102 |
+ |
103 |
+@@ -445,7 +445,7 @@ struct kvm_vcpu_arch { |
104 |
+ bool nmi_injected; /* Trying to inject an NMI this entry */ |
105 |
+ |
106 |
+ struct mtrr_state_type mtrr_state; |
107 |
+- u32 pat; |
108 |
++ u64 pat; |
109 |
+ |
110 |
+ int switch_db_regs; |
111 |
+ unsigned long db[KVM_NR_DB_REGS]; |
112 |
+diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c |
113 |
+index 1e89a3dd3d51..07caf44d5755 100644 |
114 |
+--- a/drivers/block/rbd.c |
115 |
++++ b/drivers/block/rbd.c |
116 |
+@@ -1385,6 +1385,14 @@ static bool obj_request_exists_test(struct rbd_obj_request *obj_request) |
117 |
+ return test_bit(OBJ_REQ_EXISTS, &obj_request->flags) != 0; |
118 |
+ } |
119 |
+ |
120 |
++static bool obj_request_overlaps_parent(struct rbd_obj_request *obj_request) |
121 |
++{ |
122 |
++ struct rbd_device *rbd_dev = obj_request->img_request->rbd_dev; |
123 |
++ |
124 |
++ return obj_request->img_offset < |
125 |
++ round_up(rbd_dev->parent_overlap, rbd_obj_bytes(&rbd_dev->header)); |
126 |
++} |
127 |
++ |
128 |
+ static void rbd_obj_request_get(struct rbd_obj_request *obj_request) |
129 |
+ { |
130 |
+ dout("%s: obj %p (was %d)\n", __func__, obj_request, |
131 |
+@@ -1401,6 +1409,13 @@ static void rbd_obj_request_put(struct rbd_obj_request *obj_request) |
132 |
+ kref_put(&obj_request->kref, rbd_obj_request_destroy); |
133 |
+ } |
134 |
+ |
135 |
++static void rbd_img_request_get(struct rbd_img_request *img_request) |
136 |
++{ |
137 |
++ dout("%s: img %p (was %d)\n", __func__, img_request, |
138 |
++ atomic_read(&img_request->kref.refcount)); |
139 |
++ kref_get(&img_request->kref); |
140 |
++} |
141 |
++ |
142 |
+ static bool img_request_child_test(struct rbd_img_request *img_request); |
143 |
+ static void rbd_parent_request_destroy(struct kref *kref); |
144 |
+ static void rbd_img_request_destroy(struct kref *kref); |
145 |
+@@ -2154,6 +2169,7 @@ static void rbd_img_obj_callback(struct rbd_obj_request *obj_request) |
146 |
+ img_request->next_completion = which; |
147 |
+ out: |
148 |
+ spin_unlock_irq(&img_request->completion_lock); |
149 |
++ rbd_img_request_put(img_request); |
150 |
+ |
151 |
+ if (!more) |
152 |
+ rbd_img_request_complete(img_request); |
153 |
+@@ -2250,6 +2266,7 @@ static int rbd_img_request_fill(struct rbd_img_request *img_request, |
154 |
+ goto out_partial; |
155 |
+ obj_request->osd_req = osd_req; |
156 |
+ obj_request->callback = rbd_img_obj_callback; |
157 |
++ rbd_img_request_get(img_request); |
158 |
+ |
159 |
+ osd_req_op_extent_init(osd_req, 0, opcode, offset, length, |
160 |
+ 0, 0); |
161 |
+@@ -2673,7 +2690,7 @@ static int rbd_img_obj_request_submit(struct rbd_obj_request *obj_request) |
162 |
+ */ |
163 |
+ if (!img_request_write_test(img_request) || |
164 |
+ !img_request_layered_test(img_request) || |
165 |
+- rbd_dev->parent_overlap <= obj_request->img_offset || |
166 |
++ !obj_request_overlaps_parent(obj_request) || |
167 |
+ ((known = obj_request_known_test(obj_request)) && |
168 |
+ obj_request_exists_test(obj_request))) { |
169 |
+ |
170 |
+diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c |
171 |
+index a56d0199e334..971dd8795b68 100644 |
172 |
+--- a/drivers/gpu/drm/radeon/atombios_crtc.c |
173 |
++++ b/drivers/gpu/drm/radeon/atombios_crtc.c |
174 |
+@@ -839,14 +839,16 @@ static void atombios_crtc_program_pll(struct drm_crtc *crtc, |
175 |
+ args.v5.ucMiscInfo = 0; /* HDMI depth, etc. */ |
176 |
+ if (ss_enabled && (ss->type & ATOM_EXTERNAL_SS_MASK)) |
177 |
+ args.v5.ucMiscInfo |= PIXEL_CLOCK_V5_MISC_REF_DIV_SRC; |
178 |
+- switch (bpc) { |
179 |
+- case 8: |
180 |
+- default: |
181 |
+- args.v5.ucMiscInfo |= PIXEL_CLOCK_V5_MISC_HDMI_24BPP; |
182 |
+- break; |
183 |
+- case 10: |
184 |
+- args.v5.ucMiscInfo |= PIXEL_CLOCK_V5_MISC_HDMI_30BPP; |
185 |
+- break; |
186 |
++ if (encoder_mode == ATOM_ENCODER_MODE_HDMI) { |
187 |
++ switch (bpc) { |
188 |
++ case 8: |
189 |
++ default: |
190 |
++ args.v5.ucMiscInfo |= PIXEL_CLOCK_V5_MISC_HDMI_24BPP; |
191 |
++ break; |
192 |
++ case 10: |
193 |
++ args.v5.ucMiscInfo |= PIXEL_CLOCK_V5_MISC_HDMI_30BPP; |
194 |
++ break; |
195 |
++ } |
196 |
+ } |
197 |
+ args.v5.ucTransmitterID = encoder_id; |
198 |
+ args.v5.ucEncoderMode = encoder_mode; |
199 |
+@@ -861,20 +863,22 @@ static void atombios_crtc_program_pll(struct drm_crtc *crtc, |
200 |
+ args.v6.ucMiscInfo = 0; /* HDMI depth, etc. */ |
201 |
+ if (ss_enabled && (ss->type & ATOM_EXTERNAL_SS_MASK)) |
202 |
+ args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_REF_DIV_SRC; |
203 |
+- switch (bpc) { |
204 |
+- case 8: |
205 |
+- default: |
206 |
+- args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_24BPP; |
207 |
+- break; |
208 |
+- case 10: |
209 |
+- args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_30BPP; |
210 |
+- break; |
211 |
+- case 12: |
212 |
+- args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_36BPP; |
213 |
+- break; |
214 |
+- case 16: |
215 |
+- args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_48BPP; |
216 |
+- break; |
217 |
++ if (encoder_mode == ATOM_ENCODER_MODE_HDMI) { |
218 |
++ switch (bpc) { |
219 |
++ case 8: |
220 |
++ default: |
221 |
++ args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_24BPP; |
222 |
++ break; |
223 |
++ case 10: |
224 |
++ args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_30BPP; |
225 |
++ break; |
226 |
++ case 12: |
227 |
++ args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_36BPP; |
228 |
++ break; |
229 |
++ case 16: |
230 |
++ args.v6.ucMiscInfo |= PIXEL_CLOCK_V6_MISC_HDMI_48BPP; |
231 |
++ break; |
232 |
++ } |
233 |
+ } |
234 |
+ args.v6.ucTransmitterID = encoder_id; |
235 |
+ args.v6.ucEncoderMode = encoder_mode; |
236 |
+diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c |
237 |
+index 16023986d301..4c05f2b015cf 100644 |
238 |
+--- a/drivers/gpu/drm/radeon/atombios_dp.c |
239 |
++++ b/drivers/gpu/drm/radeon/atombios_dp.c |
240 |
+@@ -384,6 +384,19 @@ static int dp_get_max_dp_pix_clock(int link_rate, |
241 |
+ |
242 |
+ /***** radeon specific DP functions *****/ |
243 |
+ |
244 |
++static int radeon_dp_get_max_link_rate(struct drm_connector *connector, |
245 |
++ u8 dpcd[DP_DPCD_SIZE]) |
246 |
++{ |
247 |
++ int max_link_rate; |
248 |
++ |
249 |
++ if (radeon_connector_is_dp12_capable(connector)) |
250 |
++ max_link_rate = min(drm_dp_max_link_rate(dpcd), 540000); |
251 |
++ else |
252 |
++ max_link_rate = min(drm_dp_max_link_rate(dpcd), 270000); |
253 |
++ |
254 |
++ return max_link_rate; |
255 |
++} |
256 |
++ |
257 |
+ /* First get the min lane# when low rate is used according to pixel clock |
258 |
+ * (prefer low rate), second check max lane# supported by DP panel, |
259 |
+ * if the max lane# < low rate lane# then use max lane# instead. |
260 |
+@@ -393,7 +406,7 @@ static int radeon_dp_get_dp_lane_number(struct drm_connector *connector, |
261 |
+ int pix_clock) |
262 |
+ { |
263 |
+ int bpp = convert_bpc_to_bpp(radeon_get_monitor_bpc(connector)); |
264 |
+- int max_link_rate = drm_dp_max_link_rate(dpcd); |
265 |
++ int max_link_rate = radeon_dp_get_max_link_rate(connector, dpcd); |
266 |
+ int max_lane_num = drm_dp_max_lane_count(dpcd); |
267 |
+ int lane_num; |
268 |
+ int max_dp_pix_clock; |
269 |
+@@ -431,7 +444,7 @@ static int radeon_dp_get_dp_link_clock(struct drm_connector *connector, |
270 |
+ return 540000; |
271 |
+ } |
272 |
+ |
273 |
+- return drm_dp_max_link_rate(dpcd); |
274 |
++ return radeon_dp_get_max_link_rate(connector, dpcd); |
275 |
+ } |
276 |
+ |
277 |
+ static u8 radeon_dp_encoder_service(struct radeon_device *rdev, |
278 |
+diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c |
279 |
+index 1f7f3ce875c8..5802d7486354 100644 |
280 |
+--- a/drivers/gpu/drm/radeon/atombios_encoders.c |
281 |
++++ b/drivers/gpu/drm/radeon/atombios_encoders.c |
282 |
+@@ -1877,8 +1877,11 @@ atombios_set_encoder_crtc_source(struct drm_encoder *encoder) |
283 |
+ args.v2.ucEncodeMode = ATOM_ENCODER_MODE_CRT; |
284 |
+ else |
285 |
+ args.v2.ucEncodeMode = atombios_get_encoder_mode(encoder); |
286 |
+- } else |
287 |
++ } else if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { |
288 |
++ args.v2.ucEncodeMode = ATOM_ENCODER_MODE_LVDS; |
289 |
++ } else { |
290 |
+ args.v2.ucEncodeMode = atombios_get_encoder_mode(encoder); |
291 |
++ } |
292 |
+ switch (radeon_encoder->encoder_id) { |
293 |
+ case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: |
294 |
+ case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1: |
295 |
+diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c |
296 |
+index 5a87c9fc78d3..fc604fc75797 100644 |
297 |
+--- a/drivers/gpu/drm/radeon/radeon_connectors.c |
298 |
++++ b/drivers/gpu/drm/radeon/radeon_connectors.c |
299 |
+@@ -1345,7 +1345,7 @@ bool radeon_connector_is_dp12_capable(struct drm_connector *connector) |
300 |
+ struct radeon_device *rdev = dev->dev_private; |
301 |
+ |
302 |
+ if (ASIC_IS_DCE5(rdev) && |
303 |
+- (rdev->clock.dp_extclk >= 53900) && |
304 |
++ (rdev->clock.default_dispclk >= 53900) && |
305 |
+ radeon_connector_encoder_is_hbr2(connector)) { |
306 |
+ return true; |
307 |
+ } |
308 |
+diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c |
309 |
+index fe36f1d9496d..60af3cda587b 100644 |
310 |
+--- a/drivers/gpu/drm/radeon/radeon_cs.c |
311 |
++++ b/drivers/gpu/drm/radeon/radeon_cs.c |
312 |
+@@ -96,6 +96,12 @@ static int radeon_cs_parser_relocs(struct radeon_cs_parser *p) |
313 |
+ uint32_t domain = r->write_domain ? |
314 |
+ r->write_domain : r->read_domains; |
315 |
+ |
316 |
++ if (domain & RADEON_GEM_DOMAIN_CPU) { |
317 |
++ DRM_ERROR("RADEON_GEM_DOMAIN_CPU is not valid " |
318 |
++ "for command submission\n"); |
319 |
++ return -EINVAL; |
320 |
++ } |
321 |
++ |
322 |
+ p->relocs[i].lobj.domain = domain; |
323 |
+ if (domain == RADEON_GEM_DOMAIN_VRAM) |
324 |
+ domain |= RADEON_GEM_DOMAIN_GTT; |
325 |
+diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c |
326 |
+index 021b5227e783..1b0f34bd3a03 100644 |
327 |
+--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c |
328 |
++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c |
329 |
+@@ -179,7 +179,6 @@ static int vmw_fb_set_par(struct fb_info *info) |
330 |
+ vmw_write(vmw_priv, SVGA_REG_DISPLAY_POSITION_Y, info->var.yoffset); |
331 |
+ vmw_write(vmw_priv, SVGA_REG_DISPLAY_WIDTH, info->var.xres); |
332 |
+ vmw_write(vmw_priv, SVGA_REG_DISPLAY_HEIGHT, info->var.yres); |
333 |
+- vmw_write(vmw_priv, SVGA_REG_BYTES_PER_LINE, info->fix.line_length); |
334 |
+ vmw_write(vmw_priv, SVGA_REG_DISPLAY_ID, SVGA_ID_INVALID); |
335 |
+ } |
336 |
+ |
337 |
+diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c |
338 |
+index 4958b2f89dce..371c1ee233b7 100644 |
339 |
+--- a/drivers/hwmon/ina2xx.c |
340 |
++++ b/drivers/hwmon/ina2xx.c |
341 |
+@@ -147,7 +147,8 @@ static int ina2xx_get_value(struct ina2xx_data *data, u8 reg) |
342 |
+ |
343 |
+ switch (reg) { |
344 |
+ case INA2XX_SHUNT_VOLTAGE: |
345 |
+- val = DIV_ROUND_CLOSEST(data->regs[reg], |
346 |
++ /* signed register */ |
347 |
++ val = DIV_ROUND_CLOSEST((s16)data->regs[reg], |
348 |
+ data->config->shunt_div); |
349 |
+ break; |
350 |
+ case INA2XX_BUS_VOLTAGE: |
351 |
+@@ -159,8 +160,8 @@ static int ina2xx_get_value(struct ina2xx_data *data, u8 reg) |
352 |
+ val = data->regs[reg] * data->config->power_lsb; |
353 |
+ break; |
354 |
+ case INA2XX_CURRENT: |
355 |
+- /* LSB=1mA (selected). Is in mA */ |
356 |
+- val = data->regs[reg]; |
357 |
++ /* signed register, LSB=1mA (selected), in mA */ |
358 |
++ val = (s16)data->regs[reg]; |
359 |
+ break; |
360 |
+ default: |
361 |
+ /* programmer goofed */ |
362 |
+diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c |
363 |
+index 0cf5f8e06cfc..1e8e94d4db7d 100644 |
364 |
+--- a/drivers/iio/inkern.c |
365 |
++++ b/drivers/iio/inkern.c |
366 |
+@@ -183,7 +183,7 @@ static struct iio_channel *of_iio_channel_get_by_name(struct device_node *np, |
367 |
+ else if (name && index >= 0) { |
368 |
+ pr_err("ERROR: could not get IIO channel %s:%s(%i)\n", |
369 |
+ np->full_name, name ? name : "", index); |
370 |
+- return chan; |
371 |
++ return NULL; |
372 |
+ } |
373 |
+ |
374 |
+ /* |
375 |
+@@ -193,8 +193,9 @@ static struct iio_channel *of_iio_channel_get_by_name(struct device_node *np, |
376 |
+ */ |
377 |
+ np = np->parent; |
378 |
+ if (np && !of_get_property(np, "io-channel-ranges", NULL)) |
379 |
+- break; |
380 |
++ return NULL; |
381 |
+ } |
382 |
++ |
383 |
+ return chan; |
384 |
+ } |
385 |
+ |
386 |
+@@ -317,6 +318,7 @@ struct iio_channel *iio_channel_get(struct device *dev, |
387 |
+ if (channel != NULL) |
388 |
+ return channel; |
389 |
+ } |
390 |
++ |
391 |
+ return iio_channel_get_sys(name, channel_name); |
392 |
+ } |
393 |
+ EXPORT_SYMBOL_GPL(iio_channel_get); |
394 |
+diff --git a/drivers/irqchip/spear-shirq.c b/drivers/irqchip/spear-shirq.c |
395 |
+index 8527743b5cef..391b9cea73ed 100644 |
396 |
+--- a/drivers/irqchip/spear-shirq.c |
397 |
++++ b/drivers/irqchip/spear-shirq.c |
398 |
+@@ -125,7 +125,7 @@ static struct spear_shirq spear320_shirq_ras2 = { |
399 |
+ }; |
400 |
+ |
401 |
+ static struct spear_shirq spear320_shirq_ras3 = { |
402 |
+- .irq_nr = 3, |
403 |
++ .irq_nr = 7, |
404 |
+ .irq_bit_off = 0, |
405 |
+ .invalid_irq = 1, |
406 |
+ .regs = { |
407 |
+diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c |
408 |
+index 7d0ac0a6e724..86a2a5e3b26b 100644 |
409 |
+--- a/drivers/md/dm-thin.c |
410 |
++++ b/drivers/md/dm-thin.c |
411 |
+@@ -2647,7 +2647,8 @@ static void set_discard_limits(struct pool_c *pt, struct queue_limits *limits) |
412 |
+ */ |
413 |
+ if (pt->adjusted_pf.discard_passdown) { |
414 |
+ data_limits = &bdev_get_queue(pt->data_dev->bdev)->limits; |
415 |
+- limits->discard_granularity = data_limits->discard_granularity; |
416 |
++ limits->discard_granularity = max(data_limits->discard_granularity, |
417 |
++ pool->sectors_per_block << SECTOR_SHIFT); |
418 |
+ } else |
419 |
+ limits->discard_granularity = pool->sectors_per_block << SECTOR_SHIFT; |
420 |
+ } |
421 |
+diff --git a/drivers/md/md.c b/drivers/md/md.c |
422 |
+index 963fa59be9b3..aaf77b07bb72 100644 |
423 |
+--- a/drivers/md/md.c |
424 |
++++ b/drivers/md/md.c |
425 |
+@@ -7447,6 +7447,19 @@ void md_do_sync(struct md_thread *thread) |
426 |
+ rdev->recovery_offset < j) |
427 |
+ j = rdev->recovery_offset; |
428 |
+ rcu_read_unlock(); |
429 |
++ |
430 |
++ /* If there is a bitmap, we need to make sure all |
431 |
++ * writes that started before we added a spare |
432 |
++ * complete before we start doing a recovery. |
433 |
++ * Otherwise the write might complete and (via |
434 |
++ * bitmap_endwrite) set a bit in the bitmap after the |
435 |
++ * recovery has checked that bit and skipped that |
436 |
++ * region. |
437 |
++ */ |
438 |
++ if (mddev->bitmap) { |
439 |
++ mddev->pers->quiesce(mddev, 1); |
440 |
++ mddev->pers->quiesce(mddev, 0); |
441 |
++ } |
442 |
+ } |
443 |
+ |
444 |
+ printk(KERN_INFO "md: %s of RAID array %s\n", desc, mdname(mddev)); |
445 |
+diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c |
446 |
+index ad13f4240c49..7ffb5cba30a9 100644 |
447 |
+--- a/drivers/mmc/host/rtsx_pci_sdmmc.c |
448 |
++++ b/drivers/mmc/host/rtsx_pci_sdmmc.c |
449 |
+@@ -247,6 +247,9 @@ static void sd_send_cmd_get_rsp(struct realtek_pci_sdmmc *host, |
450 |
+ case MMC_RSP_R1: |
451 |
+ rsp_type = SD_RSP_TYPE_R1; |
452 |
+ break; |
453 |
++ case MMC_RSP_R1 & ~MMC_RSP_CRC: |
454 |
++ rsp_type = SD_RSP_TYPE_R1 | SD_NO_CHECK_CRC7; |
455 |
++ break; |
456 |
+ case MMC_RSP_R1B: |
457 |
+ rsp_type = SD_RSP_TYPE_R1b; |
458 |
+ break; |
459 |
+diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c |
460 |
+index 20657209a472..c31d183820c5 100644 |
461 |
+--- a/drivers/mtd/nand/fsl_elbc_nand.c |
462 |
++++ b/drivers/mtd/nand/fsl_elbc_nand.c |
463 |
+@@ -725,6 +725,19 @@ static int fsl_elbc_write_page(struct mtd_info *mtd, struct nand_chip *chip, |
464 |
+ return 0; |
465 |
+ } |
466 |
+ |
467 |
++/* ECC will be calculated automatically, and errors will be detected in |
468 |
++ * waitfunc. |
469 |
++ */ |
470 |
++static int fsl_elbc_write_subpage(struct mtd_info *mtd, struct nand_chip *chip, |
471 |
++ uint32_t offset, uint32_t data_len, |
472 |
++ const uint8_t *buf, int oob_required) |
473 |
++{ |
474 |
++ fsl_elbc_write_buf(mtd, buf, mtd->writesize); |
475 |
++ fsl_elbc_write_buf(mtd, chip->oob_poi, mtd->oobsize); |
476 |
++ |
477 |
++ return 0; |
478 |
++} |
479 |
++ |
480 |
+ static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv) |
481 |
+ { |
482 |
+ struct fsl_lbc_ctrl *ctrl = priv->ctrl; |
483 |
+@@ -763,6 +776,7 @@ static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv) |
484 |
+ |
485 |
+ chip->ecc.read_page = fsl_elbc_read_page; |
486 |
+ chip->ecc.write_page = fsl_elbc_write_page; |
487 |
++ chip->ecc.write_subpage = fsl_elbc_write_subpage; |
488 |
+ |
489 |
+ /* If CS Base Register selects full hardware ECC then use it */ |
490 |
+ if ((in_be32(&lbc->bank[priv->bank].br) & BR_DECC) == |
491 |
+diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c |
492 |
+index 81b80af55872..8c4eb287bbdb 100644 |
493 |
+--- a/drivers/mtd/nand/omap2.c |
494 |
++++ b/drivers/mtd/nand/omap2.c |
495 |
+@@ -1463,7 +1463,7 @@ static int omap_elm_correct_data(struct mtd_info *mtd, u_char *data, |
496 |
+ |
497 |
+ /* Check if any error reported */ |
498 |
+ if (!is_error_reported) |
499 |
+- return 0; |
500 |
++ return stat; |
501 |
+ |
502 |
+ /* Decode BCH error using ELM module */ |
503 |
+ elm_decode_bch_error_page(info->elm_dev, ecc_vec, err_vec); |
504 |
+diff --git a/drivers/net/wireless/b43/xmit.c b/drivers/net/wireless/b43/xmit.c |
505 |
+index e85d34b76039..ebcce00ce067 100644 |
506 |
+--- a/drivers/net/wireless/b43/xmit.c |
507 |
++++ b/drivers/net/wireless/b43/xmit.c |
508 |
+@@ -810,9 +810,13 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr) |
509 |
+ break; |
510 |
+ case B43_PHYTYPE_G: |
511 |
+ status.band = IEEE80211_BAND_2GHZ; |
512 |
+- /* chanid is the radio channel cookie value as used |
513 |
+- * to tune the radio. */ |
514 |
+- status.freq = chanid + 2400; |
515 |
++ /* Somewhere between 478.104 and 508.1084 firmware for G-PHY |
516 |
++ * has been modified to be compatible with N-PHY and others. |
517 |
++ */ |
518 |
++ if (dev->fw.rev >= 508) |
519 |
++ status.freq = ieee80211_channel_to_frequency(chanid, status.band); |
520 |
++ else |
521 |
++ status.freq = chanid + 2400; |
522 |
+ break; |
523 |
+ case B43_PHYTYPE_N: |
524 |
+ case B43_PHYTYPE_LP: |
525 |
+diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c |
526 |
+index 4088dd5e9244..ff04135d37af 100644 |
527 |
+--- a/drivers/net/wireless/iwlwifi/pcie/trans.c |
528 |
++++ b/drivers/net/wireless/iwlwifi/pcie/trans.c |
529 |
+@@ -339,6 +339,7 @@ static int iwl_pcie_prepare_card_hw(struct iwl_trans *trans) |
530 |
+ { |
531 |
+ int ret; |
532 |
+ int t = 0; |
533 |
++ int iter; |
534 |
+ |
535 |
+ IWL_DEBUG_INFO(trans, "iwl_trans_prepare_card_hw enter\n"); |
536 |
+ |
537 |
+@@ -347,18 +348,23 @@ static int iwl_pcie_prepare_card_hw(struct iwl_trans *trans) |
538 |
+ if (ret >= 0) |
539 |
+ return 0; |
540 |
+ |
541 |
+- /* If HW is not ready, prepare the conditions to check again */ |
542 |
+- iwl_set_bit(trans, CSR_HW_IF_CONFIG_REG, |
543 |
+- CSR_HW_IF_CONFIG_REG_PREPARE); |
544 |
++ for (iter = 0; iter < 10; iter++) { |
545 |
++ /* If HW is not ready, prepare the conditions to check again */ |
546 |
++ iwl_set_bit(trans, CSR_HW_IF_CONFIG_REG, |
547 |
++ CSR_HW_IF_CONFIG_REG_PREPARE); |
548 |
++ |
549 |
++ do { |
550 |
++ ret = iwl_pcie_set_hw_ready(trans); |
551 |
++ if (ret >= 0) |
552 |
++ return 0; |
553 |
+ |
554 |
+- do { |
555 |
+- ret = iwl_pcie_set_hw_ready(trans); |
556 |
+- if (ret >= 0) |
557 |
+- return 0; |
558 |
++ usleep_range(200, 1000); |
559 |
++ t += 200; |
560 |
++ } while (t < 150000); |
561 |
++ msleep(25); |
562 |
++ } |
563 |
+ |
564 |
+- usleep_range(200, 1000); |
565 |
+- t += 200; |
566 |
+- } while (t < 150000); |
567 |
++ IWL_DEBUG_INFO(trans, "got NIC after %d iterations\n", iter); |
568 |
+ |
569 |
+ return ret; |
570 |
+ } |
571 |
+diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c |
572 |
+index 77e45b223d15..d582febbfba2 100644 |
573 |
+--- a/drivers/net/wireless/rt2x00/rt2500pci.c |
574 |
++++ b/drivers/net/wireless/rt2x00/rt2500pci.c |
575 |
+@@ -1684,8 +1684,13 @@ static int rt2500pci_init_eeprom(struct rt2x00_dev *rt2x00dev) |
576 |
+ /* |
577 |
+ * Detect if this device has an hardware controlled radio. |
578 |
+ */ |
579 |
+- if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO)) |
580 |
++ if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO)) { |
581 |
+ __set_bit(CAPABILITY_HW_BUTTON, &rt2x00dev->cap_flags); |
582 |
++ /* |
583 |
++ * On this device RFKILL initialized during probe does not work. |
584 |
++ */ |
585 |
++ __set_bit(REQUIRE_DELAYED_RFKILL, &rt2x00dev->cap_flags); |
586 |
++ } |
587 |
+ |
588 |
+ /* |
589 |
+ * Check if the BBP tuning should be enabled. |
590 |
+diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h |
591 |
+index 7510723a8c37..1e716ff0f19e 100644 |
592 |
+--- a/drivers/net/wireless/rt2x00/rt2x00.h |
593 |
++++ b/drivers/net/wireless/rt2x00/rt2x00.h |
594 |
+@@ -708,6 +708,7 @@ enum rt2x00_capability_flags { |
595 |
+ REQUIRE_SW_SEQNO, |
596 |
+ REQUIRE_HT_TX_DESC, |
597 |
+ REQUIRE_PS_AUTOWAKE, |
598 |
++ REQUIRE_DELAYED_RFKILL, |
599 |
+ |
600 |
+ /* |
601 |
+ * Capabilities |
602 |
+diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c |
603 |
+index a2889d1cfe37..e22942bc2bb1 100644 |
604 |
+--- a/drivers/net/wireless/rt2x00/rt2x00dev.c |
605 |
++++ b/drivers/net/wireless/rt2x00/rt2x00dev.c |
606 |
+@@ -1128,9 +1128,10 @@ static void rt2x00lib_uninitialize(struct rt2x00_dev *rt2x00dev) |
607 |
+ return; |
608 |
+ |
609 |
+ /* |
610 |
+- * Unregister extra components. |
611 |
++ * Stop rfkill polling. |
612 |
+ */ |
613 |
+- rt2x00rfkill_unregister(rt2x00dev); |
614 |
++ if (test_bit(REQUIRE_DELAYED_RFKILL, &rt2x00dev->cap_flags)) |
615 |
++ rt2x00rfkill_unregister(rt2x00dev); |
616 |
+ |
617 |
+ /* |
618 |
+ * Allow the HW to uninitialize. |
619 |
+@@ -1168,6 +1169,12 @@ static int rt2x00lib_initialize(struct rt2x00_dev *rt2x00dev) |
620 |
+ |
621 |
+ set_bit(DEVICE_STATE_INITIALIZED, &rt2x00dev->flags); |
622 |
+ |
623 |
++ /* |
624 |
++ * Start rfkill polling. |
625 |
++ */ |
626 |
++ if (test_bit(REQUIRE_DELAYED_RFKILL, &rt2x00dev->cap_flags)) |
627 |
++ rt2x00rfkill_register(rt2x00dev); |
628 |
++ |
629 |
+ return 0; |
630 |
+ } |
631 |
+ |
632 |
+@@ -1363,7 +1370,12 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev) |
633 |
+ rt2x00link_register(rt2x00dev); |
634 |
+ rt2x00leds_register(rt2x00dev); |
635 |
+ rt2x00debug_register(rt2x00dev); |
636 |
+- rt2x00rfkill_register(rt2x00dev); |
637 |
++ |
638 |
++ /* |
639 |
++ * Start rfkill polling. |
640 |
++ */ |
641 |
++ if (!test_bit(REQUIRE_DELAYED_RFKILL, &rt2x00dev->cap_flags)) |
642 |
++ rt2x00rfkill_register(rt2x00dev); |
643 |
+ |
644 |
+ return 0; |
645 |
+ |
646 |
+@@ -1379,6 +1391,12 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev) |
647 |
+ clear_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags); |
648 |
+ |
649 |
+ /* |
650 |
++ * Stop rfkill polling. |
651 |
++ */ |
652 |
++ if (!test_bit(REQUIRE_DELAYED_RFKILL, &rt2x00dev->cap_flags)) |
653 |
++ rt2x00rfkill_unregister(rt2x00dev); |
654 |
++ |
655 |
++ /* |
656 |
+ * Disable radio. |
657 |
+ */ |
658 |
+ rt2x00lib_disable_radio(rt2x00dev); |
659 |
+diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c |
660 |
+index 2b724fc4e306..c03748dafd49 100644 |
661 |
+--- a/drivers/net/wireless/rt2x00/rt2x00mac.c |
662 |
++++ b/drivers/net/wireless/rt2x00/rt2x00mac.c |
663 |
+@@ -489,6 +489,8 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, |
664 |
+ crypto.cipher = rt2x00crypto_key_to_cipher(key); |
665 |
+ if (crypto.cipher == CIPHER_NONE) |
666 |
+ return -EOPNOTSUPP; |
667 |
++ if (crypto.cipher == CIPHER_TKIP && rt2x00_is_usb(rt2x00dev)) |
668 |
++ return -EOPNOTSUPP; |
669 |
+ |
670 |
+ crypto.cmd = cmd; |
671 |
+ |
672 |
+diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c |
673 |
+index d0fa4b6c551f..c62b3e5d44bd 100644 |
674 |
+--- a/drivers/scsi/ibmvscsi/ibmvscsi.c |
675 |
++++ b/drivers/scsi/ibmvscsi/ibmvscsi.c |
676 |
+@@ -185,6 +185,11 @@ static struct viosrp_crq *crq_queue_next_crq(struct crq_queue *queue) |
677 |
+ if (crq->valid & 0x80) { |
678 |
+ if (++queue->cur == queue->size) |
679 |
+ queue->cur = 0; |
680 |
++ |
681 |
++ /* Ensure the read of the valid bit occurs before reading any |
682 |
++ * other bits of the CRQ entry |
683 |
++ */ |
684 |
++ rmb(); |
685 |
+ } else |
686 |
+ crq = NULL; |
687 |
+ spin_unlock_irqrestore(&queue->lock, flags); |
688 |
+@@ -203,6 +208,11 @@ static int ibmvscsi_send_crq(struct ibmvscsi_host_data *hostdata, |
689 |
+ { |
690 |
+ struct vio_dev *vdev = to_vio_dev(hostdata->dev); |
691 |
+ |
692 |
++ /* |
693 |
++ * Ensure the command buffer is flushed to memory before handing it |
694 |
++ * over to the VIOS to prevent it from fetching any stale data. |
695 |
++ */ |
696 |
++ mb(); |
697 |
+ return plpar_hcall_norets(H_SEND_CRQ, vdev->unit_address, word1, word2); |
698 |
+ } |
699 |
+ |
700 |
+@@ -794,7 +804,8 @@ static void purge_requests(struct ibmvscsi_host_data *hostdata, int error_code) |
701 |
+ evt->hostdata->dev); |
702 |
+ if (evt->cmnd_done) |
703 |
+ evt->cmnd_done(evt->cmnd); |
704 |
+- } else if (evt->done) |
705 |
++ } else if (evt->done && evt->crq.format != VIOSRP_MAD_FORMAT && |
706 |
++ evt->iu.srp.login_req.opcode != SRP_LOGIN_REQ) |
707 |
+ evt->done(evt); |
708 |
+ free_event_struct(&evt->hostdata->pool, evt); |
709 |
+ spin_lock_irqsave(hostdata->host->host_lock, flags); |
710 |
+diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c |
711 |
+index d92fe4037e94..6b349e301869 100644 |
712 |
+--- a/drivers/scsi/sym53c8xx_2/sym_hipd.c |
713 |
++++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c |
714 |
+@@ -3000,7 +3000,11 @@ sym_dequeue_from_squeue(struct sym_hcb *np, int i, int target, int lun, int task |
715 |
+ if ((target == -1 || cp->target == target) && |
716 |
+ (lun == -1 || cp->lun == lun) && |
717 |
+ (task == -1 || cp->tag == task)) { |
718 |
++#ifdef SYM_OPT_HANDLE_DEVICE_QUEUEING |
719 |
+ sym_set_cam_status(cp->cmd, DID_SOFT_ERROR); |
720 |
++#else |
721 |
++ sym_set_cam_status(cp->cmd, DID_REQUEUE); |
722 |
++#endif |
723 |
+ sym_remque(&cp->link_ccbq); |
724 |
+ sym_insque_tail(&cp->link_ccbq, &np->comp_ccbq); |
725 |
+ } |
726 |
+diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c |
727 |
+index 95a5d73e675c..11f5326f449f 100644 |
728 |
+--- a/drivers/scsi/virtio_scsi.c |
729 |
++++ b/drivers/scsi/virtio_scsi.c |
730 |
+@@ -270,6 +270,16 @@ static void virtscsi_req_done(struct virtqueue *vq) |
731 |
+ virtscsi_vq_done(vscsi, req_vq, virtscsi_complete_cmd); |
732 |
+ }; |
733 |
+ |
734 |
++static void virtscsi_poll_requests(struct virtio_scsi *vscsi) |
735 |
++{ |
736 |
++ int i, num_vqs; |
737 |
++ |
738 |
++ num_vqs = vscsi->num_queues; |
739 |
++ for (i = 0; i < num_vqs; i++) |
740 |
++ virtscsi_vq_done(vscsi, &vscsi->req_vqs[i], |
741 |
++ virtscsi_complete_cmd); |
742 |
++} |
743 |
++ |
744 |
+ static void virtscsi_complete_free(struct virtio_scsi *vscsi, void *buf) |
745 |
+ { |
746 |
+ struct virtio_scsi_cmd *cmd = buf; |
747 |
+@@ -288,6 +298,8 @@ static void virtscsi_ctrl_done(struct virtqueue *vq) |
748 |
+ virtscsi_vq_done(vscsi, &vscsi->ctrl_vq, virtscsi_complete_free); |
749 |
+ }; |
750 |
+ |
751 |
++static void virtscsi_handle_event(struct work_struct *work); |
752 |
++ |
753 |
+ static int virtscsi_kick_event(struct virtio_scsi *vscsi, |
754 |
+ struct virtio_scsi_event_node *event_node) |
755 |
+ { |
756 |
+@@ -295,6 +307,7 @@ static int virtscsi_kick_event(struct virtio_scsi *vscsi, |
757 |
+ struct scatterlist sg; |
758 |
+ unsigned long flags; |
759 |
+ |
760 |
++ INIT_WORK(&event_node->work, virtscsi_handle_event); |
761 |
+ sg_init_one(&sg, &event_node->event, sizeof(struct virtio_scsi_event)); |
762 |
+ |
763 |
+ spin_lock_irqsave(&vscsi->event_vq.vq_lock, flags); |
764 |
+@@ -412,7 +425,6 @@ static void virtscsi_complete_event(struct virtio_scsi *vscsi, void *buf) |
765 |
+ { |
766 |
+ struct virtio_scsi_event_node *event_node = buf; |
767 |
+ |
768 |
+- INIT_WORK(&event_node->work, virtscsi_handle_event); |
769 |
+ schedule_work(&event_node->work); |
770 |
+ } |
771 |
+ |
772 |
+@@ -602,6 +614,18 @@ static int virtscsi_tmf(struct virtio_scsi *vscsi, struct virtio_scsi_cmd *cmd) |
773 |
+ cmd->resp.tmf.response == VIRTIO_SCSI_S_FUNCTION_SUCCEEDED) |
774 |
+ ret = SUCCESS; |
775 |
+ |
776 |
++ /* |
777 |
++ * The spec guarantees that all requests related to the TMF have |
778 |
++ * been completed, but the callback might not have run yet if |
779 |
++ * we're using independent interrupts (e.g. MSI). Poll the |
780 |
++ * virtqueues once. |
781 |
++ * |
782 |
++ * In the abort case, sc->scsi_done will do nothing, because |
783 |
++ * the block layer must have detected a timeout and as a result |
784 |
++ * REQ_ATOM_COMPLETE has been set. |
785 |
++ */ |
786 |
++ virtscsi_poll_requests(vscsi); |
787 |
++ |
788 |
+ out: |
789 |
+ mempool_free(cmd, virtscsi_cmd_pool); |
790 |
+ return ret; |
791 |
+diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c |
792 |
+index 5d880917850f..345b5ddcb1a0 100644 |
793 |
+--- a/drivers/tty/serial/8250/8250_dw.c |
794 |
++++ b/drivers/tty/serial/8250/8250_dw.c |
795 |
+@@ -54,58 +54,100 @@ |
796 |
+ |
797 |
+ |
798 |
+ struct dw8250_data { |
799 |
+- int last_lcr; |
800 |
++ int last_mcr; |
801 |
+ int line; |
802 |
+ struct clk *clk; |
803 |
+ }; |
804 |
+ |
805 |
++static inline int dw8250_modify_msr(struct uart_port *p, int offset, int value) |
806 |
++{ |
807 |
++ struct dw8250_data *d = p->private_data; |
808 |
++ |
809 |
++ /* If reading MSR, report CTS asserted when auto-CTS/RTS enabled */ |
810 |
++ if (offset == UART_MSR && d->last_mcr & UART_MCR_AFE) { |
811 |
++ value |= UART_MSR_CTS; |
812 |
++ value &= ~UART_MSR_DCTS; |
813 |
++ } |
814 |
++ |
815 |
++ return value; |
816 |
++} |
817 |
++ |
818 |
++static void dw8250_force_idle(struct uart_port *p) |
819 |
++{ |
820 |
++ serial8250_clear_and_reinit_fifos(container_of |
821 |
++ (p, struct uart_8250_port, port)); |
822 |
++ (void)p->serial_in(p, UART_RX); |
823 |
++} |
824 |
++ |
825 |
+ static void dw8250_serial_out(struct uart_port *p, int offset, int value) |
826 |
+ { |
827 |
+ struct dw8250_data *d = p->private_data; |
828 |
+ |
829 |
+- if (offset == UART_LCR) |
830 |
+- d->last_lcr = value; |
831 |
++ if (offset == UART_MCR) |
832 |
++ d->last_mcr = value; |
833 |
++ |
834 |
++ writeb(value, p->membase + (offset << p->regshift)); |
835 |
+ |
836 |
+- offset <<= p->regshift; |
837 |
+- writeb(value, p->membase + offset); |
838 |
++ /* Make sure LCR write wasn't ignored */ |
839 |
++ if (offset == UART_LCR) { |
840 |
++ int tries = 1000; |
841 |
++ while (tries--) { |
842 |
++ unsigned int lcr = p->serial_in(p, UART_LCR); |
843 |
++ if ((value & ~UART_LCR_SPAR) == (lcr & ~UART_LCR_SPAR)) |
844 |
++ return; |
845 |
++ dw8250_force_idle(p); |
846 |
++ writeb(value, p->membase + (UART_LCR << p->regshift)); |
847 |
++ } |
848 |
++ dev_err(p->dev, "Couldn't set LCR to %d\n", value); |
849 |
++ } |
850 |
+ } |
851 |
+ |
852 |
+ static unsigned int dw8250_serial_in(struct uart_port *p, int offset) |
853 |
+ { |
854 |
+- offset <<= p->regshift; |
855 |
++ unsigned int value = readb(p->membase + (offset << p->regshift)); |
856 |
+ |
857 |
+- return readb(p->membase + offset); |
858 |
++ return dw8250_modify_msr(p, offset, value); |
859 |
+ } |
860 |
+ |
861 |
+ static void dw8250_serial_out32(struct uart_port *p, int offset, int value) |
862 |
+ { |
863 |
+ struct dw8250_data *d = p->private_data; |
864 |
+ |
865 |
+- if (offset == UART_LCR) |
866 |
+- d->last_lcr = value; |
867 |
++ if (offset == UART_MCR) |
868 |
++ d->last_mcr = value; |
869 |
+ |
870 |
+- offset <<= p->regshift; |
871 |
+- writel(value, p->membase + offset); |
872 |
++ writel(value, p->membase + (offset << p->regshift)); |
873 |
++ |
874 |
++ /* Make sure LCR write wasn't ignored */ |
875 |
++ if (offset == UART_LCR) { |
876 |
++ int tries = 1000; |
877 |
++ while (tries--) { |
878 |
++ unsigned int lcr = p->serial_in(p, UART_LCR); |
879 |
++ if ((value & ~UART_LCR_SPAR) == (lcr & ~UART_LCR_SPAR)) |
880 |
++ return; |
881 |
++ dw8250_force_idle(p); |
882 |
++ writel(value, p->membase + (UART_LCR << p->regshift)); |
883 |
++ } |
884 |
++ dev_err(p->dev, "Couldn't set LCR to %d\n", value); |
885 |
++ } |
886 |
+ } |
887 |
+ |
888 |
+ static unsigned int dw8250_serial_in32(struct uart_port *p, int offset) |
889 |
+ { |
890 |
+- offset <<= p->regshift; |
891 |
++ unsigned int value = readl(p->membase + (offset << p->regshift)); |
892 |
+ |
893 |
+- return readl(p->membase + offset); |
894 |
++ return dw8250_modify_msr(p, offset, value); |
895 |
+ } |
896 |
+ |
897 |
+ static int dw8250_handle_irq(struct uart_port *p) |
898 |
+ { |
899 |
+- struct dw8250_data *d = p->private_data; |
900 |
+ unsigned int iir = p->serial_in(p, UART_IIR); |
901 |
+ |
902 |
+ if (serial8250_handle_irq(p, iir)) { |
903 |
+ return 1; |
904 |
+ } else if ((iir & UART_IIR_BUSY) == UART_IIR_BUSY) { |
905 |
+- /* Clear the USR and write the LCR again. */ |
906 |
++ /* Clear the USR */ |
907 |
+ (void)p->serial_in(p, DW_UART_USR); |
908 |
+- p->serial_out(p, UART_LCR, d->last_lcr); |
909 |
+ |
910 |
+ return 1; |
911 |
+ } |
912 |
+diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c |
913 |
+index b6e9d917221e..84219f656051 100644 |
914 |
+--- a/drivers/usb/gadget/f_fs.c |
915 |
++++ b/drivers/usb/gadget/f_fs.c |
916 |
+@@ -1389,11 +1389,13 @@ static int functionfs_bind(struct ffs_data *ffs, struct usb_composite_dev *cdev) |
917 |
+ ffs->ep0req->context = ffs; |
918 |
+ |
919 |
+ lang = ffs->stringtabs; |
920 |
+- for (lang = ffs->stringtabs; *lang; ++lang) { |
921 |
+- struct usb_string *str = (*lang)->strings; |
922 |
+- int id = first_id; |
923 |
+- for (; str->s; ++id, ++str) |
924 |
+- str->id = id; |
925 |
++ if (lang) { |
926 |
++ for (; *lang; ++lang) { |
927 |
++ struct usb_string *str = (*lang)->strings; |
928 |
++ int id = first_id; |
929 |
++ for (; str->s; ++id, ++str) |
930 |
++ str->id = id; |
931 |
++ } |
932 |
+ } |
933 |
+ |
934 |
+ ffs->gadget = cdev->gadget; |
935 |
+diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c |
936 |
+index bcfb08e41eb6..fe42cae6d1ef 100644 |
937 |
+--- a/drivers/usb/host/xhci-ring.c |
938 |
++++ b/drivers/usb/host/xhci-ring.c |
939 |
+@@ -3590,7 +3590,7 @@ static unsigned int xhci_get_burst_count(struct xhci_hcd *xhci, |
940 |
+ return 0; |
941 |
+ |
942 |
+ max_burst = urb->ep->ss_ep_comp.bMaxBurst; |
943 |
+- return roundup(total_packet_count, max_burst + 1) - 1; |
944 |
++ return DIV_ROUND_UP(total_packet_count, max_burst + 1) - 1; |
945 |
+ } |
946 |
+ |
947 |
+ /* |
948 |
+diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c |
949 |
+index 4b46de842175..9a7088bc634d 100644 |
950 |
+--- a/drivers/usb/host/xhci.c |
951 |
++++ b/drivers/usb/host/xhci.c |
952 |
+@@ -960,7 +960,7 @@ int xhci_suspend(struct xhci_hcd *xhci) |
953 |
+ */ |
954 |
+ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) |
955 |
+ { |
956 |
+- u32 command, temp = 0; |
957 |
++ u32 command, temp = 0, status; |
958 |
+ struct usb_hcd *hcd = xhci_to_hcd(xhci); |
959 |
+ struct usb_hcd *secondary_hcd; |
960 |
+ int retval = 0; |
961 |
+@@ -1084,8 +1084,12 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) |
962 |
+ |
963 |
+ done: |
964 |
+ if (retval == 0) { |
965 |
+- usb_hcd_resume_root_hub(hcd); |
966 |
+- usb_hcd_resume_root_hub(xhci->shared_hcd); |
967 |
++ /* Resume root hubs only when have pending events. */ |
968 |
++ status = readl(&xhci->op_regs->status); |
969 |
++ if (status & STS_EINT) { |
970 |
++ usb_hcd_resume_root_hub(hcd); |
971 |
++ usb_hcd_resume_root_hub(xhci->shared_hcd); |
972 |
++ } |
973 |
+ } |
974 |
+ |
975 |
+ /* |
976 |
+diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c |
977 |
+index b9e663ac9a35..3e315de9bbd4 100644 |
978 |
+--- a/drivers/usb/serial/ftdi_sio.c |
979 |
++++ b/drivers/usb/serial/ftdi_sio.c |
980 |
+@@ -1577,14 +1577,17 @@ static void ftdi_set_max_packet_size(struct usb_serial_port *port) |
981 |
+ struct usb_device *udev = serial->dev; |
982 |
+ |
983 |
+ struct usb_interface *interface = serial->interface; |
984 |
+- struct usb_endpoint_descriptor *ep_desc = &interface->cur_altsetting->endpoint[1].desc; |
985 |
++ struct usb_endpoint_descriptor *ep_desc; |
986 |
+ |
987 |
+ unsigned num_endpoints; |
988 |
+- int i; |
989 |
++ unsigned i; |
990 |
+ |
991 |
+ num_endpoints = interface->cur_altsetting->desc.bNumEndpoints; |
992 |
+ dev_info(&udev->dev, "Number of endpoints %d\n", num_endpoints); |
993 |
+ |
994 |
++ if (!num_endpoints) |
995 |
++ return; |
996 |
++ |
997 |
+ /* NOTE: some customers have programmed FT232R/FT245R devices |
998 |
+ * with an endpoint size of 0 - not good. In this case, we |
999 |
+ * want to override the endpoint descriptor setting and use a |
1000 |
+diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c |
1001 |
+index 70ede84f4f6b..e25e8ca09fe2 100644 |
1002 |
+--- a/drivers/usb/serial/option.c |
1003 |
++++ b/drivers/usb/serial/option.c |
1004 |
+@@ -352,6 +352,9 @@ static void option_instat_callback(struct urb *urb); |
1005 |
+ /* Zoom */ |
1006 |
+ #define ZOOM_PRODUCT_4597 0x9607 |
1007 |
+ |
1008 |
++/* SpeedUp SU9800 usb 3g modem */ |
1009 |
++#define SPEEDUP_PRODUCT_SU9800 0x9800 |
1010 |
++ |
1011 |
+ /* Haier products */ |
1012 |
+ #define HAIER_VENDOR_ID 0x201e |
1013 |
+ #define HAIER_PRODUCT_CE100 0x2009 |
1014 |
+@@ -372,8 +375,12 @@ static void option_instat_callback(struct urb *urb); |
1015 |
+ /* Olivetti products */ |
1016 |
+ #define OLIVETTI_VENDOR_ID 0x0b3c |
1017 |
+ #define OLIVETTI_PRODUCT_OLICARD100 0xc000 |
1018 |
++#define OLIVETTI_PRODUCT_OLICARD120 0xc001 |
1019 |
++#define OLIVETTI_PRODUCT_OLICARD140 0xc002 |
1020 |
+ #define OLIVETTI_PRODUCT_OLICARD145 0xc003 |
1021 |
++#define OLIVETTI_PRODUCT_OLICARD155 0xc004 |
1022 |
+ #define OLIVETTI_PRODUCT_OLICARD200 0xc005 |
1023 |
++#define OLIVETTI_PRODUCT_OLICARD160 0xc00a |
1024 |
+ #define OLIVETTI_PRODUCT_OLICARD500 0xc00b |
1025 |
+ |
1026 |
+ /* Celot products */ |
1027 |
+@@ -1577,6 +1584,7 @@ static const struct usb_device_id option_ids[] = { |
1028 |
+ { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14), |
1029 |
+ .driver_info = (kernel_ulong_t)&four_g_w14_blacklist |
1030 |
+ }, |
1031 |
++ { USB_DEVICE_INTERFACE_CLASS(LONGCHEER_VENDOR_ID, SPEEDUP_PRODUCT_SU9800, 0xff) }, |
1032 |
+ { USB_DEVICE(LONGCHEER_VENDOR_ID, ZOOM_PRODUCT_4597) }, |
1033 |
+ { USB_DEVICE(LONGCHEER_VENDOR_ID, IBALL_3_5G_CONNECT) }, |
1034 |
+ { USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) }, |
1035 |
+@@ -1611,15 +1619,21 @@ static const struct usb_device_id option_ids[] = { |
1036 |
+ { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDMNET) }, |
1037 |
+ { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, /* HC28 enumerates with Siemens or Cinterion VID depending on FW revision */ |
1038 |
+ { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) }, |
1039 |
+- |
1040 |
+- { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) }, |
1041 |
++ { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100), |
1042 |
++ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
1043 |
++ { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD120), |
1044 |
++ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
1045 |
++ { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD140), |
1046 |
++ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
1047 |
+ { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD145) }, |
1048 |
++ { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD155), |
1049 |
++ .driver_info = (kernel_ulong_t)&net_intf6_blacklist }, |
1050 |
+ { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD200), |
1051 |
+- .driver_info = (kernel_ulong_t)&net_intf6_blacklist |
1052 |
+- }, |
1053 |
++ .driver_info = (kernel_ulong_t)&net_intf6_blacklist }, |
1054 |
++ { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD160), |
1055 |
++ .driver_info = (kernel_ulong_t)&net_intf6_blacklist }, |
1056 |
+ { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD500), |
1057 |
+- .driver_info = (kernel_ulong_t)&net_intf4_blacklist |
1058 |
+- }, |
1059 |
++ .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
1060 |
+ { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */ |
1061 |
+ { USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_GT_B3730, USB_CLASS_CDC_DATA, 0x00, 0x00) }, /* Samsung GT-B3730 LTE USB modem.*/ |
1062 |
+ { USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CEM600) }, |
1063 |
+diff --git a/drivers/video/fb-puv3.c b/drivers/video/fb-puv3.c |
1064 |
+index 27fc956166fa..520112531eb0 100644 |
1065 |
+--- a/drivers/video/fb-puv3.c |
1066 |
++++ b/drivers/video/fb-puv3.c |
1067 |
+@@ -18,8 +18,10 @@ |
1068 |
+ #include <linux/fb.h> |
1069 |
+ #include <linux/init.h> |
1070 |
+ #include <linux/console.h> |
1071 |
++#include <linux/mm.h> |
1072 |
+ |
1073 |
+ #include <asm/sizes.h> |
1074 |
++#include <asm/pgtable.h> |
1075 |
+ #include <mach/hardware.h> |
1076 |
+ |
1077 |
+ /* Platform_data reserved for unifb registers. */ |
1078 |
+diff --git a/fs/cifs/cifs_unicode.c b/fs/cifs/cifs_unicode.c |
1079 |
+index 0227b45ef00a..15e9505aa35f 100644 |
1080 |
+--- a/fs/cifs/cifs_unicode.c |
1081 |
++++ b/fs/cifs/cifs_unicode.c |
1082 |
+@@ -290,7 +290,8 @@ int |
1083 |
+ cifsConvertToUTF16(__le16 *target, const char *source, int srclen, |
1084 |
+ const struct nls_table *cp, int mapChars) |
1085 |
+ { |
1086 |
+- int i, j, charlen; |
1087 |
++ int i, charlen; |
1088 |
++ int j = 0; |
1089 |
+ char src_char; |
1090 |
+ __le16 dst_char; |
1091 |
+ wchar_t tmp; |
1092 |
+@@ -298,12 +299,11 @@ cifsConvertToUTF16(__le16 *target, const char *source, int srclen, |
1093 |
+ if (!mapChars) |
1094 |
+ return cifs_strtoUTF16(target, source, PATH_MAX, cp); |
1095 |
+ |
1096 |
+- for (i = 0, j = 0; i < srclen; j++) { |
1097 |
++ for (i = 0; i < srclen; j++) { |
1098 |
+ src_char = source[i]; |
1099 |
+ charlen = 1; |
1100 |
+ switch (src_char) { |
1101 |
+ case 0: |
1102 |
+- put_unaligned(0, &target[j]); |
1103 |
+ goto ctoUTF16_out; |
1104 |
+ case ':': |
1105 |
+ dst_char = cpu_to_le16(UNI_COLON); |
1106 |
+@@ -350,6 +350,7 @@ cifsConvertToUTF16(__le16 *target, const char *source, int srclen, |
1107 |
+ } |
1108 |
+ |
1109 |
+ ctoUTF16_out: |
1110 |
++ put_unaligned(0, &target[j]); /* Null terminate target unicode string */ |
1111 |
+ return j; |
1112 |
+ } |
1113 |
+ |
1114 |
+diff --git a/fs/ext4/indirect.c b/fs/ext4/indirect.c |
1115 |
+index b8d5d351e24f..589061469687 100644 |
1116 |
+--- a/fs/ext4/indirect.c |
1117 |
++++ b/fs/ext4/indirect.c |
1118 |
+@@ -390,7 +390,13 @@ static int ext4_alloc_branch(handle_t *handle, struct inode *inode, |
1119 |
+ return 0; |
1120 |
+ failed: |
1121 |
+ for (; i >= 0; i--) { |
1122 |
+- if (i != indirect_blks && branch[i].bh) |
1123 |
++ /* |
1124 |
++ * We want to ext4_forget() only freshly allocated indirect |
1125 |
++ * blocks. Buffer for new_blocks[i-1] is at branch[i].bh and |
1126 |
++ * buffer at branch[0].bh is indirect block / inode already |
1127 |
++ * existing before ext4_alloc_branch() was called. |
1128 |
++ */ |
1129 |
++ if (i > 0 && i != indirect_blks && branch[i].bh) |
1130 |
+ ext4_forget(handle, 1, inode, branch[i].bh, |
1131 |
+ branch[i].bh->b_blocknr); |
1132 |
+ ext4_free_blocks(handle, inode, NULL, new_blocks[i], |
1133 |
+@@ -1325,16 +1331,24 @@ static int free_hole_blocks(handle_t *handle, struct inode *inode, |
1134 |
+ blk = *i_data; |
1135 |
+ if (level > 0) { |
1136 |
+ ext4_lblk_t first2; |
1137 |
++ ext4_lblk_t count2; |
1138 |
++ |
1139 |
+ bh = sb_bread(inode->i_sb, le32_to_cpu(blk)); |
1140 |
+ if (!bh) { |
1141 |
+ EXT4_ERROR_INODE_BLOCK(inode, le32_to_cpu(blk), |
1142 |
+ "Read failure"); |
1143 |
+ return -EIO; |
1144 |
+ } |
1145 |
+- first2 = (first > offset) ? first - offset : 0; |
1146 |
++ if (first > offset) { |
1147 |
++ first2 = first - offset; |
1148 |
++ count2 = count; |
1149 |
++ } else { |
1150 |
++ first2 = 0; |
1151 |
++ count2 = count - (offset - first); |
1152 |
++ } |
1153 |
+ ret = free_hole_blocks(handle, inode, bh, |
1154 |
+ (__le32 *)bh->b_data, level - 1, |
1155 |
+- first2, count - offset, |
1156 |
++ first2, count2, |
1157 |
+ inode->i_sb->s_blocksize >> 2); |
1158 |
+ if (ret) { |
1159 |
+ brelse(bh); |
1160 |
+diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c |
1161 |
+index f7d7d04674fb..0f9ce13972d0 100644 |
1162 |
+--- a/fs/nfsd/nfs4proc.c |
1163 |
++++ b/fs/nfsd/nfs4proc.c |
1164 |
+@@ -576,15 +576,6 @@ nfsd4_create(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, |
1165 |
+ |
1166 |
+ switch (create->cr_type) { |
1167 |
+ case NF4LNK: |
1168 |
+- /* ugh! we have to null-terminate the linktext, or |
1169 |
+- * vfs_symlink() will choke. it is always safe to |
1170 |
+- * null-terminate by brute force, since at worst we |
1171 |
+- * will overwrite the first byte of the create namelen |
1172 |
+- * in the XDR buffer, which has already been extracted |
1173 |
+- * during XDR decode. |
1174 |
+- */ |
1175 |
+- create->cr_linkname[create->cr_linklen] = 0; |
1176 |
+- |
1177 |
+ status = nfsd_symlink(rqstp, &cstate->current_fh, |
1178 |
+ create->cr_name, create->cr_namelen, |
1179 |
+ create->cr_linkname, create->cr_linklen, |
1180 |
+diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c |
1181 |
+index d4890a96421e..9b45f0666cfc 100644 |
1182 |
+--- a/fs/nfsd/nfs4xdr.c |
1183 |
++++ b/fs/nfsd/nfs4xdr.c |
1184 |
+@@ -553,7 +553,18 @@ nfsd4_decode_create(struct nfsd4_compoundargs *argp, struct nfsd4_create *create |
1185 |
+ READ_BUF(4); |
1186 |
+ READ32(create->cr_linklen); |
1187 |
+ READ_BUF(create->cr_linklen); |
1188 |
+- SAVEMEM(create->cr_linkname, create->cr_linklen); |
1189 |
++ /* |
1190 |
++ * The VFS will want a null-terminated string, and |
1191 |
++ * null-terminating in place isn't safe since this might |
1192 |
++ * end on a page boundary: |
1193 |
++ */ |
1194 |
++ create->cr_linkname = |
1195 |
++ kmalloc(create->cr_linklen + 1, GFP_KERNEL); |
1196 |
++ if (!create->cr_linkname) |
1197 |
++ return nfserr_jukebox; |
1198 |
++ memcpy(create->cr_linkname, p, create->cr_linklen); |
1199 |
++ create->cr_linkname[create->cr_linklen] = '\0'; |
1200 |
++ defer_free(argp, kfree, create->cr_linkname); |
1201 |
+ break; |
1202 |
+ case NF4BLK: |
1203 |
+ case NF4CHR: |
1204 |
+diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c |
1205 |
+index 60f49637b4d5..21920add7972 100644 |
1206 |
+--- a/kernel/trace/trace.c |
1207 |
++++ b/kernel/trace/trace.c |
1208 |
+@@ -1306,7 +1306,6 @@ void tracing_start(void) |
1209 |
+ |
1210 |
+ arch_spin_unlock(&ftrace_max_lock); |
1211 |
+ |
1212 |
+- ftrace_start(); |
1213 |
+ out: |
1214 |
+ raw_spin_unlock_irqrestore(&global_trace.start_lock, flags); |
1215 |
+ } |
1216 |
+@@ -1353,7 +1352,6 @@ void tracing_stop(void) |
1217 |
+ struct ring_buffer *buffer; |
1218 |
+ unsigned long flags; |
1219 |
+ |
1220 |
+- ftrace_stop(); |
1221 |
+ raw_spin_lock_irqsave(&global_trace.start_lock, flags); |
1222 |
+ if (global_trace.stop_count++) |
1223 |
+ goto out; |
1224 |
+diff --git a/mm/hugetlb.c b/mm/hugetlb.c |
1225 |
+index de73c9d144e1..dbc949c409c7 100644 |
1226 |
+--- a/mm/hugetlb.c |
1227 |
++++ b/mm/hugetlb.c |
1228 |
+@@ -2328,6 +2328,31 @@ static void set_huge_ptep_writable(struct vm_area_struct *vma, |
1229 |
+ update_mmu_cache(vma, address, ptep); |
1230 |
+ } |
1231 |
+ |
1232 |
++static int is_hugetlb_entry_migration(pte_t pte) |
1233 |
++{ |
1234 |
++ swp_entry_t swp; |
1235 |
++ |
1236 |
++ if (huge_pte_none(pte) || pte_present(pte)) |
1237 |
++ return 0; |
1238 |
++ swp = pte_to_swp_entry(pte); |
1239 |
++ if (non_swap_entry(swp) && is_migration_entry(swp)) |
1240 |
++ return 1; |
1241 |
++ else |
1242 |
++ return 0; |
1243 |
++} |
1244 |
++ |
1245 |
++static int is_hugetlb_entry_hwpoisoned(pte_t pte) |
1246 |
++{ |
1247 |
++ swp_entry_t swp; |
1248 |
++ |
1249 |
++ if (huge_pte_none(pte) || pte_present(pte)) |
1250 |
++ return 0; |
1251 |
++ swp = pte_to_swp_entry(pte); |
1252 |
++ if (non_swap_entry(swp) && is_hwpoison_entry(swp)) |
1253 |
++ return 1; |
1254 |
++ else |
1255 |
++ return 0; |
1256 |
++} |
1257 |
+ |
1258 |
+ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, |
1259 |
+ struct vm_area_struct *vma) |
1260 |
+@@ -2355,10 +2380,26 @@ int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, |
1261 |
+ |
1262 |
+ spin_lock(&dst->page_table_lock); |
1263 |
+ spin_lock_nested(&src->page_table_lock, SINGLE_DEPTH_NESTING); |
1264 |
+- if (!huge_pte_none(huge_ptep_get(src_pte))) { |
1265 |
++ entry = huge_ptep_get(src_pte); |
1266 |
++ if (huge_pte_none(entry)) { /* skip none entry */ |
1267 |
++ ; |
1268 |
++ } else if (unlikely(is_hugetlb_entry_migration(entry) || |
1269 |
++ is_hugetlb_entry_hwpoisoned(entry))) { |
1270 |
++ swp_entry_t swp_entry = pte_to_swp_entry(entry); |
1271 |
++ |
1272 |
++ if (is_write_migration_entry(swp_entry) && cow) { |
1273 |
++ /* |
1274 |
++ * COW mappings require pages in both |
1275 |
++ * parent and child to be set to read. |
1276 |
++ */ |
1277 |
++ make_migration_entry_read(&swp_entry); |
1278 |
++ entry = swp_entry_to_pte(swp_entry); |
1279 |
++ set_huge_pte_at(src, addr, src_pte, entry); |
1280 |
++ } |
1281 |
++ set_huge_pte_at(dst, addr, dst_pte, entry); |
1282 |
++ } else { |
1283 |
+ if (cow) |
1284 |
+ huge_ptep_set_wrprotect(src, addr, src_pte); |
1285 |
+- entry = huge_ptep_get(src_pte); |
1286 |
+ ptepage = pte_page(entry); |
1287 |
+ get_page(ptepage); |
1288 |
+ page_dup_rmap(ptepage); |
1289 |
+@@ -2373,32 +2414,6 @@ nomem: |
1290 |
+ return -ENOMEM; |
1291 |
+ } |
1292 |
+ |
1293 |
+-static int is_hugetlb_entry_migration(pte_t pte) |
1294 |
+-{ |
1295 |
+- swp_entry_t swp; |
1296 |
+- |
1297 |
+- if (huge_pte_none(pte) || pte_present(pte)) |
1298 |
+- return 0; |
1299 |
+- swp = pte_to_swp_entry(pte); |
1300 |
+- if (non_swap_entry(swp) && is_migration_entry(swp)) |
1301 |
+- return 1; |
1302 |
+- else |
1303 |
+- return 0; |
1304 |
+-} |
1305 |
+- |
1306 |
+-static int is_hugetlb_entry_hwpoisoned(pte_t pte) |
1307 |
+-{ |
1308 |
+- swp_entry_t swp; |
1309 |
+- |
1310 |
+- if (huge_pte_none(pte) || pte_present(pte)) |
1311 |
+- return 0; |
1312 |
+- swp = pte_to_swp_entry(pte); |
1313 |
+- if (non_swap_entry(swp) && is_hwpoison_entry(swp)) |
1314 |
+- return 1; |
1315 |
+- else |
1316 |
+- return 0; |
1317 |
+-} |
1318 |
+- |
1319 |
+ void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma, |
1320 |
+ unsigned long start, unsigned long end, |
1321 |
+ struct page *ref_page) |
1322 |
+diff --git a/mm/mempolicy.c b/mm/mempolicy.c |
1323 |
+index 6c2dace665aa..1124d5fc06e9 100644 |
1324 |
+--- a/mm/mempolicy.c |
1325 |
++++ b/mm/mempolicy.c |
1326 |
+@@ -608,19 +608,18 @@ static unsigned long change_prot_numa(struct vm_area_struct *vma, |
1327 |
+ * If pagelist != NULL then isolate pages from the LRU and |
1328 |
+ * put them on the pagelist. |
1329 |
+ */ |
1330 |
+-static struct vm_area_struct * |
1331 |
++static int |
1332 |
+ check_range(struct mm_struct *mm, unsigned long start, unsigned long end, |
1333 |
+ const nodemask_t *nodes, unsigned long flags, void *private) |
1334 |
+ { |
1335 |
+- int err; |
1336 |
+- struct vm_area_struct *first, *vma, *prev; |
1337 |
+- |
1338 |
++ int err = 0; |
1339 |
++ struct vm_area_struct *vma, *prev; |
1340 |
+ |
1341 |
+- first = find_vma(mm, start); |
1342 |
+- if (!first) |
1343 |
+- return ERR_PTR(-EFAULT); |
1344 |
++ vma = find_vma(mm, start); |
1345 |
++ if (!vma) |
1346 |
++ return -EFAULT; |
1347 |
+ prev = NULL; |
1348 |
+- for (vma = first; vma && vma->vm_start < end; vma = vma->vm_next) { |
1349 |
++ for (; vma && vma->vm_start < end; vma = vma->vm_next) { |
1350 |
+ unsigned long endvma = vma->vm_end; |
1351 |
+ |
1352 |
+ if (endvma > end) |
1353 |
+@@ -630,9 +629,9 @@ check_range(struct mm_struct *mm, unsigned long start, unsigned long end, |
1354 |
+ |
1355 |
+ if (!(flags & MPOL_MF_DISCONTIG_OK)) { |
1356 |
+ if (!vma->vm_next && vma->vm_end < end) |
1357 |
+- return ERR_PTR(-EFAULT); |
1358 |
++ return -EFAULT; |
1359 |
+ if (prev && prev->vm_end < vma->vm_start) |
1360 |
+- return ERR_PTR(-EFAULT); |
1361 |
++ return -EFAULT; |
1362 |
+ } |
1363 |
+ |
1364 |
+ if (is_vm_hugetlb_page(vma)) |
1365 |
+@@ -649,15 +648,13 @@ check_range(struct mm_struct *mm, unsigned long start, unsigned long end, |
1366 |
+ |
1367 |
+ err = check_pgd_range(vma, start, endvma, nodes, |
1368 |
+ flags, private); |
1369 |
+- if (err) { |
1370 |
+- first = ERR_PTR(err); |
1371 |
++ if (err) |
1372 |
+ break; |
1373 |
+- } |
1374 |
+ } |
1375 |
+ next: |
1376 |
+ prev = vma; |
1377 |
+ } |
1378 |
+- return first; |
1379 |
++ return err; |
1380 |
+ } |
1381 |
+ |
1382 |
+ /* |
1383 |
+@@ -1138,16 +1135,17 @@ out: |
1384 |
+ |
1385 |
+ /* |
1386 |
+ * Allocate a new page for page migration based on vma policy. |
1387 |
+- * Start assuming that page is mapped by vma pointed to by @private. |
1388 |
++ * Start by assuming the page is mapped by the same vma as contains @start. |
1389 |
+ * Search forward from there, if not. N.B., this assumes that the |
1390 |
+ * list of pages handed to migrate_pages()--which is how we get here-- |
1391 |
+ * is in virtual address order. |
1392 |
+ */ |
1393 |
+-static struct page *new_vma_page(struct page *page, unsigned long private, int **x) |
1394 |
++static struct page *new_page(struct page *page, unsigned long start, int **x) |
1395 |
+ { |
1396 |
+- struct vm_area_struct *vma = (struct vm_area_struct *)private; |
1397 |
++ struct vm_area_struct *vma; |
1398 |
+ unsigned long uninitialized_var(address); |
1399 |
+ |
1400 |
++ vma = find_vma(current->mm, start); |
1401 |
+ while (vma) { |
1402 |
+ address = page_address_in_vma(page, vma); |
1403 |
+ if (address != -EFAULT) |
1404 |
+@@ -1173,7 +1171,7 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from, |
1405 |
+ return -ENOSYS; |
1406 |
+ } |
1407 |
+ |
1408 |
+-static struct page *new_vma_page(struct page *page, unsigned long private, int **x) |
1409 |
++static struct page *new_page(struct page *page, unsigned long start, int **x) |
1410 |
+ { |
1411 |
+ return NULL; |
1412 |
+ } |
1413 |
+@@ -1183,7 +1181,6 @@ static long do_mbind(unsigned long start, unsigned long len, |
1414 |
+ unsigned short mode, unsigned short mode_flags, |
1415 |
+ nodemask_t *nmask, unsigned long flags) |
1416 |
+ { |
1417 |
+- struct vm_area_struct *vma; |
1418 |
+ struct mm_struct *mm = current->mm; |
1419 |
+ struct mempolicy *new; |
1420 |
+ unsigned long end; |
1421 |
+@@ -1249,11 +1246,9 @@ static long do_mbind(unsigned long start, unsigned long len, |
1422 |
+ if (err) |
1423 |
+ goto mpol_out; |
1424 |
+ |
1425 |
+- vma = check_range(mm, start, end, nmask, |
1426 |
++ err = check_range(mm, start, end, nmask, |
1427 |
+ flags | MPOL_MF_INVERT, &pagelist); |
1428 |
+- |
1429 |
+- err = PTR_ERR(vma); /* maybe ... */ |
1430 |
+- if (!IS_ERR(vma)) |
1431 |
++ if (!err) |
1432 |
+ err = mbind_range(mm, start, end, new); |
1433 |
+ |
1434 |
+ if (!err) { |
1435 |
+@@ -1261,9 +1256,8 @@ static long do_mbind(unsigned long start, unsigned long len, |
1436 |
+ |
1437 |
+ if (!list_empty(&pagelist)) { |
1438 |
+ WARN_ON_ONCE(flags & MPOL_MF_LAZY); |
1439 |
+- nr_failed = migrate_pages(&pagelist, new_vma_page, |
1440 |
+- (unsigned long)vma, |
1441 |
+- MIGRATE_SYNC, MR_MEMPOLICY_MBIND); |
1442 |
++ nr_failed = migrate_pages(&pagelist, new_page, |
1443 |
++ start, MIGRATE_SYNC, MR_MEMPOLICY_MBIND); |
1444 |
+ if (nr_failed) |
1445 |
+ putback_lru_pages(&pagelist); |
1446 |
+ } |
1447 |
+diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c |
1448 |
+index 4c51c055d00f..8e7290aea8f8 100644 |
1449 |
+--- a/net/bluetooth/hci_conn.c |
1450 |
++++ b/net/bluetooth/hci_conn.c |
1451 |
+@@ -659,7 +659,7 @@ static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type) |
1452 |
+ /* If we're already encrypted set the REAUTH_PEND flag, |
1453 |
+ * otherwise set the ENCRYPT_PEND. |
1454 |
+ */ |
1455 |
+- if (conn->key_type != 0xff) |
1456 |
++ if (conn->link_mode & HCI_LM_ENCRYPT) |
1457 |
+ set_bit(HCI_CONN_REAUTH_PEND, &conn->flags); |
1458 |
+ else |
1459 |
+ set_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags); |
1460 |
+diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c |
1461 |
+index ab2ec7c414cb..5daf7ab26710 100644 |
1462 |
+--- a/net/bluetooth/hci_event.c |
1463 |
++++ b/net/bluetooth/hci_event.c |
1464 |
+@@ -3218,8 +3218,11 @@ static void hci_user_confirm_request_evt(struct hci_dev *hdev, |
1465 |
+ |
1466 |
+ /* If we're not the initiators request authorization to |
1467 |
+ * proceed from user space (mgmt_user_confirm with |
1468 |
+- * confirm_hint set to 1). */ |
1469 |
+- if (!test_bit(HCI_CONN_AUTH_PEND, &conn->flags)) { |
1470 |
++ * confirm_hint set to 1). The exception is if neither |
1471 |
++ * side had MITM in which case we do auto-accept. |
1472 |
++ */ |
1473 |
++ if (!test_bit(HCI_CONN_AUTH_PEND, &conn->flags) && |
1474 |
++ (loc_mitm || rem_mitm)) { |
1475 |
+ BT_DBG("Confirming auto-accept as acceptor"); |
1476 |
+ confirm_hint = 1; |
1477 |
+ goto confirm; |
1478 |
+diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c |
1479 |
+index f8ecbc70293d..8208a13a9837 100644 |
1480 |
+--- a/net/bluetooth/mgmt.c |
1481 |
++++ b/net/bluetooth/mgmt.c |
1482 |
+@@ -2333,8 +2333,13 @@ static int user_pairing_resp(struct sock *sk, struct hci_dev *hdev, |
1483 |
+ } |
1484 |
+ |
1485 |
+ if (addr->type == BDADDR_LE_PUBLIC || addr->type == BDADDR_LE_RANDOM) { |
1486 |
+- /* Continue with pairing via SMP */ |
1487 |
++ /* Continue with pairing via SMP. The hdev lock must be |
1488 |
++ * released as SMP may try to recquire it for crypto |
1489 |
++ * purposes. |
1490 |
++ */ |
1491 |
++ hci_dev_unlock(hdev); |
1492 |
+ err = smp_user_confirm_reply(conn, mgmt_op, passkey); |
1493 |
++ hci_dev_lock(hdev); |
1494 |
+ |
1495 |
+ if (!err) |
1496 |
+ err = cmd_complete(sk, hdev->id, mgmt_op, |
1497 |
+diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c |
1498 |
+index 14abcf44f974..2d5b4f65c519 100644 |
1499 |
+--- a/net/mac80211/debugfs_netdev.c |
1500 |
++++ b/net/mac80211/debugfs_netdev.c |
1501 |
+@@ -34,8 +34,7 @@ static ssize_t ieee80211_if_read( |
1502 |
+ ssize_t ret = -EINVAL; |
1503 |
+ |
1504 |
+ read_lock(&dev_base_lock); |
1505 |
+- if (sdata->dev->reg_state == NETREG_REGISTERED) |
1506 |
+- ret = (*format)(sdata, buf, sizeof(buf)); |
1507 |
++ ret = (*format)(sdata, buf, sizeof(buf)); |
1508 |
+ read_unlock(&dev_base_lock); |
1509 |
+ |
1510 |
+ if (ret >= 0) |
1511 |
+@@ -62,8 +61,7 @@ static ssize_t ieee80211_if_write( |
1512 |
+ |
1513 |
+ ret = -ENODEV; |
1514 |
+ rtnl_lock(); |
1515 |
+- if (sdata->dev->reg_state == NETREG_REGISTERED) |
1516 |
+- ret = (*write)(sdata, buf, count); |
1517 |
++ ret = (*write)(sdata, buf, count); |
1518 |
+ rtnl_unlock(); |
1519 |
+ |
1520 |
+ return ret; |
1521 |
+diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c |
1522 |
+index 0418777c361f..557a5760f9f6 100644 |
1523 |
+--- a/net/mac80211/sta_info.c |
1524 |
++++ b/net/mac80211/sta_info.c |
1525 |
+@@ -270,6 +270,7 @@ void sta_info_free(struct ieee80211_local *local, struct sta_info *sta) |
1526 |
+ |
1527 |
+ sta_dbg(sta->sdata, "Destroyed STA %pM\n", sta->sta.addr); |
1528 |
+ |
1529 |
++ kfree(rcu_dereference_raw(sta->sta.rates)); |
1530 |
+ kfree(sta); |
1531 |
+ } |
1532 |
+ |
1533 |
+diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c |
1534 |
+index 93b6e32cfead..0d7a872dab36 100644 |
1535 |
+--- a/sound/usb/pcm.c |
1536 |
++++ b/sound/usb/pcm.c |
1537 |
+@@ -1420,7 +1420,8 @@ static void retire_playback_urb(struct snd_usb_substream *subs, |
1538 |
+ * on two reads of a counter updated every ms. |
1539 |
+ */ |
1540 |
+ if (abs(est_delay - subs->last_delay) * 1000 > runtime->rate * 2) |
1541 |
+- snd_printk(KERN_DEBUG "delay: estimated %d, actual %d\n", |
1542 |
++ dev_dbg_ratelimited(&subs->dev->dev, |
1543 |
++ "delay: estimated %d, actual %d\n", |
1544 |
+ est_delay, subs->last_delay); |
1545 |
+ |
1546 |
+ if (!subs->running) { |
1547 |
+diff --git a/tools/usb/ffs-test.c b/tools/usb/ffs-test.c |
1548 |
+index fe1e66b6ef40..a87e99f37c52 100644 |
1549 |
+--- a/tools/usb/ffs-test.c |
1550 |
++++ b/tools/usb/ffs-test.c |
1551 |
+@@ -116,8 +116,8 @@ static const struct { |
1552 |
+ .header = { |
1553 |
+ .magic = cpu_to_le32(FUNCTIONFS_DESCRIPTORS_MAGIC), |
1554 |
+ .length = cpu_to_le32(sizeof descriptors), |
1555 |
+- .fs_count = 3, |
1556 |
+- .hs_count = 3, |
1557 |
++ .fs_count = cpu_to_le32(3), |
1558 |
++ .hs_count = cpu_to_le32(3), |
1559 |
+ }, |
1560 |
+ .fs_descs = { |
1561 |
+ .intf = { |