Magellan Linux

Contents of /trunk/kernel-magellan/patches-3.2/0106-3.2.7-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1663 - (show annotations) (download)
Fri Mar 2 10:03:33 2012 UTC (12 years, 2 months ago) by niro
File size: 32204 byte(s)
-added more upstream patches
1 diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c
2 index 492ade8..d99346e 100644
3 --- a/arch/x86/pci/xen.c
4 +++ b/arch/x86/pci/xen.c
5 @@ -374,7 +374,7 @@ int __init pci_xen_init(void)
6
7 int __init pci_xen_hvm_init(void)
8 {
9 - if (!xen_feature(XENFEAT_hvm_pirqs))
10 + if (!xen_have_vector_callback || !xen_feature(XENFEAT_hvm_pirqs))
11 return 0;
12
13 #ifdef CONFIG_ACPI
14 diff --git a/crypto/sha512_generic.c b/crypto/sha512_generic.c
15 index 88f160b..107f6f7 100644
16 --- a/crypto/sha512_generic.c
17 +++ b/crypto/sha512_generic.c
18 @@ -31,11 +31,6 @@ static inline u64 Maj(u64 x, u64 y, u64 z)
19 return (x & y) | (z & (x | y));
20 }
21
22 -static inline u64 RORu64(u64 x, u64 y)
23 -{
24 - return (x >> y) | (x << (64 - y));
25 -}
26 -
27 static const u64 sha512_K[80] = {
28 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL,
29 0xe9b5dba58189dbbcULL, 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL,
30 @@ -66,10 +61,10 @@ static const u64 sha512_K[80] = {
31 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL,
32 };
33
34 -#define e0(x) (RORu64(x,28) ^ RORu64(x,34) ^ RORu64(x,39))
35 -#define e1(x) (RORu64(x,14) ^ RORu64(x,18) ^ RORu64(x,41))
36 -#define s0(x) (RORu64(x, 1) ^ RORu64(x, 8) ^ (x >> 7))
37 -#define s1(x) (RORu64(x,19) ^ RORu64(x,61) ^ (x >> 6))
38 +#define e0(x) (ror64(x,28) ^ ror64(x,34) ^ ror64(x,39))
39 +#define e1(x) (ror64(x,14) ^ ror64(x,18) ^ ror64(x,41))
40 +#define s0(x) (ror64(x, 1) ^ ror64(x, 8) ^ (x >> 7))
41 +#define s1(x) (ror64(x,19) ^ ror64(x,61) ^ (x >> 6))
42
43 static inline void LOAD_OP(int I, u64 *W, const u8 *input)
44 {
45 @@ -78,7 +73,7 @@ static inline void LOAD_OP(int I, u64 *W, const u8 *input)
46
47 static inline void BLEND_OP(int I, u64 *W)
48 {
49 - W[I % 16] += s1(W[(I-2) % 16]) + W[(I-7) % 16] + s0(W[(I-15) % 16]);
50 + W[I & 15] += s1(W[(I-2) & 15]) + W[(I-7) & 15] + s0(W[(I-15) & 15]);
51 }
52
53 static void
54 @@ -89,46 +84,42 @@ sha512_transform(u64 *state, const u8 *input)
55 int i;
56 u64 W[16];
57
58 - /* load the input */
59 - for (i = 0; i < 16; i++)
60 - LOAD_OP(i, W, input);
61 -
62 /* load the state into our registers */
63 a=state[0]; b=state[1]; c=state[2]; d=state[3];
64 e=state[4]; f=state[5]; g=state[6]; h=state[7];
65
66 -#define SHA512_0_15(i, a, b, c, d, e, f, g, h) \
67 - t1 = h + e1(e) + Ch(e, f, g) + sha512_K[i] + W[i]; \
68 - t2 = e0(a) + Maj(a, b, c); \
69 - d += t1; \
70 - h = t1 + t2
71 -
72 -#define SHA512_16_79(i, a, b, c, d, e, f, g, h) \
73 - BLEND_OP(i, W); \
74 - t1 = h + e1(e) + Ch(e, f, g) + sha512_K[i] + W[(i)%16]; \
75 - t2 = e0(a) + Maj(a, b, c); \
76 - d += t1; \
77 - h = t1 + t2
78 -
79 - for (i = 0; i < 16; i += 8) {
80 - SHA512_0_15(i, a, b, c, d, e, f, g, h);
81 - SHA512_0_15(i + 1, h, a, b, c, d, e, f, g);
82 - SHA512_0_15(i + 2, g, h, a, b, c, d, e, f);
83 - SHA512_0_15(i + 3, f, g, h, a, b, c, d, e);
84 - SHA512_0_15(i + 4, e, f, g, h, a, b, c, d);
85 - SHA512_0_15(i + 5, d, e, f, g, h, a, b, c);
86 - SHA512_0_15(i + 6, c, d, e, f, g, h, a, b);
87 - SHA512_0_15(i + 7, b, c, d, e, f, g, h, a);
88 - }
89 - for (i = 16; i < 80; i += 8) {
90 - SHA512_16_79(i, a, b, c, d, e, f, g, h);
91 - SHA512_16_79(i + 1, h, a, b, c, d, e, f, g);
92 - SHA512_16_79(i + 2, g, h, a, b, c, d, e, f);
93 - SHA512_16_79(i + 3, f, g, h, a, b, c, d, e);
94 - SHA512_16_79(i + 4, e, f, g, h, a, b, c, d);
95 - SHA512_16_79(i + 5, d, e, f, g, h, a, b, c);
96 - SHA512_16_79(i + 6, c, d, e, f, g, h, a, b);
97 - SHA512_16_79(i + 7, b, c, d, e, f, g, h, a);
98 + /* now iterate */
99 + for (i=0; i<80; i+=8) {
100 + if (!(i & 8)) {
101 + int j;
102 +
103 + if (i < 16) {
104 + /* load the input */
105 + for (j = 0; j < 16; j++)
106 + LOAD_OP(i + j, W, input);
107 + } else {
108 + for (j = 0; j < 16; j++) {
109 + BLEND_OP(i + j, W);
110 + }
111 + }
112 + }
113 +
114 + t1 = h + e1(e) + Ch(e,f,g) + sha512_K[i ] + W[(i & 15)];
115 + t2 = e0(a) + Maj(a,b,c); d+=t1; h=t1+t2;
116 + t1 = g + e1(d) + Ch(d,e,f) + sha512_K[i+1] + W[(i & 15) + 1];
117 + t2 = e0(h) + Maj(h,a,b); c+=t1; g=t1+t2;
118 + t1 = f + e1(c) + Ch(c,d,e) + sha512_K[i+2] + W[(i & 15) + 2];
119 + t2 = e0(g) + Maj(g,h,a); b+=t1; f=t1+t2;
120 + t1 = e + e1(b) + Ch(b,c,d) + sha512_K[i+3] + W[(i & 15) + 3];
121 + t2 = e0(f) + Maj(f,g,h); a+=t1; e=t1+t2;
122 + t1 = d + e1(a) + Ch(a,b,c) + sha512_K[i+4] + W[(i & 15) + 4];
123 + t2 = e0(e) + Maj(e,f,g); h+=t1; d=t1+t2;
124 + t1 = c + e1(h) + Ch(h,a,b) + sha512_K[i+5] + W[(i & 15) + 5];
125 + t2 = e0(d) + Maj(d,e,f); g+=t1; c=t1+t2;
126 + t1 = b + e1(g) + Ch(g,h,a) + sha512_K[i+6] + W[(i & 15) + 6];
127 + t2 = e0(c) + Maj(c,d,e); f+=t1; b=t1+t2;
128 + t1 = a + e1(f) + Ch(f,g,h) + sha512_K[i+7] + W[(i & 15) + 7];
129 + t2 = e0(b) + Maj(b,c,d); e+=t1; a=t1+t2;
130 }
131
132 state[0] += a; state[1] += b; state[2] += c; state[3] += d;
133 diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
134 index db3b461..94f860c 100644
135 --- a/drivers/gpu/drm/i915/intel_dp.c
136 +++ b/drivers/gpu/drm/i915/intel_dp.c
137 @@ -208,17 +208,8 @@ intel_dp_link_clock(uint8_t link_bw)
138 */
139
140 static int
141 -intel_dp_link_required(struct intel_dp *intel_dp, int pixel_clock, int check_bpp)
142 +intel_dp_link_required(int pixel_clock, int bpp)
143 {
144 - struct drm_crtc *crtc = intel_dp->base.base.crtc;
145 - struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
146 - int bpp = 24;
147 -
148 - if (check_bpp)
149 - bpp = check_bpp;
150 - else if (intel_crtc)
151 - bpp = intel_crtc->bpp;
152 -
153 return (pixel_clock * bpp + 9) / 10;
154 }
155
156 @@ -245,12 +236,11 @@ intel_dp_mode_valid(struct drm_connector *connector,
157 return MODE_PANEL;
158 }
159
160 - mode_rate = intel_dp_link_required(intel_dp, mode->clock, 0);
161 + mode_rate = intel_dp_link_required(mode->clock, 24);
162 max_rate = intel_dp_max_data_rate(max_link_clock, max_lanes);
163
164 if (mode_rate > max_rate) {
165 - mode_rate = intel_dp_link_required(intel_dp,
166 - mode->clock, 18);
167 + mode_rate = intel_dp_link_required(mode->clock, 18);
168 if (mode_rate > max_rate)
169 return MODE_CLOCK_HIGH;
170 else
171 @@ -683,7 +673,7 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode,
172 int lane_count, clock;
173 int max_lane_count = intel_dp_max_lane_count(intel_dp);
174 int max_clock = intel_dp_max_link_bw(intel_dp) == DP_LINK_BW_2_7 ? 1 : 0;
175 - int bpp = mode->private_flags & INTEL_MODE_DP_FORCE_6BPC ? 18 : 0;
176 + int bpp = mode->private_flags & INTEL_MODE_DP_FORCE_6BPC ? 18 : 24;
177 static int bws[2] = { DP_LINK_BW_1_62, DP_LINK_BW_2_7 };
178
179 if (is_edp(intel_dp) && intel_dp->panel_fixed_mode) {
180 @@ -701,7 +691,7 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode,
181 for (clock = 0; clock <= max_clock; clock++) {
182 int link_avail = intel_dp_max_data_rate(intel_dp_link_clock(bws[clock]), lane_count);
183
184 - if (intel_dp_link_required(intel_dp, mode->clock, bpp)
185 + if (intel_dp_link_required(mode->clock, bpp)
186 <= link_avail) {
187 intel_dp->link_bw = bws[clock];
188 intel_dp->lane_count = lane_count;
189 diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
190 index e441911..b83f745 100644
191 --- a/drivers/gpu/drm/i915/intel_lvds.c
192 +++ b/drivers/gpu/drm/i915/intel_lvds.c
193 @@ -694,6 +694,14 @@ static const struct dmi_system_id intel_no_lvds[] = {
194 },
195 {
196 .callback = intel_no_lvds_dmi_callback,
197 + .ident = "AOpen i45GMx-I",
198 + .matches = {
199 + DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"),
200 + DMI_MATCH(DMI_BOARD_NAME, "i45GMx-I"),
201 + },
202 + },
203 + {
204 + .callback = intel_no_lvds_dmi_callback,
205 .ident = "Aopen i945GTt-VFA",
206 .matches = {
207 DMI_MATCH(DMI_PRODUCT_VERSION, "AO00001JW"),
208 diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c
209 index 95cbfb3..e4ab491 100644
210 --- a/drivers/hwmon/f75375s.c
211 +++ b/drivers/hwmon/f75375s.c
212 @@ -159,7 +159,7 @@ static inline void f75375_write8(struct i2c_client *client, u8 reg,
213 static inline void f75375_write16(struct i2c_client *client, u8 reg,
214 u16 value)
215 {
216 - int err = i2c_smbus_write_byte_data(client, reg, (value << 8));
217 + int err = i2c_smbus_write_byte_data(client, reg, (value >> 8));
218 if (err)
219 return;
220 i2c_smbus_write_byte_data(client, reg + 1, (value & 0xFF));
221 @@ -311,7 +311,7 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val)
222 fanmode |= (3 << FAN_CTRL_MODE(nr));
223 break;
224 case 2: /* AUTOMATIC*/
225 - fanmode |= (2 << FAN_CTRL_MODE(nr));
226 + fanmode |= (1 << FAN_CTRL_MODE(nr));
227 break;
228 case 3: /* fan speed */
229 break;
230 diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
231 index a7ee502..72bc756 100644
232 --- a/drivers/mmc/host/atmel-mci.c
233 +++ b/drivers/mmc/host/atmel-mci.c
234 @@ -965,11 +965,14 @@ static void atmci_start_request(struct atmel_mci *host,
235 host->data_status = 0;
236
237 if (host->need_reset) {
238 + iflags = atmci_readl(host, ATMCI_IMR);
239 + iflags &= (ATMCI_SDIOIRQA | ATMCI_SDIOIRQB);
240 atmci_writel(host, ATMCI_CR, ATMCI_CR_SWRST);
241 atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIEN);
242 atmci_writel(host, ATMCI_MR, host->mode_reg);
243 if (host->caps.has_cfg_reg)
244 atmci_writel(host, ATMCI_CFG, host->cfg_reg);
245 + atmci_writel(host, ATMCI_IER, iflags);
246 host->need_reset = false;
247 }
248 atmci_writel(host, ATMCI_SDCR, slot->sdc_reg);
249 diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
250 index 3aaeb08..baf3d42 100644
251 --- a/drivers/mmc/host/dw_mmc.c
252 +++ b/drivers/mmc/host/dw_mmc.c
253 @@ -22,7 +22,6 @@
254 #include <linux/ioport.h>
255 #include <linux/module.h>
256 #include <linux/platform_device.h>
257 -#include <linux/scatterlist.h>
258 #include <linux/seq_file.h>
259 #include <linux/slab.h>
260 #include <linux/stat.h>
261 @@ -502,8 +501,14 @@ static void dw_mci_submit_data(struct dw_mci *host, struct mmc_data *data)
262 host->dir_status = DW_MCI_SEND_STATUS;
263
264 if (dw_mci_submit_data_dma(host, data)) {
265 + int flags = SG_MITER_ATOMIC;
266 + if (host->data->flags & MMC_DATA_READ)
267 + flags |= SG_MITER_TO_SG;
268 + else
269 + flags |= SG_MITER_FROM_SG;
270 +
271 + sg_miter_start(&host->sg_miter, data->sg, data->sg_len, flags);
272 host->sg = data->sg;
273 - host->pio_offset = 0;
274 host->part_buf_start = 0;
275 host->part_buf_count = 0;
276
277 @@ -953,6 +958,7 @@ static void dw_mci_tasklet_func(unsigned long priv)
278 * generates a block interrupt, hence setting
279 * the scatter-gather pointer to NULL.
280 */
281 + sg_miter_stop(&host->sg_miter);
282 host->sg = NULL;
283 ctrl = mci_readl(host, CTRL);
284 ctrl |= SDMMC_CTRL_FIFO_RESET;
285 @@ -1286,54 +1292,44 @@ static void dw_mci_pull_data(struct dw_mci *host, void *buf, int cnt)
286
287 static void dw_mci_read_data_pio(struct dw_mci *host)
288 {
289 - struct scatterlist *sg = host->sg;
290 - void *buf = sg_virt(sg);
291 - unsigned int offset = host->pio_offset;
292 + struct sg_mapping_iter *sg_miter = &host->sg_miter;
293 + void *buf;
294 + unsigned int offset;
295 struct mmc_data *data = host->data;
296 int shift = host->data_shift;
297 u32 status;
298 unsigned int nbytes = 0, len;
299 + unsigned int remain, fcnt;
300
301 do {
302 - len = host->part_buf_count +
303 - (SDMMC_GET_FCNT(mci_readl(host, STATUS)) << shift);
304 - if (offset + len <= sg->length) {
305 + if (!sg_miter_next(sg_miter))
306 + goto done;
307 +
308 + host->sg = sg_miter->__sg;
309 + buf = sg_miter->addr;
310 + remain = sg_miter->length;
311 + offset = 0;
312 +
313 + do {
314 + fcnt = (SDMMC_GET_FCNT(mci_readl(host, STATUS))
315 + << shift) + host->part_buf_count;
316 + len = min(remain, fcnt);
317 + if (!len)
318 + break;
319 dw_mci_pull_data(host, (void *)(buf + offset), len);
320 -
321 offset += len;
322 nbytes += len;
323 -
324 - if (offset == sg->length) {
325 - flush_dcache_page(sg_page(sg));
326 - host->sg = sg = sg_next(sg);
327 - if (!sg)
328 - goto done;
329 -
330 - offset = 0;
331 - buf = sg_virt(sg);
332 - }
333 - } else {
334 - unsigned int remaining = sg->length - offset;
335 - dw_mci_pull_data(host, (void *)(buf + offset),
336 - remaining);
337 - nbytes += remaining;
338 -
339 - flush_dcache_page(sg_page(sg));
340 - host->sg = sg = sg_next(sg);
341 - if (!sg)
342 - goto done;
343 -
344 - offset = len - remaining;
345 - buf = sg_virt(sg);
346 - dw_mci_pull_data(host, buf, offset);
347 - nbytes += offset;
348 - }
349 + remain -= len;
350 + } while (remain);
351 + sg_miter->consumed = offset;
352
353 status = mci_readl(host, MINTSTS);
354 mci_writel(host, RINTSTS, SDMMC_INT_RXDR);
355 if (status & DW_MCI_DATA_ERROR_FLAGS) {
356 host->data_status = status;
357 data->bytes_xfered += nbytes;
358 + sg_miter_stop(sg_miter);
359 + host->sg = NULL;
360 smp_wmb();
361
362 set_bit(EVENT_DATA_ERROR, &host->pending_events);
363 @@ -1342,65 +1338,66 @@ static void dw_mci_read_data_pio(struct dw_mci *host)
364 return;
365 }
366 } while (status & SDMMC_INT_RXDR); /*if the RXDR is ready read again*/
367 - host->pio_offset = offset;
368 data->bytes_xfered += nbytes;
369 +
370 + if (!remain) {
371 + if (!sg_miter_next(sg_miter))
372 + goto done;
373 + sg_miter->consumed = 0;
374 + }
375 + sg_miter_stop(sg_miter);
376 return;
377
378 done:
379 data->bytes_xfered += nbytes;
380 + sg_miter_stop(sg_miter);
381 + host->sg = NULL;
382 smp_wmb();
383 set_bit(EVENT_XFER_COMPLETE, &host->pending_events);
384 }
385
386 static void dw_mci_write_data_pio(struct dw_mci *host)
387 {
388 - struct scatterlist *sg = host->sg;
389 - void *buf = sg_virt(sg);
390 - unsigned int offset = host->pio_offset;
391 + struct sg_mapping_iter *sg_miter = &host->sg_miter;
392 + void *buf;
393 + unsigned int offset;
394 struct mmc_data *data = host->data;
395 int shift = host->data_shift;
396 u32 status;
397 unsigned int nbytes = 0, len;
398 + unsigned int fifo_depth = host->fifo_depth;
399 + unsigned int remain, fcnt;
400
401 do {
402 - len = ((host->fifo_depth -
403 - SDMMC_GET_FCNT(mci_readl(host, STATUS))) << shift)
404 - - host->part_buf_count;
405 - if (offset + len <= sg->length) {
406 + if (!sg_miter_next(sg_miter))
407 + goto done;
408 +
409 + host->sg = sg_miter->__sg;
410 + buf = sg_miter->addr;
411 + remain = sg_miter->length;
412 + offset = 0;
413 +
414 + do {
415 + fcnt = ((fifo_depth -
416 + SDMMC_GET_FCNT(mci_readl(host, STATUS)))
417 + << shift) - host->part_buf_count;
418 + len = min(remain, fcnt);
419 + if (!len)
420 + break;
421 host->push_data(host, (void *)(buf + offset), len);
422 -
423 offset += len;
424 nbytes += len;
425 - if (offset == sg->length) {
426 - host->sg = sg = sg_next(sg);
427 - if (!sg)
428 - goto done;
429 -
430 - offset = 0;
431 - buf = sg_virt(sg);
432 - }
433 - } else {
434 - unsigned int remaining = sg->length - offset;
435 -
436 - host->push_data(host, (void *)(buf + offset),
437 - remaining);
438 - nbytes += remaining;
439 -
440 - host->sg = sg = sg_next(sg);
441 - if (!sg)
442 - goto done;
443 -
444 - offset = len - remaining;
445 - buf = sg_virt(sg);
446 - host->push_data(host, (void *)buf, offset);
447 - nbytes += offset;
448 - }
449 + remain -= len;
450 + } while (remain);
451 + sg_miter->consumed = offset;
452
453 status = mci_readl(host, MINTSTS);
454 mci_writel(host, RINTSTS, SDMMC_INT_TXDR);
455 if (status & DW_MCI_DATA_ERROR_FLAGS) {
456 host->data_status = status;
457 data->bytes_xfered += nbytes;
458 + sg_miter_stop(sg_miter);
459 + host->sg = NULL;
460
461 smp_wmb();
462
463 @@ -1410,12 +1407,20 @@ static void dw_mci_write_data_pio(struct dw_mci *host)
464 return;
465 }
466 } while (status & SDMMC_INT_TXDR); /* if TXDR write again */
467 - host->pio_offset = offset;
468 data->bytes_xfered += nbytes;
469 +
470 + if (!remain) {
471 + if (!sg_miter_next(sg_miter))
472 + goto done;
473 + sg_miter->consumed = 0;
474 + }
475 + sg_miter_stop(sg_miter);
476 return;
477
478 done:
479 data->bytes_xfered += nbytes;
480 + sg_miter_stop(sg_miter);
481 + host->sg = NULL;
482 smp_wmb();
483 set_bit(EVENT_XFER_COMPLETE, &host->pending_events);
484 }
485 @@ -1618,6 +1623,7 @@ static void dw_mci_work_routine_card(struct work_struct *work)
486 * block interrupt, hence setting the
487 * scatter-gather pointer to NULL.
488 */
489 + sg_miter_stop(&host->sg_miter);
490 host->sg = NULL;
491
492 ctrl = mci_readl(host, CTRL);
493 diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
494 index ced5444..222954d 100644
495 --- a/drivers/net/ethernet/intel/igb/igb_main.c
496 +++ b/drivers/net/ethernet/intel/igb/igb_main.c
497 @@ -4965,7 +4965,8 @@ static int igb_find_enabled_vfs(struct igb_adapter *adapter)
498 vf_devfn = pdev->devfn + 0x80;
499 pvfdev = pci_get_device(hw->vendor_id, device_id, NULL);
500 while (pvfdev) {
501 - if (pvfdev->devfn == vf_devfn)
502 + if (pvfdev->devfn == vf_devfn &&
503 + (pvfdev->bus->number >= pdev->bus->number))
504 vfs_found++;
505 vf_devfn += vf_stride;
506 pvfdev = pci_get_device(hw->vendor_id,
507 diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
508 index 00fcd39..e571356 100644
509 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
510 +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
511 @@ -67,7 +67,8 @@ static int ixgbe_find_enabled_vfs(struct ixgbe_adapter *adapter)
512 vf_devfn = pdev->devfn + 0x80;
513 pvfdev = pci_get_device(IXGBE_INTEL_VENDOR_ID, device_id, NULL);
514 while (pvfdev) {
515 - if (pvfdev->devfn == vf_devfn)
516 + if (pvfdev->devfn == vf_devfn &&
517 + (pvfdev->bus->number >= pdev->bus->number))
518 vfs_found++;
519 vf_devfn += 2;
520 pvfdev = pci_get_device(IXGBE_INTEL_VENDOR_ID,
521 diff --git a/drivers/net/ethernet/toshiba/Kconfig b/drivers/net/ethernet/toshiba/Kconfig
522 index 0517647..74acb5c 100644
523 --- a/drivers/net/ethernet/toshiba/Kconfig
524 +++ b/drivers/net/ethernet/toshiba/Kconfig
525 @@ -5,7 +5,7 @@
526 config NET_VENDOR_TOSHIBA
527 bool "Toshiba devices"
528 default y
529 - depends on PCI && (PPC_IBM_CELL_BLADE || PPC_CELLEB) || PPC_PS3
530 + depends on PCI && (PPC_IBM_CELL_BLADE || PPC_CELLEB || MIPS) || PPC_PS3
531 ---help---
532 If you have a network (Ethernet) card belonging to this class, say Y
533 and read the Ethernet-HOWTO, available from
534 diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
535 index 8873c6e..8b0c2ca 100644
536 --- a/drivers/net/wireless/ath/ath9k/hw.c
537 +++ b/drivers/net/wireless/ath/ath9k/hw.c
538 @@ -1034,13 +1034,16 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah)
539
540 /*
541 * Workaround for early ACK timeouts, add an offset to match the
542 - * initval's 64us ack timeout value.
543 + * initval's 64us ack timeout value. Use 48us for the CTS timeout.
544 * This was initially only meant to work around an issue with delayed
545 * BA frames in some implementations, but it has been found to fix ACK
546 * timeout issues in other cases as well.
547 */
548 - if (conf->channel && conf->channel->band == IEEE80211_BAND_2GHZ)
549 + if (conf->channel && conf->channel->band == IEEE80211_BAND_2GHZ) {
550 acktimeout += 64 - sifstime - ah->slottime;
551 + ctstimeout += 48 - sifstime - ah->slottime;
552 + }
553 +
554
555 ath9k_hw_set_sifs_time(ah, sifstime);
556 ath9k_hw_setslottime(ah, slottime);
557 diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
558 index d4c909f..57622e0 100644
559 --- a/drivers/net/wireless/ath/ath9k/init.c
560 +++ b/drivers/net/wireless/ath/ath9k/init.c
561 @@ -775,6 +775,11 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc,
562 ARRAY_SIZE(ath9k_tpt_blink));
563 #endif
564
565 + INIT_WORK(&sc->hw_reset_work, ath_reset_work);
566 + INIT_WORK(&sc->hw_check_work, ath_hw_check);
567 + INIT_WORK(&sc->paprd_work, ath_paprd_calibrate);
568 + INIT_DELAYED_WORK(&sc->hw_pll_work, ath_hw_pll_work);
569 +
570 /* Register with mac80211 */
571 error = ieee80211_register_hw(hw);
572 if (error)
573 @@ -793,10 +798,6 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc,
574 goto error_world;
575 }
576
577 - INIT_WORK(&sc->hw_reset_work, ath_reset_work);
578 - INIT_WORK(&sc->hw_check_work, ath_hw_check);
579 - INIT_WORK(&sc->paprd_work, ath_paprd_calibrate);
580 - INIT_DELAYED_WORK(&sc->hw_pll_work, ath_hw_pll_work);
581 sc->last_rssi = ATH_RSSI_DUMMY_MARKER;
582
583 ath_init_leds(sc);
584 diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
585 index 67b862c..2f3aeac 100644
586 --- a/drivers/net/wireless/ath/ath9k/recv.c
587 +++ b/drivers/net/wireless/ath/ath9k/recv.c
588 @@ -824,6 +824,14 @@ static bool ath9k_rx_accept(struct ath_common *common,
589 (ATH9K_RXERR_DECRYPT | ATH9K_RXERR_CRC | ATH9K_RXERR_MIC |
590 ATH9K_RXERR_KEYMISS));
591
592 + /*
593 + * Key miss events are only relevant for pairwise keys where the
594 + * descriptor does contain a valid key index. This has been observed
595 + * mostly with CCMP encryption.
596 + */
597 + if (rx_stats->rs_keyix == ATH9K_RXKEYIX_INVALID)
598 + rx_stats->rs_status &= ~ATH9K_RXERR_KEYMISS;
599 +
600 if (!rx_stats->rs_datalen)
601 return false;
602 /*
603 diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
604 index 63e4be4..720edf5 100644
605 --- a/fs/cifs/connect.c
606 +++ b/fs/cifs/connect.c
607 @@ -756,10 +756,11 @@ standard_receive3(struct TCP_Server_Info *server, struct mid_q_entry *mid)
608 cifs_dump_mem("Bad SMB: ", buf,
609 min_t(unsigned int, server->total_read, 48));
610
611 - if (mid)
612 - handle_mid(mid, server, smb_buffer, length);
613 + if (!mid)
614 + return length;
615
616 - return length;
617 + handle_mid(mid, server, smb_buffer, length);
618 + return 0;
619 }
620
621 static int
622 diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
623 index d7eeb9d..e4c3334 100644
624 --- a/fs/cifs/dir.c
625 +++ b/fs/cifs/dir.c
626 @@ -492,7 +492,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
627 {
628 int xid;
629 int rc = 0; /* to get around spurious gcc warning, set to zero here */
630 - __u32 oplock = 0;
631 + __u32 oplock = enable_oplocks ? REQ_OPLOCK : 0;
632 __u16 fileHandle = 0;
633 bool posix_open = false;
634 struct cifs_sb_info *cifs_sb;
635 diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
636 index 517f211..54f5786 100644
637 --- a/fs/fs-writeback.c
638 +++ b/fs/fs-writeback.c
639 @@ -48,14 +48,6 @@ struct wb_writeback_work {
640 };
641
642 /*
643 - * Include the creation of the trace points after defining the
644 - * wb_writeback_work structure so that the definition remains local to this
645 - * file.
646 - */
647 -#define CREATE_TRACE_POINTS
648 -#include <trace/events/writeback.h>
649 -
650 -/*
651 * We don't actually have pdflush, but this one is exported though /proc...
652 */
653 int nr_pdflush_threads;
654 @@ -87,6 +79,14 @@ static inline struct inode *wb_inode(struct list_head *head)
655 return list_entry(head, struct inode, i_wb_list);
656 }
657
658 +/*
659 + * Include the creation of the trace points after defining the
660 + * wb_writeback_work structure and inline functions so that the definition
661 + * remains local to this file.
662 + */
663 +#define CREATE_TRACE_POINTS
664 +#include <trace/events/writeback.h>
665 +
666 /* Wakeup flusher thread or forker thread to fork it. Requires bdi->wb_lock. */
667 static void bdi_wakeup_flusher(struct backing_dev_info *bdi)
668 {
669 diff --git a/include/linux/bitops.h b/include/linux/bitops.h
670 index a3ef66a..fc8a3ff 100644
671 --- a/include/linux/bitops.h
672 +++ b/include/linux/bitops.h
673 @@ -50,6 +50,26 @@ static inline unsigned long hweight_long(unsigned long w)
674 }
675
676 /**
677 + * rol64 - rotate a 64-bit value left
678 + * @word: value to rotate
679 + * @shift: bits to roll
680 + */
681 +static inline __u64 rol64(__u64 word, unsigned int shift)
682 +{
683 + return (word << shift) | (word >> (64 - shift));
684 +}
685 +
686 +/**
687 + * ror64 - rotate a 64-bit value right
688 + * @word: value to rotate
689 + * @shift: bits to roll
690 + */
691 +static inline __u64 ror64(__u64 word, unsigned int shift)
692 +{
693 + return (word >> shift) | (word << (64 - shift));
694 +}
695 +
696 +/**
697 * rol32 - rotate a 32-bit value left
698 * @word: value to rotate
699 * @shift: bits to roll
700 diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h
701 index 6dc9b80..107fcb3 100644
702 --- a/include/linux/mmc/dw_mmc.h
703 +++ b/include/linux/mmc/dw_mmc.h
704 @@ -14,6 +14,8 @@
705 #ifndef LINUX_MMC_DW_MMC_H
706 #define LINUX_MMC_DW_MMC_H
707
708 +#include <linux/scatterlist.h>
709 +
710 #define MAX_MCI_SLOTS 2
711
712 enum dw_mci_state {
713 @@ -40,7 +42,7 @@ struct mmc_data;
714 * @lock: Spinlock protecting the queue and associated data.
715 * @regs: Pointer to MMIO registers.
716 * @sg: Scatterlist entry currently being processed by PIO code, if any.
717 - * @pio_offset: Offset into the current scatterlist entry.
718 + * @sg_miter: PIO mapping scatterlist iterator.
719 * @cur_slot: The slot which is currently using the controller.
720 * @mrq: The request currently being processed on @cur_slot,
721 * or NULL if the controller is idle.
722 @@ -115,7 +117,7 @@ struct dw_mci {
723 void __iomem *regs;
724
725 struct scatterlist *sg;
726 - unsigned int pio_offset;
727 + struct sg_mapping_iter sg_miter;
728
729 struct dw_mci_slot *cur_slot;
730 struct mmc_request *mrq;
731 diff --git a/include/linux/proportions.h b/include/linux/proportions.h
732 index ef35bb7..26a8a4e 100644
733 --- a/include/linux/proportions.h
734 +++ b/include/linux/proportions.h
735 @@ -81,7 +81,11 @@ void prop_inc_percpu(struct prop_descriptor *pd, struct prop_local_percpu *pl)
736 * Limit the time part in order to ensure there are some bits left for the
737 * cycle counter and fraction multiply.
738 */
739 +#if BITS_PER_LONG == 32
740 #define PROP_MAX_SHIFT (3*BITS_PER_LONG/4)
741 +#else
742 +#define PROP_MAX_SHIFT (BITS_PER_LONG/2)
743 +#endif
744
745 #define PROP_FRAC_SHIFT (BITS_PER_LONG - PROP_MAX_SHIFT - 1)
746 #define PROP_FRAC_BASE (1UL << PROP_FRAC_SHIFT)
747 diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h
748 index 99d1d0d..1f48f14 100644
749 --- a/include/trace/events/writeback.h
750 +++ b/include/trace/events/writeback.h
751 @@ -47,7 +47,10 @@ DECLARE_EVENT_CLASS(writeback_work_class,
752 __field(int, reason)
753 ),
754 TP_fast_assign(
755 - strncpy(__entry->name, dev_name(bdi->dev), 32);
756 + struct device *dev = bdi->dev;
757 + if (!dev)
758 + dev = default_backing_dev_info.dev;
759 + strncpy(__entry->name, dev_name(dev), 32);
760 __entry->nr_pages = work->nr_pages;
761 __entry->sb_dev = work->sb ? work->sb->s_dev : 0;
762 __entry->sync_mode = work->sync_mode;
763 @@ -418,7 +421,7 @@ DECLARE_EVENT_CLASS(writeback_single_inode_template,
764
765 TP_fast_assign(
766 strncpy(__entry->name,
767 - dev_name(inode->i_mapping->backing_dev_info->dev), 32);
768 + dev_name(inode_to_bdi(inode)->dev), 32);
769 __entry->ino = inode->i_ino;
770 __entry->state = inode->i_state;
771 __entry->dirtied_when = inode->dirtied_when;
772 diff --git a/kernel/relay.c b/kernel/relay.c
773 index 226fade..b6f803a 100644
774 --- a/kernel/relay.c
775 +++ b/kernel/relay.c
776 @@ -164,10 +164,14 @@ depopulate:
777 */
778 static struct rchan_buf *relay_create_buf(struct rchan *chan)
779 {
780 - struct rchan_buf *buf = kzalloc(sizeof(struct rchan_buf), GFP_KERNEL);
781 - if (!buf)
782 + struct rchan_buf *buf;
783 +
784 + if (chan->n_subbufs > UINT_MAX / sizeof(size_t *))
785 return NULL;
786
787 + buf = kzalloc(sizeof(struct rchan_buf), GFP_KERNEL);
788 + if (!buf)
789 + return NULL;
790 buf->padding = kmalloc(chan->n_subbufs * sizeof(size_t *), GFP_KERNEL);
791 if (!buf->padding)
792 goto free_buf;
793 @@ -574,6 +578,8 @@ struct rchan *relay_open(const char *base_filename,
794
795 if (!(subbuf_size && n_subbufs))
796 return NULL;
797 + if (subbuf_size > UINT_MAX / n_subbufs)
798 + return NULL;
799
800 chan = kzalloc(sizeof(struct rchan), GFP_KERNEL);
801 if (!chan)
802 diff --git a/mm/backing-dev.c b/mm/backing-dev.c
803 index 71034f4..2b49dd2 100644
804 --- a/mm/backing-dev.c
805 +++ b/mm/backing-dev.c
806 @@ -318,7 +318,7 @@ static void wakeup_timer_fn(unsigned long data)
807 if (bdi->wb.task) {
808 trace_writeback_wake_thread(bdi);
809 wake_up_process(bdi->wb.task);
810 - } else {
811 + } else if (bdi->dev) {
812 /*
813 * When bdi tasks are inactive for long time, they are killed.
814 * In this case we have to wake-up the forker thread which
815 @@ -584,6 +584,8 @@ EXPORT_SYMBOL(bdi_register_dev);
816 */
817 static void bdi_wb_shutdown(struct backing_dev_info *bdi)
818 {
819 + struct task_struct *task;
820 +
821 if (!bdi_cap_writeback_dirty(bdi))
822 return;
823
824 @@ -604,9 +606,14 @@ static void bdi_wb_shutdown(struct backing_dev_info *bdi)
825 * unfreeze of the thread before calling kthread_stop(), otherwise
826 * it would never exet if it is currently stuck in the refrigerator.
827 */
828 - if (bdi->wb.task) {
829 - thaw_process(bdi->wb.task);
830 - kthread_stop(bdi->wb.task);
831 + spin_lock_bh(&bdi->wb_lock);
832 + task = bdi->wb.task;
833 + bdi->wb.task = NULL;
834 + spin_unlock_bh(&bdi->wb_lock);
835 +
836 + if (task) {
837 + thaw_process(task);
838 + kthread_stop(task);
839 }
840 }
841
842 @@ -627,7 +634,9 @@ static void bdi_prune_sb(struct backing_dev_info *bdi)
843
844 void bdi_unregister(struct backing_dev_info *bdi)
845 {
846 - if (bdi->dev) {
847 + struct device *dev = bdi->dev;
848 +
849 + if (dev) {
850 bdi_set_min_ratio(bdi, 0);
851 trace_writeback_bdi_unregister(bdi);
852 bdi_prune_sb(bdi);
853 @@ -636,8 +645,12 @@ void bdi_unregister(struct backing_dev_info *bdi)
854 if (!bdi_cap_flush_forker(bdi))
855 bdi_wb_shutdown(bdi);
856 bdi_debug_unregister(bdi);
857 - device_unregister(bdi->dev);
858 +
859 + spin_lock_bh(&bdi->wb_lock);
860 bdi->dev = NULL;
861 + spin_unlock_bh(&bdi->wb_lock);
862 +
863 + device_unregister(dev);
864 }
865 }
866 EXPORT_SYMBOL(bdi_unregister);
867 diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
868 index 5c51607..064d20f 100644
869 --- a/net/mac80211/rx.c
870 +++ b/net/mac80211/rx.c
871 @@ -616,7 +616,7 @@ static void ieee80211_sta_reorder_release(struct ieee80211_hw *hw,
872 index = seq_sub(tid_agg_rx->head_seq_num, tid_agg_rx->ssn) %
873 tid_agg_rx->buf_size;
874 if (!tid_agg_rx->reorder_buf[index] &&
875 - tid_agg_rx->stored_mpdu_num > 1) {
876 + tid_agg_rx->stored_mpdu_num) {
877 /*
878 * No buffers ready to be released, but check whether any
879 * frames in the reorder buffer have timed out.
880 diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
881 index 34e5fcc..9c197d4 100644
882 --- a/sound/pci/hda/patch_realtek.c
883 +++ b/sound/pci/hda/patch_realtek.c
884 @@ -4213,8 +4213,26 @@ enum {
885 PINFIX_PB_M5210,
886 PINFIX_ACER_ASPIRE_7736,
887 PINFIX_ASUS_W90V,
888 + ALC889_FIXUP_DAC_ROUTE,
889 };
890
891 +/* Fix the connection of some pins for ALC889:
892 + * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
893 + * work correctly (bko#42740)
894 + */
895 +static void alc889_fixup_dac_route(struct hda_codec *codec,
896 + const struct alc_fixup *fix, int action)
897 +{
898 + if (action == ALC_FIXUP_ACT_PRE_PROBE) {
899 + hda_nid_t conn1[2] = { 0x0c, 0x0d };
900 + hda_nid_t conn2[2] = { 0x0e, 0x0f };
901 + snd_hda_override_conn_list(codec, 0x14, 2, conn1);
902 + snd_hda_override_conn_list(codec, 0x15, 2, conn1);
903 + snd_hda_override_conn_list(codec, 0x18, 2, conn2);
904 + snd_hda_override_conn_list(codec, 0x1a, 2, conn2);
905 + }
906 +}
907 +
908 static const struct alc_fixup alc882_fixups[] = {
909 [PINFIX_ABIT_AW9D_MAX] = {
910 .type = ALC_FIXUP_PINS,
911 @@ -4251,10 +4269,15 @@ static const struct alc_fixup alc882_fixups[] = {
912 { }
913 }
914 },
915 + [ALC889_FIXUP_DAC_ROUTE] = {
916 + .type = ALC_FIXUP_FUNC,
917 + .v.func = alc889_fixup_dac_route,
918 + },
919 };
920
921 static const struct snd_pci_quirk alc882_fixup_tbl[] = {
922 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", PINFIX_PB_M5210),
923 + SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
924 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", PINFIX_ASUS_W90V),
925 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", PINFIX_LENOVO_Y530),
926 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", PINFIX_ABIT_AW9D_MAX),
927 diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
928 index a0a3f50..1fe1308 100644
929 --- a/sound/pci/hda/patch_via.c
930 +++ b/sound/pci/hda/patch_via.c
931 @@ -665,6 +665,9 @@ static void via_auto_init_analog_input(struct hda_codec *codec)
932 /* init input-src */
933 for (i = 0; i < spec->num_adc_nids; i++) {
934 int adc_idx = spec->inputs[spec->cur_mux[i]].adc_idx;
935 + /* secondary ADCs must have the unique MUX */
936 + if (i > 0 && !spec->mux_nids[i])
937 + break;
938 if (spec->mux_nids[adc_idx]) {
939 int mux_idx = spec->inputs[spec->cur_mux[i]].mux_idx;
940 snd_hda_codec_write(codec, spec->mux_nids[adc_idx], 0,
941 diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
942 index 11718b49..55f48fb 100644
943 --- a/sound/pci/intel8x0.c
944 +++ b/sound/pci/intel8x0.c
945 @@ -2102,6 +2102,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
946 },
947 {
948 .subvendor = 0x161f,
949 + .subdevice = 0x202f,
950 + .name = "Gateway M520",
951 + .type = AC97_TUNE_INV_EAPD
952 + },
953 + {
954 + .subvendor = 0x161f,
955 .subdevice = 0x203a,
956 .name = "Gateway 4525GZ", /* AD1981B */
957 .type = AC97_TUNE_INV_EAPD
958 diff --git a/tools/perf/bench/mem-memcpy-x86-64-asm.S b/tools/perf/bench/mem-memcpy-x86-64-asm.S
959 index a57b66e..185a96d 100644
960 --- a/tools/perf/bench/mem-memcpy-x86-64-asm.S
961 +++ b/tools/perf/bench/mem-memcpy-x86-64-asm.S
962 @@ -1,2 +1,8 @@
963
964 #include "../../../arch/x86/lib/memcpy_64.S"
965 +/*
966 + * We need to provide note.GNU-stack section, saying that we want
967 + * NOT executable stack. Otherwise the final linking will assume that
968 + * the ELF stack should not be restricted at all and set it RWX.
969 + */
970 +.section .note.GNU-stack,"",@progbits
971 diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
972 index d7915d4..efca198 100644
973 --- a/tools/perf/util/evsel.c
974 +++ b/tools/perf/util/evsel.c
975 @@ -390,6 +390,7 @@ int perf_event__parse_sample(const union perf_event *event, u64 type,
976
977 data->cpu = data->pid = data->tid = -1;
978 data->stream_id = data->id = data->time = -1ULL;
979 + data->period = 1;
980
981 if (event->header.type != PERF_RECORD_SAMPLE) {
982 if (!sample_id_all)