/[linux-patches]/genpatches-2.6/tags/3.0-30/1006_linux-3.0.7.patch
Gentoo

Contents of /genpatches-2.6/tags/3.0-30/1006_linux-3.0.7.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2206 - (show annotations) (download)
Mon Sep 17 18:58:14 2012 UTC (2 years, 3 months ago) by mpagano
File size: 45295 byte(s)
3.0-30 release
1 diff --git a/Makefile b/Makefile
2 index 7767a64..11c4249 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,6 +1,6 @@
6 VERSION = 3
7 PATCHLEVEL = 0
8 -SUBLEVEL = 6
9 +SUBLEVEL = 7
10 EXTRAVERSION =
11 NAME = Sneaky Weasel
12
13 diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
14 index f8b9392..9a9706c 100644
15 --- a/arch/arm/mach-ux500/Kconfig
16 +++ b/arch/arm/mach-ux500/Kconfig
17 @@ -6,6 +6,7 @@ config UX500_SOC_COMMON
18 select ARM_GIC
19 select HAS_MTU
20 select ARM_ERRATA_753970
21 + select ARM_ERRATA_754322
22
23 menu "Ux500 SoC"
24
25 diff --git a/arch/mips/jz4740/gpio.c b/arch/mips/jz4740/gpio.c
26 index 73031f7..4397972 100644
27 --- a/arch/mips/jz4740/gpio.c
28 +++ b/arch/mips/jz4740/gpio.c
29 @@ -18,7 +18,7 @@
30 #include <linux/init.h>
31
32 #include <linux/spinlock.h>
33 -#include <linux/sysdev.h>
34 +#include <linux/syscore_ops.h>
35 #include <linux/io.h>
36 #include <linux/gpio.h>
37 #include <linux/delay.h>
38 @@ -86,7 +86,6 @@ struct jz_gpio_chip {
39 spinlock_t lock;
40
41 struct gpio_chip gpio_chip;
42 - struct sys_device sysdev;
43 };
44
45 static struct jz_gpio_chip jz4740_gpio_chips[];
46 @@ -459,49 +458,47 @@ static struct jz_gpio_chip jz4740_gpio_chips[] = {
47 JZ4740_GPIO_CHIP(D),
48 };
49
50 -static inline struct jz_gpio_chip *sysdev_to_chip(struct sys_device *dev)
51 +static void jz4740_gpio_suspend_chip(struct jz_gpio_chip *chip)
52 {
53 - return container_of(dev, struct jz_gpio_chip, sysdev);
54 + chip->suspend_mask = readl(chip->base + JZ_REG_GPIO_MASK);
55 + writel(~(chip->wakeup), chip->base + JZ_REG_GPIO_MASK_SET);
56 + writel(chip->wakeup, chip->base + JZ_REG_GPIO_MASK_CLEAR);
57 }
58
59 -static int jz4740_gpio_suspend(struct sys_device *dev, pm_message_t state)
60 +static int jz4740_gpio_suspend(void)
61 {
62 - struct jz_gpio_chip *chip = sysdev_to_chip(dev);
63 + int i;
64
65 - chip->suspend_mask = readl(chip->base + JZ_REG_GPIO_MASK);
66 - writel(~(chip->wakeup), chip->base + JZ_REG_GPIO_MASK_SET);
67 - writel(chip->wakeup, chip->base + JZ_REG_GPIO_MASK_CLEAR);
68 + for (i = 0; i < ARRAY_SIZE(jz4740_gpio_chips); i++)
69 + jz4740_gpio_suspend_chip(&jz4740_gpio_chips[i]);
70
71 return 0;
72 }
73
74 -static int jz4740_gpio_resume(struct sys_device *dev)
75 +static void jz4740_gpio_resume_chip(struct jz_gpio_chip *chip)
76 {
77 - struct jz_gpio_chip *chip = sysdev_to_chip(dev);
78 uint32_t mask = chip->suspend_mask;
79
80 writel(~mask, chip->base + JZ_REG_GPIO_MASK_CLEAR);
81 writel(mask, chip->base + JZ_REG_GPIO_MASK_SET);
82 +}
83
84 - return 0;
85 +static void jz4740_gpio_resume(void)
86 +{
87 + int i;
88 +
89 + for (i = ARRAY_SIZE(jz4740_gpio_chips) - 1; i >= 0 ; i--)
90 + jz4740_gpio_resume_chip(&jz4740_gpio_chips[i]);
91 }
92
93 -static struct sysdev_class jz4740_gpio_sysdev_class = {
94 - .name = "gpio",
95 +static struct syscore_ops jz4740_gpio_syscore_ops = {
96 .suspend = jz4740_gpio_suspend,
97 .resume = jz4740_gpio_resume,
98 };
99
100 -static int jz4740_gpio_chip_init(struct jz_gpio_chip *chip, unsigned int id)
101 +static void jz4740_gpio_chip_init(struct jz_gpio_chip *chip, unsigned int id)
102 {
103 - int ret, irq;
104 -
105 - chip->sysdev.id = id;
106 - chip->sysdev.cls = &jz4740_gpio_sysdev_class;
107 - ret = sysdev_register(&chip->sysdev);
108 -
109 - if (ret)
110 - return ret;
111 + int irq;
112
113 spin_lock_init(&chip->lock);
114
115 @@ -519,22 +516,17 @@ static int jz4740_gpio_chip_init(struct jz_gpio_chip *chip, unsigned int id)
116 irq_set_chip_and_handler(irq, &jz_gpio_irq_chip,
117 handle_level_irq);
118 }
119 -
120 - return 0;
121 }
122
123 static int __init jz4740_gpio_init(void)
124 {
125 unsigned int i;
126 - int ret;
127 -
128 - ret = sysdev_class_register(&jz4740_gpio_sysdev_class);
129 - if (ret)
130 - return ret;
131
132 for (i = 0; i < ARRAY_SIZE(jz4740_gpio_chips); ++i)
133 jz4740_gpio_chip_init(&jz4740_gpio_chips[i], i);
134
135 + register_syscore_ops(&jz4740_gpio_syscore_ops);
136 +
137 printk(KERN_INFO "JZ4740 GPIO initialized\n");
138
139 return 0;
140 diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
141 index 581531d..8e073d8 100644
142 --- a/arch/sparc/mm/init_64.c
143 +++ b/arch/sparc/mm/init_64.c
144 @@ -511,6 +511,11 @@ static void __init read_obp_translations(void)
145 for (i = 0; i < prom_trans_ents; i++)
146 prom_trans[i].data &= ~0x0003fe0000000000UL;
147 }
148 +
149 + /* Force execute bit on. */
150 + for (i = 0; i < prom_trans_ents; i++)
151 + prom_trans[i].data |= (tlb_type == hypervisor ?
152 + _PAGE_EXEC_4V : _PAGE_EXEC_4U);
153 }
154
155 static void __init hypervisor_tlb_lock(unsigned long vaddr,
156 diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
157 index 68c3c13..50b3f14 100644
158 --- a/arch/x86/pci/acpi.c
159 +++ b/arch/x86/pci/acpi.c
160 @@ -43,6 +43,17 @@ static const struct dmi_system_id pci_use_crs_table[] __initconst = {
161 DMI_MATCH(DMI_PRODUCT_NAME, "ALiveSATA2-GLAN"),
162 },
163 },
164 + /* https://bugzilla.kernel.org/show_bug.cgi?id=30552 */
165 + /* 2006 AMD HT/VIA system with two host bridges */
166 + {
167 + .callback = set_use_crs,
168 + .ident = "ASUS M2V-MX SE",
169 + .matches = {
170 + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
171 + DMI_MATCH(DMI_BOARD_NAME, "M2V-MX SE"),
172 + DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
173 + },
174 + },
175 {}
176 };
177
178 diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
179 index cab6960..1e9ab9b 100644
180 --- a/drivers/ata/ahci.c
181 +++ b/drivers/ata/ahci.c
182 @@ -812,6 +812,18 @@ static bool ahci_sb600_enable_64bit(struct pci_dev *pdev)
183 DMI_MATCH(DMI_BOARD_NAME, "MS-7376"),
184 },
185 },
186 + /*
187 + * All BIOS versions for the Asus M3A support 64bit DMA.
188 + * (all release versions from 0301 to 1206 were tested)
189 + */
190 + {
191 + .ident = "ASUS M3A",
192 + .matches = {
193 + DMI_MATCH(DMI_BOARD_VENDOR,
194 + "ASUSTeK Computer INC."),
195 + DMI_MATCH(DMI_BOARD_NAME, "M3A"),
196 + },
197 + },
198 { }
199 };
200 const struct dmi_system_id *match;
201 diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c
202 index 7ad43c6..79e8ebc 100644
203 --- a/drivers/gpu/drm/radeon/atombios_dp.c
204 +++ b/drivers/gpu/drm/radeon/atombios_dp.c
205 @@ -115,6 +115,7 @@ static int radeon_dp_aux_native_write(struct radeon_connector *radeon_connector,
206 u8 msg[20];
207 int msg_bytes = send_bytes + 4;
208 u8 ack;
209 + unsigned retry;
210
211 if (send_bytes > 16)
212 return -1;
213 @@ -125,20 +126,22 @@ static int radeon_dp_aux_native_write(struct radeon_connector *radeon_connector,
214 msg[3] = (msg_bytes << 4) | (send_bytes - 1);
215 memcpy(&msg[4], send, send_bytes);
216
217 - while (1) {
218 + for (retry = 0; retry < 4; retry++) {
219 ret = radeon_process_aux_ch(dig_connector->dp_i2c_bus,
220 msg, msg_bytes, NULL, 0, delay, &ack);
221 - if (ret < 0)
222 + if (ret == -EBUSY)
223 + continue;
224 + else if (ret < 0)
225 return ret;
226 if ((ack & AUX_NATIVE_REPLY_MASK) == AUX_NATIVE_REPLY_ACK)
227 - break;
228 + return send_bytes;
229 else if ((ack & AUX_NATIVE_REPLY_MASK) == AUX_NATIVE_REPLY_DEFER)
230 udelay(400);
231 else
232 return -EIO;
233 }
234
235 - return send_bytes;
236 + return -EIO;
237 }
238
239 static int radeon_dp_aux_native_read(struct radeon_connector *radeon_connector,
240 @@ -149,26 +152,31 @@ static int radeon_dp_aux_native_read(struct radeon_connector *radeon_connector,
241 int msg_bytes = 4;
242 u8 ack;
243 int ret;
244 + unsigned retry;
245
246 msg[0] = address;
247 msg[1] = address >> 8;
248 msg[2] = AUX_NATIVE_READ << 4;
249 msg[3] = (msg_bytes << 4) | (recv_bytes - 1);
250
251 - while (1) {
252 + for (retry = 0; retry < 4; retry++) {
253 ret = radeon_process_aux_ch(dig_connector->dp_i2c_bus,
254 msg, msg_bytes, recv, recv_bytes, delay, &ack);
255 - if (ret == 0)
256 - return -EPROTO;
257 - if (ret < 0)
258 + if (ret == -EBUSY)
259 + continue;
260 + else if (ret < 0)
261 return ret;
262 if ((ack & AUX_NATIVE_REPLY_MASK) == AUX_NATIVE_REPLY_ACK)
263 return ret;
264 else if ((ack & AUX_NATIVE_REPLY_MASK) == AUX_NATIVE_REPLY_DEFER)
265 udelay(400);
266 + else if (ret == 0)
267 + return -EPROTO;
268 else
269 return -EIO;
270 }
271 +
272 + return -EIO;
273 }
274
275 static void radeon_write_dpcd_reg(struct radeon_connector *radeon_connector,
276 @@ -232,7 +240,9 @@ int radeon_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode,
277 for (retry = 0; retry < 4; retry++) {
278 ret = radeon_process_aux_ch(auxch,
279 msg, msg_bytes, reply, reply_bytes, 0, &ack);
280 - if (ret < 0) {
281 + if (ret == -EBUSY)
282 + continue;
283 + else if (ret < 0) {
284 DRM_DEBUG_KMS("aux_ch failed %d\n", ret);
285 return ret;
286 }
287 diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
288 index c975581..ea7a24e 100644
289 --- a/drivers/gpu/drm/radeon/evergreen.c
290 +++ b/drivers/gpu/drm/radeon/evergreen.c
291 @@ -1593,48 +1593,6 @@ static u32 evergreen_get_tile_pipe_to_backend_map(struct radeon_device *rdev,
292 return backend_map;
293 }
294
295 -static void evergreen_program_channel_remap(struct radeon_device *rdev)
296 -{
297 - u32 tcp_chan_steer_lo, tcp_chan_steer_hi, mc_shared_chremap, tmp;
298 -
299 - tmp = RREG32(MC_SHARED_CHMAP);
300 - switch ((tmp & NOOFCHAN_MASK) >> NOOFCHAN_SHIFT) {
301 - case 0:
302 - case 1:
303 - case 2:
304 - case 3:
305 - default:
306 - /* default mapping */
307 - mc_shared_chremap = 0x00fac688;
308 - break;
309 - }
310 -
311 - switch (rdev->family) {
312 - case CHIP_HEMLOCK:
313 - case CHIP_CYPRESS:
314 - case CHIP_BARTS:
315 - tcp_chan_steer_lo = 0x54763210;
316 - tcp_chan_steer_hi = 0x0000ba98;
317 - break;
318 - case CHIP_JUNIPER:
319 - case CHIP_REDWOOD:
320 - case CHIP_CEDAR:
321 - case CHIP_PALM:
322 - case CHIP_SUMO:
323 - case CHIP_SUMO2:
324 - case CHIP_TURKS:
325 - case CHIP_CAICOS:
326 - default:
327 - tcp_chan_steer_lo = 0x76543210;
328 - tcp_chan_steer_hi = 0x0000ba98;
329 - break;
330 - }
331 -
332 - WREG32(TCP_CHAN_STEER_LO, tcp_chan_steer_lo);
333 - WREG32(TCP_CHAN_STEER_HI, tcp_chan_steer_hi);
334 - WREG32(MC_SHARED_CHREMAP, mc_shared_chremap);
335 -}
336 -
337 static void evergreen_gpu_init(struct radeon_device *rdev)
338 {
339 u32 cc_rb_backend_disable = 0;
340 @@ -2080,8 +2038,6 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
341 WREG32(DMIF_ADDR_CONFIG, gb_addr_config);
342 WREG32(HDP_ADDR_CONFIG, gb_addr_config);
343
344 - evergreen_program_channel_remap(rdev);
345 -
346 num_shader_engines = ((RREG32(GB_ADDR_CONFIG) & NUM_SHADER_ENGINES(3)) >> 12) + 1;
347 grbm_gfx_index = INSTANCE_BROADCAST_WRITES;
348
349 diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
350 index 0b132a3..0c460c4 100644
351 --- a/drivers/gpu/drm/radeon/ni.c
352 +++ b/drivers/gpu/drm/radeon/ni.c
353 @@ -569,36 +569,6 @@ static u32 cayman_get_tile_pipe_to_backend_map(struct radeon_device *rdev,
354 return backend_map;
355 }
356
357 -static void cayman_program_channel_remap(struct radeon_device *rdev)
358 -{
359 - u32 tcp_chan_steer_lo, tcp_chan_steer_hi, mc_shared_chremap, tmp;
360 -
361 - tmp = RREG32(MC_SHARED_CHMAP);
362 - switch ((tmp & NOOFCHAN_MASK) >> NOOFCHAN_SHIFT) {
363 - case 0:
364 - case 1:
365 - case 2:
366 - case 3:
367 - default:
368 - /* default mapping */
369 - mc_shared_chremap = 0x00fac688;
370 - break;
371 - }
372 -
373 - switch (rdev->family) {
374 - case CHIP_CAYMAN:
375 - default:
376 - //tcp_chan_steer_lo = 0x54763210
377 - tcp_chan_steer_lo = 0x76543210;
378 - tcp_chan_steer_hi = 0x0000ba98;
379 - break;
380 - }
381 -
382 - WREG32(TCP_CHAN_STEER_LO, tcp_chan_steer_lo);
383 - WREG32(TCP_CHAN_STEER_HI, tcp_chan_steer_hi);
384 - WREG32(MC_SHARED_CHREMAP, mc_shared_chremap);
385 -}
386 -
387 static u32 cayman_get_disable_mask_per_asic(struct radeon_device *rdev,
388 u32 disable_mask_per_se,
389 u32 max_disable_mask_per_se,
390 @@ -841,8 +811,6 @@ static void cayman_gpu_init(struct radeon_device *rdev)
391 WREG32(DMIF_ADDR_CONFIG, gb_addr_config);
392 WREG32(HDP_ADDR_CONFIG, gb_addr_config);
393
394 - cayman_program_channel_remap(rdev);
395 -
396 /* primary versions */
397 WREG32(CC_RB_BACKEND_DISABLE, cc_rb_backend_disable);
398 WREG32(CC_SYS_RB_BACKEND_DISABLE, cc_rb_backend_disable);
399 diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
400 index d1b36f8..05b8b2c 100644
401 --- a/drivers/gpu/drm/radeon/radeon_connectors.c
402 +++ b/drivers/gpu/drm/radeon/radeon_connectors.c
403 @@ -68,11 +68,11 @@ void radeon_connector_hotplug(struct drm_connector *connector)
404 if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) {
405 int saved_dpms = connector->dpms;
406
407 - if (radeon_hpd_sense(rdev, radeon_connector->hpd.hpd) &&
408 - radeon_dp_needs_link_train(radeon_connector))
409 - drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
410 - else
411 + /* Only turn off the display it it's physically disconnected */
412 + if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd))
413 drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF);
414 + else if (radeon_dp_needs_link_train(radeon_connector))
415 + drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
416 connector->dpms = saved_dpms;
417 }
418 }
419 diff --git a/drivers/gpu/drm/radeon/radeon_cursor.c b/drivers/gpu/drm/radeon/radeon_cursor.c
420 index 3189a7e..f59a682 100644
421 --- a/drivers/gpu/drm/radeon/radeon_cursor.c
422 +++ b/drivers/gpu/drm/radeon/radeon_cursor.c
423 @@ -208,6 +208,13 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc,
424 int xorigin = 0, yorigin = 0;
425 int w = radeon_crtc->cursor_width;
426
427 + if (ASIC_IS_AVIVO(rdev)) {
428 + /* avivo cursor are offset into the total surface */
429 + x += crtc->x;
430 + y += crtc->y;
431 + }
432 + DRM_DEBUG("x %d y %d c->x %d c->y %d\n", x, y, crtc->x, crtc->y);
433 +
434 if (x < 0)
435 xorigin = -x + 1;
436 if (y < 0)
437 @@ -221,11 +228,6 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc,
438 int i = 0;
439 struct drm_crtc *crtc_p;
440
441 - /* avivo cursor are offset into the total surface */
442 - x += crtc->x;
443 - y += crtc->y;
444 - DRM_DEBUG("x %d y %d c->x %d c->y %d\n", x, y, crtc->x, crtc->y);
445 -
446 /* avivo cursor image can't end on 128 pixel boundary or
447 * go past the end of the frame if both crtcs are enabled
448 */
449 diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c
450 index 13690f3..8a171b2 100644
451 --- a/drivers/gpu/drm/radeon/radeon_encoders.c
452 +++ b/drivers/gpu/drm/radeon/radeon_encoders.c
453 @@ -1755,9 +1755,12 @@ static int radeon_atom_pick_dig_encoder(struct drm_encoder *encoder)
454 /* DCE4/5 */
455 if (ASIC_IS_DCE4(rdev)) {
456 dig = radeon_encoder->enc_priv;
457 - if (ASIC_IS_DCE41(rdev))
458 - return radeon_crtc->crtc_id;
459 - else {
460 + if (ASIC_IS_DCE41(rdev)) {
461 + if (dig->linkb)
462 + return 1;
463 + else
464 + return 0;
465 + } else {
466 switch (radeon_encoder->encoder_id) {
467 case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:
468 if (dig->linkb)
469 diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
470 index 4de5189..f2516e6 100644
471 --- a/drivers/gpu/drm/radeon/rv770.c
472 +++ b/drivers/gpu/drm/radeon/rv770.c
473 @@ -536,55 +536,6 @@ static u32 r700_get_tile_pipe_to_backend_map(struct radeon_device *rdev,
474 return backend_map;
475 }
476
477 -static void rv770_program_channel_remap(struct radeon_device *rdev)
478 -{
479 - u32 tcp_chan_steer, mc_shared_chremap, tmp;
480 - bool force_no_swizzle;
481 -
482 - switch (rdev->family) {
483 - case CHIP_RV770:
484 - case CHIP_RV730:
485 - force_no_swizzle = false;
486 - break;
487 - case CHIP_RV710:
488 - case CHIP_RV740:
489 - default:
490 - force_no_swizzle = true;
491 - break;
492 - }
493 -
494 - tmp = RREG32(MC_SHARED_CHMAP);
495 - switch ((tmp & NOOFCHAN_MASK) >> NOOFCHAN_SHIFT) {
496 - case 0:
497 - case 1:
498 - default:
499 - /* default mapping */
500 - mc_shared_chremap = 0x00fac688;
501 - break;
502 - case 2:
503 - case 3:
504 - if (force_no_swizzle)
505 - mc_shared_chremap = 0x00fac688;
506 - else
507 - mc_shared_chremap = 0x00bbc298;
508 - break;
509 - }
510 -
511 - if (rdev->family == CHIP_RV740)
512 - tcp_chan_steer = 0x00ef2a60;
513 - else
514 - tcp_chan_steer = 0x00fac688;
515 -
516 - /* RV770 CE has special chremap setup */
517 - if (rdev->pdev->device == 0x944e) {
518 - tcp_chan_steer = 0x00b08b08;
519 - mc_shared_chremap = 0x00b08b08;
520 - }
521 -
522 - WREG32(TCP_CHAN_STEER, tcp_chan_steer);
523 - WREG32(MC_SHARED_CHREMAP, mc_shared_chremap);
524 -}
525 -
526 static void rv770_gpu_init(struct radeon_device *rdev)
527 {
528 int i, j, num_qd_pipes;
529 @@ -784,8 +735,6 @@ static void rv770_gpu_init(struct radeon_device *rdev)
530 WREG32(DCP_TILING_CONFIG, (gb_tiling_config & 0xffff));
531 WREG32(HDP_TILING_CONFIG, (gb_tiling_config & 0xffff));
532
533 - rv770_program_channel_remap(rdev);
534 -
535 WREG32(CC_RB_BACKEND_DISABLE, cc_rb_backend_disable);
536 WREG32(CC_GC_SHADER_PIPE_CONFIG, cc_gc_shader_pipe_config);
537 WREG32(GC_USER_SHADER_PIPE_CONFIG, cc_gc_shader_pipe_config);
538 diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
539 index 2747980..16f69be 100644
540 --- a/drivers/ide/ide-disk.c
541 +++ b/drivers/ide/ide-disk.c
542 @@ -435,7 +435,12 @@ static int idedisk_prep_fn(struct request_queue *q, struct request *rq)
543 if (!(rq->cmd_flags & REQ_FLUSH))
544 return BLKPREP_OK;
545
546 - cmd = kzalloc(sizeof(*cmd), GFP_ATOMIC);
547 + if (rq->special) {
548 + cmd = rq->special;
549 + memset(cmd, 0, sizeof(*cmd));
550 + } else {
551 + cmd = kzalloc(sizeof(*cmd), GFP_ATOMIC);
552 + }
553
554 /* FIXME: map struct ide_taskfile on rq->cmd[] */
555 BUG_ON(cmd == NULL);
556 diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
557 index 451c3bb..ebdae6e 100644
558 --- a/drivers/md/dm-table.c
559 +++ b/drivers/md/dm-table.c
560 @@ -1184,14 +1184,15 @@ static void dm_table_set_integrity(struct dm_table *t)
561 return;
562
563 template_disk = dm_table_get_integrity_disk(t, true);
564 - if (!template_disk &&
565 - blk_integrity_is_initialized(dm_disk(t->md))) {
566 + if (template_disk)
567 + blk_integrity_register(dm_disk(t->md),
568 + blk_get_integrity(template_disk));
569 + else if (blk_integrity_is_initialized(dm_disk(t->md)))
570 DMWARN("%s: device no longer has a valid integrity profile",
571 dm_device_name(t->md));
572 - return;
573 - }
574 - blk_integrity_register(dm_disk(t->md),
575 - blk_get_integrity(template_disk));
576 + else
577 + DMWARN("%s: unable to establish an integrity profile",
578 + dm_device_name(t->md));
579 }
580
581 void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
582 diff --git a/drivers/md/md.c b/drivers/md/md.c
583 index 8554082..bc83428 100644
584 --- a/drivers/md/md.c
585 +++ b/drivers/md/md.c
586 @@ -61,6 +61,11 @@
587 static void autostart_arrays(int part);
588 #endif
589
590 +/* pers_list is a list of registered personalities protected
591 + * by pers_lock.
592 + * pers_lock does extra service to protect accesses to
593 + * mddev->thread when the mutex cannot be held.
594 + */
595 static LIST_HEAD(pers_list);
596 static DEFINE_SPINLOCK(pers_lock);
597
598 @@ -690,7 +695,12 @@ static void mddev_unlock(mddev_t * mddev)
599 } else
600 mutex_unlock(&mddev->reconfig_mutex);
601
602 + /* was we've dropped the mutex we need a spinlock to
603 + * make sur the thread doesn't disappear
604 + */
605 + spin_lock(&pers_lock);
606 md_wakeup_thread(mddev->thread);
607 + spin_unlock(&pers_lock);
608 }
609
610 static mdk_rdev_t * find_rdev_nr(mddev_t *mddev, int nr)
611 @@ -6186,11 +6196,18 @@ mdk_thread_t *md_register_thread(void (*run) (mddev_t *), mddev_t *mddev,
612 return thread;
613 }
614
615 -void md_unregister_thread(mdk_thread_t *thread)
616 +void md_unregister_thread(mdk_thread_t **threadp)
617 {
618 + mdk_thread_t *thread = *threadp;
619 if (!thread)
620 return;
621 dprintk("interrupting MD-thread pid %d\n", task_pid_nr(thread->tsk));
622 + /* Locking ensures that mddev_unlock does not wake_up a
623 + * non-existent thread
624 + */
625 + spin_lock(&pers_lock);
626 + *threadp = NULL;
627 + spin_unlock(&pers_lock);
628
629 kthread_stop(thread->tsk);
630 kfree(thread);
631 @@ -7125,8 +7142,7 @@ static void reap_sync_thread(mddev_t *mddev)
632 mdk_rdev_t *rdev;
633
634 /* resync has finished, collect result */
635 - md_unregister_thread(mddev->sync_thread);
636 - mddev->sync_thread = NULL;
637 + md_unregister_thread(&mddev->sync_thread);
638 if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery) &&
639 !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) {
640 /* success...*/
641 diff --git a/drivers/md/md.h b/drivers/md/md.h
642 index 1c26c7a..ce4e328 100644
643 --- a/drivers/md/md.h
644 +++ b/drivers/md/md.h
645 @@ -475,7 +475,7 @@ extern int register_md_personality(struct mdk_personality *p);
646 extern int unregister_md_personality(struct mdk_personality *p);
647 extern mdk_thread_t * md_register_thread(void (*run) (mddev_t *mddev),
648 mddev_t *mddev, const char *name);
649 -extern void md_unregister_thread(mdk_thread_t *thread);
650 +extern void md_unregister_thread(mdk_thread_t **threadp);
651 extern void md_wakeup_thread(mdk_thread_t *thread);
652 extern void md_check_recovery(mddev_t *mddev);
653 extern void md_write_start(mddev_t *mddev, struct bio *bi);
654 diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c
655 index 3535c23..d5b5fb3 100644
656 --- a/drivers/md/multipath.c
657 +++ b/drivers/md/multipath.c
658 @@ -514,8 +514,7 @@ static int multipath_stop (mddev_t *mddev)
659 {
660 multipath_conf_t *conf = mddev->private;
661
662 - md_unregister_thread(mddev->thread);
663 - mddev->thread = NULL;
664 + md_unregister_thread(&mddev->thread);
665 blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
666 mempool_destroy(conf->pool);
667 kfree(conf->multipaths);
668 diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
669 index f7431b6..3a9e59f 100644
670 --- a/drivers/md/raid1.c
671 +++ b/drivers/md/raid1.c
672 @@ -2045,8 +2045,7 @@ static int stop(mddev_t *mddev)
673 raise_barrier(conf);
674 lower_barrier(conf);
675
676 - md_unregister_thread(mddev->thread);
677 - mddev->thread = NULL;
678 + md_unregister_thread(&mddev->thread);
679 if (conf->r1bio_pool)
680 mempool_destroy(conf->r1bio_pool);
681 kfree(conf->mirrors);
682 diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
683 index 6e84668..17cb6ab 100644
684 --- a/drivers/md/raid10.c
685 +++ b/drivers/md/raid10.c
686 @@ -2331,7 +2331,7 @@ static int run(mddev_t *mddev)
687 return 0;
688
689 out_free_conf:
690 - md_unregister_thread(mddev->thread);
691 + md_unregister_thread(&mddev->thread);
692 if (conf->r10bio_pool)
693 mempool_destroy(conf->r10bio_pool);
694 safe_put_page(conf->tmppage);
695 @@ -2349,8 +2349,7 @@ static int stop(mddev_t *mddev)
696 raise_barrier(conf, 0);
697 lower_barrier(conf);
698
699 - md_unregister_thread(mddev->thread);
700 - mddev->thread = NULL;
701 + md_unregister_thread(&mddev->thread);
702 blk_sync_queue(mddev->queue); /* the unplug fn references 'conf'*/
703 if (conf->r10bio_pool)
704 mempool_destroy(conf->r10bio_pool);
705 diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
706 index b72edf3..2581ba1 100644
707 --- a/drivers/md/raid5.c
708 +++ b/drivers/md/raid5.c
709 @@ -5162,8 +5162,7 @@ static int run(mddev_t *mddev)
710
711 return 0;
712 abort:
713 - md_unregister_thread(mddev->thread);
714 - mddev->thread = NULL;
715 + md_unregister_thread(&mddev->thread);
716 if (conf) {
717 print_raid5_conf(conf);
718 free_conf(conf);
719 @@ -5177,8 +5176,7 @@ static int stop(mddev_t *mddev)
720 {
721 raid5_conf_t *conf = mddev->private;
722
723 - md_unregister_thread(mddev->thread);
724 - mddev->thread = NULL;
725 + md_unregister_thread(&mddev->thread);
726 if (mddev->queue)
727 mddev->queue->backing_dev_info.congested_fn = NULL;
728 free_conf(conf);
729 diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c
730 index b928bc1..8b51cd6 100644
731 --- a/drivers/misc/lis3lv02d/lis3lv02d.c
732 +++ b/drivers/misc/lis3lv02d/lis3lv02d.c
733 @@ -375,12 +375,14 @@ void lis3lv02d_poweron(struct lis3lv02d *lis3)
734 * both have been read. So the value read will always be correct.
735 * Set BOOT bit to refresh factory tuning values.
736 */
737 - lis3->read(lis3, CTRL_REG2, &reg);
738 - if (lis3->whoami == WAI_12B)
739 - reg |= CTRL2_BDU | CTRL2_BOOT;
740 - else
741 - reg |= CTRL2_BOOT_8B;
742 - lis3->write(lis3, CTRL_REG2, reg);
743 + if (lis3->pdata) {
744 + lis3->read(lis3, CTRL_REG2, &reg);
745 + if (lis3->whoami == WAI_12B)
746 + reg |= CTRL2_BDU | CTRL2_BOOT;
747 + else
748 + reg |= CTRL2_BOOT_8B;
749 + lis3->write(lis3, CTRL_REG2, reg);
750 + }
751
752 /* LIS3 power on delay is quite long */
753 msleep(lis3->pwron_delay / lis3lv02d_get_odr());
754 diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
755 index 99d39a6..d513d47 100644
756 --- a/drivers/mmc/host/mxs-mmc.c
757 +++ b/drivers/mmc/host/mxs-mmc.c
758 @@ -564,40 +564,38 @@ static void mxs_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
759
760 static void mxs_mmc_set_clk_rate(struct mxs_mmc_host *host, unsigned int rate)
761 {
762 - unsigned int ssp_rate, bit_rate;
763 - u32 div1, div2;
764 + unsigned int ssp_clk, ssp_sck;
765 + u32 clock_divide, clock_rate;
766 u32 val;
767
768 - ssp_rate = clk_get_rate(host->clk);
769 + ssp_clk = clk_get_rate(host->clk);
770
771 - for (div1 = 2; div1 < 254; div1 += 2) {
772 - div2 = ssp_rate / rate / div1;
773 - if (div2 < 0x100)
774 + for (clock_divide = 2; clock_divide <= 254; clock_divide += 2) {
775 + clock_rate = DIV_ROUND_UP(ssp_clk, rate * clock_divide);
776 + clock_rate = (clock_rate > 0) ? clock_rate - 1 : 0;
777 + if (clock_rate <= 255)
778 break;
779 }
780
781 - if (div1 >= 254) {
782 + if (clock_divide > 254) {
783 dev_err(mmc_dev(host->mmc),
784 "%s: cannot set clock to %d\n", __func__, rate);
785 return;
786 }
787
788 - if (div2 == 0)
789 - bit_rate = ssp_rate / div1;
790 - else
791 - bit_rate = ssp_rate / div1 / div2;
792 + ssp_sck = ssp_clk / clock_divide / (1 + clock_rate);
793
794 val = readl(host->base + HW_SSP_TIMING);
795 val &= ~(BM_SSP_TIMING_CLOCK_DIVIDE | BM_SSP_TIMING_CLOCK_RATE);
796 - val |= BF_SSP(div1, TIMING_CLOCK_DIVIDE);
797 - val |= BF_SSP(div2 - 1, TIMING_CLOCK_RATE);
798 + val |= BF_SSP(clock_divide, TIMING_CLOCK_DIVIDE);
799 + val |= BF_SSP(clock_rate, TIMING_CLOCK_RATE);
800 writel(val, host->base + HW_SSP_TIMING);
801
802 - host->clk_rate = bit_rate;
803 + host->clk_rate = ssp_sck;
804
805 dev_dbg(mmc_dev(host->mmc),
806 - "%s: div1 %d, div2 %d, ssp %d, bit %d, rate %d\n",
807 - __func__, div1, div2, ssp_rate, bit_rate, rate);
808 + "%s: clock_divide %d, clock_rate %d, ssp_clk %d, rate_actual %d, rate_requested %d\n",
809 + __func__, clock_divide, clock_rate, ssp_clk, ssp_sck, rate);
810 }
811
812 static void mxs_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
813 diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
814 index 3369d1f..ee77b94 100644
815 --- a/drivers/net/e1000e/ich8lan.c
816 +++ b/drivers/net/e1000e/ich8lan.c
817 @@ -137,8 +137,9 @@
818 #define HV_PM_CTRL PHY_REG(770, 17)
819
820 /* PHY Low Power Idle Control */
821 -#define I82579_LPI_CTRL PHY_REG(772, 20)
822 -#define I82579_LPI_CTRL_ENABLE_MASK 0x6000
823 +#define I82579_LPI_CTRL PHY_REG(772, 20)
824 +#define I82579_LPI_CTRL_ENABLE_MASK 0x6000
825 +#define I82579_LPI_CTRL_FORCE_PLL_LOCK_COUNT 0x80
826
827 /* EMI Registers */
828 #define I82579_EMI_ADDR 0x10
829 @@ -1611,6 +1612,7 @@ static s32 e1000_k1_workaround_lv(struct e1000_hw *hw)
830 s32 ret_val = 0;
831 u16 status_reg = 0;
832 u32 mac_reg;
833 + u16 phy_reg;
834
835 if (hw->mac.type != e1000_pch2lan)
836 goto out;
837 @@ -1625,12 +1627,19 @@ static s32 e1000_k1_workaround_lv(struct e1000_hw *hw)
838 mac_reg = er32(FEXTNVM4);
839 mac_reg &= ~E1000_FEXTNVM4_BEACON_DURATION_MASK;
840
841 - if (status_reg & HV_M_STATUS_SPEED_1000)
842 + ret_val = e1e_rphy(hw, I82579_LPI_CTRL, &phy_reg);
843 + if (ret_val)
844 + goto out;
845 +
846 + if (status_reg & HV_M_STATUS_SPEED_1000) {
847 mac_reg |= E1000_FEXTNVM4_BEACON_DURATION_8USEC;
848 - else
849 + phy_reg &= ~I82579_LPI_CTRL_FORCE_PLL_LOCK_COUNT;
850 + } else {
851 mac_reg |= E1000_FEXTNVM4_BEACON_DURATION_16USEC;
852 -
853 + phy_reg |= I82579_LPI_CTRL_FORCE_PLL_LOCK_COUNT;
854 + }
855 ew32(FEXTNVM4, mac_reg);
856 + ret_val = e1e_wphy(hw, I82579_LPI_CTRL, phy_reg);
857 }
858
859 out:
860 diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
861 index ab8c16f..2886d25 100644
862 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c
863 +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
864 @@ -556,15 +556,21 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
865 bool local)
866 {
867 struct ieee80211_tx_info *tx_info;
868 - struct queue_entry *entry = rt2x00queue_get_entry(queue, Q_INDEX);
869 + struct queue_entry *entry;
870 struct txentry_desc txdesc;
871 struct skb_frame_desc *skbdesc;
872 u8 rate_idx, rate_flags;
873 + int ret = 0;
874 +
875 + spin_lock(&queue->tx_lock);
876 +
877 + entry = rt2x00queue_get_entry(queue, Q_INDEX);
878
879 if (unlikely(rt2x00queue_full(queue))) {
880 ERROR(queue->rt2x00dev,
881 "Dropping frame due to full tx queue %d.\n", queue->qid);
882 - return -ENOBUFS;
883 + ret = -ENOBUFS;
884 + goto out;
885 }
886
887 if (unlikely(test_and_set_bit(ENTRY_OWNER_DEVICE_DATA,
888 @@ -573,7 +579,8 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
889 "Arrived at non-free entry in the non-full queue %d.\n"
890 "Please file bug report to %s.\n",
891 queue->qid, DRV_PROJECT);
892 - return -EINVAL;
893 + ret = -EINVAL;
894 + goto out;
895 }
896
897 /*
898 @@ -635,7 +642,8 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
899 if (unlikely(rt2x00queue_write_tx_data(entry, &txdesc))) {
900 clear_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags);
901 entry->skb = NULL;
902 - return -EIO;
903 + ret = -EIO;
904 + goto out;
905 }
906
907 set_bit(ENTRY_DATA_PENDING, &entry->flags);
908 @@ -644,7 +652,9 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
909 rt2x00queue_write_tx_descriptor(entry, &txdesc);
910 rt2x00queue_kick_tx_queue(queue, &txdesc);
911
912 - return 0;
913 +out:
914 + spin_unlock(&queue->tx_lock);
915 + return ret;
916 }
917
918 int rt2x00queue_clear_beacon(struct rt2x00_dev *rt2x00dev,
919 @@ -1185,6 +1195,7 @@ static void rt2x00queue_init(struct rt2x00_dev *rt2x00dev,
920 struct data_queue *queue, enum data_queue_qid qid)
921 {
922 mutex_init(&queue->status_lock);
923 + spin_lock_init(&queue->tx_lock);
924 spin_lock_init(&queue->index_lock);
925
926 queue->rt2x00dev = rt2x00dev;
927 diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.h b/drivers/net/wireless/rt2x00/rt2x00queue.h
928 index 167d458..ad3d527 100644
929 --- a/drivers/net/wireless/rt2x00/rt2x00queue.h
930 +++ b/drivers/net/wireless/rt2x00/rt2x00queue.h
931 @@ -432,6 +432,7 @@ enum data_queue_flags {
932 * @flags: Entry flags, see &enum queue_entry_flags.
933 * @status_lock: The mutex for protecting the start/stop/flush
934 * handling on this queue.
935 + * @tx_lock: Spinlock to serialize tx operations on this queue.
936 * @index_lock: Spinlock to protect index handling. Whenever @index, @index_done or
937 * @index_crypt needs to be changed this lock should be grabbed to prevent
938 * index corruption due to concurrency.
939 @@ -458,6 +459,7 @@ struct data_queue {
940 unsigned long flags;
941
942 struct mutex status_lock;
943 + spinlock_t tx_lock;
944 spinlock_t index_lock;
945
946 unsigned int count;
947 diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
948 index c9e3dc0..16ad97d 100644
949 --- a/drivers/scsi/libsas/sas_expander.c
950 +++ b/drivers/scsi/libsas/sas_expander.c
951 @@ -1769,10 +1769,12 @@ static void sas_unregister_devs_sas_addr(struct domain_device *parent,
952 sas_disable_routing(parent, phy->attached_sas_addr);
953 }
954 memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE);
955 - sas_port_delete_phy(phy->port, phy->phy);
956 - if (phy->port->num_phys == 0)
957 - sas_port_delete(phy->port);
958 - phy->port = NULL;
959 + if (phy->port) {
960 + sas_port_delete_phy(phy->port, phy->phy);
961 + if (phy->port->num_phys == 0)
962 + sas_port_delete(phy->port);
963 + phy->port = NULL;
964 + }
965 }
966
967 static int sas_discover_bfs_by_root_level(struct domain_device *root,
968 diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
969 index f461925..a2a1a83 100644
970 --- a/drivers/scsi/qla2xxx/qla_os.c
971 +++ b/drivers/scsi/qla2xxx/qla_os.c
972 @@ -1240,10 +1240,9 @@ qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res)
973 qla2x00_sp_compl(ha, sp);
974 } else {
975 ctx = sp->ctx;
976 - if (ctx->type == SRB_LOGIN_CMD ||
977 - ctx->type == SRB_LOGOUT_CMD) {
978 - ctx->u.iocb_cmd->free(sp);
979 - } else {
980 + if (ctx->type == SRB_ELS_CMD_RPT ||
981 + ctx->type == SRB_ELS_CMD_HST ||
982 + ctx->type == SRB_CT_CMD) {
983 struct fc_bsg_job *bsg_job =
984 ctx->u.bsg_job;
985 if (bsg_job->request->msgcode
986 @@ -1255,6 +1254,8 @@ qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res)
987 kfree(sp->ctx);
988 mempool_free(sp,
989 ha->srb_mempool);
990 + } else {
991 + ctx->u.iocb_cmd->free(sp);
992 }
993 }
994 }
995 diff --git a/fs/exec.c b/fs/exec.c
996 index 6075a1e..044c13f 100644
997 --- a/fs/exec.c
998 +++ b/fs/exec.c
999 @@ -1411,6 +1411,8 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
1000 printable(bprm->buf[2]) &&
1001 printable(bprm->buf[3]))
1002 break; /* -ENOEXEC */
1003 + if (try)
1004 + break; /* -ENOEXEC */
1005 request_module("binfmt-%04x", *(unsigned short *)(&bprm->buf[2]));
1006 #endif
1007 }
1008 diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
1009 index 9d88e1c..f0c0e8a 100644
1010 --- a/include/linux/ftrace.h
1011 +++ b/include/linux/ftrace.h
1012 @@ -19,6 +19,8 @@
1013
1014 #include <asm/ftrace.h>
1015
1016 +struct ftrace_hash;
1017 +
1018 #ifdef CONFIG_FUNCTION_TRACER
1019
1020 extern int ftrace_enabled;
1021 @@ -29,8 +31,6 @@ ftrace_enable_sysctl(struct ctl_table *table, int write,
1022
1023 typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip);
1024
1025 -struct ftrace_hash;
1026 -
1027 enum {
1028 FTRACE_OPS_FL_ENABLED = 1 << 0,
1029 FTRACE_OPS_FL_GLOBAL = 1 << 1,
1030 @@ -123,7 +123,8 @@ stack_trace_sysctl(struct ctl_table *table, int write,
1031 struct ftrace_func_command {
1032 struct list_head list;
1033 char *name;
1034 - int (*func)(char *func, char *cmd,
1035 + int (*func)(struct ftrace_hash *hash,
1036 + char *func, char *cmd,
1037 char *params, int enable);
1038 };
1039
1040 diff --git a/include/linux/ptp_classify.h b/include/linux/ptp_classify.h
1041 index e07e274..1dc420b 100644
1042 --- a/include/linux/ptp_classify.h
1043 +++ b/include/linux/ptp_classify.h
1044 @@ -51,6 +51,7 @@
1045 #define PTP_CLASS_V2_VLAN (PTP_CLASS_V2 | PTP_CLASS_VLAN)
1046
1047 #define PTP_EV_PORT 319
1048 +#define PTP_GEN_BIT 0x08 /* indicates general message, if set in message type */
1049
1050 #define OFF_ETYPE 12
1051 #define OFF_IHL 14
1052 @@ -116,14 +117,20 @@ static inline int ptp_filter_init(struct sock_filter *f, int len)
1053 {OP_OR, 0, 0, PTP_CLASS_IPV6 }, /* */ \
1054 {OP_RETA, 0, 0, 0 }, /* */ \
1055 /*L3x*/ {OP_RETK, 0, 0, PTP_CLASS_NONE }, /* */ \
1056 -/*L40*/ {OP_JEQ, 0, 6, ETH_P_8021Q }, /* f goto L50 */ \
1057 +/*L40*/ {OP_JEQ, 0, 9, ETH_P_8021Q }, /* f goto L50 */ \
1058 {OP_LDH, 0, 0, OFF_ETYPE + 4 }, /* */ \
1059 - {OP_JEQ, 0, 9, ETH_P_1588 }, /* f goto L60 */ \
1060 + {OP_JEQ, 0, 15, ETH_P_1588 }, /* f goto L60 */ \
1061 + {OP_LDB, 0, 0, ETH_HLEN + VLAN_HLEN }, /* */ \
1062 + {OP_AND, 0, 0, PTP_GEN_BIT }, /* */ \
1063 + {OP_JEQ, 0, 12, 0 }, /* f goto L6x */ \
1064 {OP_LDH, 0, 0, ETH_HLEN + VLAN_HLEN }, /* */ \
1065 {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \
1066 {OP_OR, 0, 0, PTP_CLASS_VLAN }, /* */ \
1067 {OP_RETA, 0, 0, 0 }, /* */ \
1068 -/*L50*/ {OP_JEQ, 0, 4, ETH_P_1588 }, /* f goto L61 */ \
1069 +/*L50*/ {OP_JEQ, 0, 7, ETH_P_1588 }, /* f goto L61 */ \
1070 + {OP_LDB, 0, 0, ETH_HLEN }, /* */ \
1071 + {OP_AND, 0, 0, PTP_GEN_BIT }, /* */ \
1072 + {OP_JEQ, 0, 4, 0 }, /* f goto L6x */ \
1073 {OP_LDH, 0, 0, ETH_HLEN }, /* */ \
1074 {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \
1075 {OP_OR, 0, 0, PTP_CLASS_L2 }, /* */ \
1076 diff --git a/include/linux/sched.h b/include/linux/sched.h
1077 index 14a6c7b..4ef452b 100644
1078 --- a/include/linux/sched.h
1079 +++ b/include/linux/sched.h
1080 @@ -1937,7 +1937,6 @@ static inline void disable_sched_clock_irqtime(void) {}
1081
1082 extern unsigned long long
1083 task_sched_runtime(struct task_struct *task);
1084 -extern unsigned long long thread_group_sched_runtime(struct task_struct *task);
1085
1086 /* sched_exec is called by processes performing an exec */
1087 #ifdef CONFIG_SMP
1088 diff --git a/include/net/ipv6.h b/include/net/ipv6.h
1089 index 3b5ac1f..c39121f 100644
1090 --- a/include/net/ipv6.h
1091 +++ b/include/net/ipv6.h
1092 @@ -463,7 +463,7 @@ static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_add
1093 return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr));
1094 }
1095
1096 -extern void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt);
1097 +extern void ipv6_select_ident(struct frag_hdr *fhdr, struct in6_addr *addr);
1098
1099 /*
1100 * Prototypes exported by ipv6
1101 diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c
1102 index 58f405b..c8008dd 100644
1103 --- a/kernel/posix-cpu-timers.c
1104 +++ b/kernel/posix-cpu-timers.c
1105 @@ -250,7 +250,7 @@ void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times)
1106 do {
1107 times->utime = cputime_add(times->utime, t->utime);
1108 times->stime = cputime_add(times->stime, t->stime);
1109 - times->sum_exec_runtime += t->se.sum_exec_runtime;
1110 + times->sum_exec_runtime += task_sched_runtime(t);
1111 } while_each_thread(tsk, t);
1112 out:
1113 rcu_read_unlock();
1114 @@ -312,7 +312,8 @@ static int cpu_clock_sample_group(const clockid_t which_clock,
1115 cpu->cpu = cputime.utime;
1116 break;
1117 case CPUCLOCK_SCHED:
1118 - cpu->sched = thread_group_sched_runtime(p);
1119 + thread_group_cputime(p, &cputime);
1120 + cpu->sched = cputime.sum_exec_runtime;
1121 break;
1122 }
1123 return 0;
1124 diff --git a/kernel/sched.c b/kernel/sched.c
1125 index 8b37360..063d7a4 100644
1126 --- a/kernel/sched.c
1127 +++ b/kernel/sched.c
1128 @@ -3713,30 +3713,6 @@ unsigned long long task_sched_runtime(struct task_struct *p)
1129 }
1130
1131 /*
1132 - * Return sum_exec_runtime for the thread group.
1133 - * In case the task is currently running, return the sum plus current's
1134 - * pending runtime that have not been accounted yet.
1135 - *
1136 - * Note that the thread group might have other running tasks as well,
1137 - * so the return value not includes other pending runtime that other
1138 - * running tasks might have.
1139 - */
1140 -unsigned long long thread_group_sched_runtime(struct task_struct *p)
1141 -{
1142 - struct task_cputime totals;
1143 - unsigned long flags;
1144 - struct rq *rq;
1145 - u64 ns;
1146 -
1147 - rq = task_rq_lock(p, &flags);
1148 - thread_group_cputime(p, &totals);
1149 - ns = totals.sum_exec_runtime + do_task_delta_exec(p, rq);
1150 - task_rq_unlock(rq, p, &flags);
1151 -
1152 - return ns;
1153 -}
1154 -
1155 -/*
1156 * Account user cpu time to a process.
1157 * @p: the process that the cpu time gets accounted to
1158 * @cputime: the cpu time spent in user space since the last update
1159 @@ -4335,7 +4311,7 @@ static inline void sched_submit_work(struct task_struct *tsk)
1160 blk_schedule_flush_plug(tsk);
1161 }
1162
1163 -asmlinkage void schedule(void)
1164 +asmlinkage void __sched schedule(void)
1165 {
1166 struct task_struct *tsk = current;
1167
1168 diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
1169 index 10d0182..17f2319 100644
1170 --- a/kernel/sched_rt.c
1171 +++ b/kernel/sched_rt.c
1172 @@ -1038,7 +1038,7 @@ select_task_rq_rt(struct task_struct *p, int sd_flag, int flags)
1173 */
1174 if (curr && unlikely(rt_task(curr)) &&
1175 (curr->rt.nr_cpus_allowed < 2 ||
1176 - curr->prio < p->prio) &&
1177 + curr->prio <= p->prio) &&
1178 (p->rt.nr_cpus_allowed > 1)) {
1179 int target = find_lowest_rq(p);
1180
1181 @@ -1569,7 +1569,7 @@ static void task_woken_rt(struct rq *rq, struct task_struct *p)
1182 p->rt.nr_cpus_allowed > 1 &&
1183 rt_task(rq->curr) &&
1184 (rq->curr->rt.nr_cpus_allowed < 2 ||
1185 - rq->curr->prio < p->prio))
1186 + rq->curr->prio <= p->prio))
1187 push_rt_tasks(rq);
1188 }
1189
1190 diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
1191 index 908038f..ef9271b 100644
1192 --- a/kernel/trace/ftrace.c
1193 +++ b/kernel/trace/ftrace.c
1194 @@ -1744,10 +1744,36 @@ static cycle_t ftrace_update_time;
1195 static unsigned long ftrace_update_cnt;
1196 unsigned long ftrace_update_tot_cnt;
1197
1198 +static int ops_traces_mod(struct ftrace_ops *ops)
1199 +{
1200 + struct ftrace_hash *hash;
1201 +
1202 + hash = ops->filter_hash;
1203 + return !!(!hash || !hash->count);
1204 +}
1205 +
1206 static int ftrace_update_code(struct module *mod)
1207 {
1208 struct dyn_ftrace *p;
1209 cycle_t start, stop;
1210 + unsigned long ref = 0;
1211 +
1212 + /*
1213 + * When adding a module, we need to check if tracers are
1214 + * currently enabled and if they are set to trace all functions.
1215 + * If they are, we need to enable the module functions as well
1216 + * as update the reference counts for those function records.
1217 + */
1218 + if (mod) {
1219 + struct ftrace_ops *ops;
1220 +
1221 + for (ops = ftrace_ops_list;
1222 + ops != &ftrace_list_end; ops = ops->next) {
1223 + if (ops->flags & FTRACE_OPS_FL_ENABLED &&
1224 + ops_traces_mod(ops))
1225 + ref++;
1226 + }
1227 + }
1228
1229 start = ftrace_now(raw_smp_processor_id());
1230 ftrace_update_cnt = 0;
1231 @@ -1760,7 +1786,7 @@ static int ftrace_update_code(struct module *mod)
1232
1233 p = ftrace_new_addrs;
1234 ftrace_new_addrs = p->newlist;
1235 - p->flags = 0L;
1236 + p->flags = ref;
1237
1238 /*
1239 * Do the initial record conversion from mcount jump
1240 @@ -1783,7 +1809,7 @@ static int ftrace_update_code(struct module *mod)
1241 * conversion puts the module to the correct state, thus
1242 * passing the ftrace_make_call check.
1243 */
1244 - if (ftrace_start_up) {
1245 + if (ftrace_start_up && ref) {
1246 int failed = __ftrace_replace_code(p, 1);
1247 if (failed) {
1248 ftrace_bug(failed, p->ip);
1249 @@ -2407,10 +2433,9 @@ ftrace_match_module_records(struct ftrace_hash *hash, char *buff, char *mod)
1250 */
1251
1252 static int
1253 -ftrace_mod_callback(char *func, char *cmd, char *param, int enable)
1254 +ftrace_mod_callback(struct ftrace_hash *hash,
1255 + char *func, char *cmd, char *param, int enable)
1256 {
1257 - struct ftrace_ops *ops = &global_ops;
1258 - struct ftrace_hash *hash;
1259 char *mod;
1260 int ret = -EINVAL;
1261
1262 @@ -2430,11 +2455,6 @@ ftrace_mod_callback(char *func, char *cmd, char *param, int enable)
1263 if (!strlen(mod))
1264 return ret;
1265
1266 - if (enable)
1267 - hash = ops->filter_hash;
1268 - else
1269 - hash = ops->notrace_hash;
1270 -
1271 ret = ftrace_match_module_records(hash, func, mod);
1272 if (!ret)
1273 ret = -EINVAL;
1274 @@ -2760,7 +2780,7 @@ static int ftrace_process_regex(struct ftrace_hash *hash,
1275 mutex_lock(&ftrace_cmd_mutex);
1276 list_for_each_entry(p, &ftrace_commands, list) {
1277 if (strcmp(p->name, command) == 0) {
1278 - ret = p->func(func, command, next, enable);
1279 + ret = p->func(hash, func, command, next, enable);
1280 goto out_unlock;
1281 }
1282 }
1283 diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c
1284 index 8d0e1cc..c7b0c6a 100644
1285 --- a/kernel/trace/trace_functions.c
1286 +++ b/kernel/trace/trace_functions.c
1287 @@ -324,7 +324,8 @@ ftrace_trace_onoff_unreg(char *glob, char *cmd, char *param)
1288 }
1289
1290 static int
1291 -ftrace_trace_onoff_callback(char *glob, char *cmd, char *param, int enable)
1292 +ftrace_trace_onoff_callback(struct ftrace_hash *hash,
1293 + char *glob, char *cmd, char *param, int enable)
1294 {
1295 struct ftrace_probe_ops *ops;
1296 void *count = (void *)-1;
1297 diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
1298 index 1661296..e17596b 100644
1299 --- a/net/ipv6/ip6_output.c
1300 +++ b/net/ipv6/ip6_output.c
1301 @@ -620,9 +620,9 @@ static u32 __ipv6_select_ident(const struct in6_addr *addr)
1302 return hash + newid;
1303 }
1304
1305 -void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt)
1306 +void ipv6_select_ident(struct frag_hdr *fhdr, struct in6_addr *addr)
1307 {
1308 - fhdr->identification = htonl(__ipv6_select_ident(&rt->rt6i_dst.addr));
1309 + fhdr->identification = htonl(__ipv6_select_ident(addr));
1310 }
1311
1312 int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
1313 @@ -709,7 +709,7 @@ int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
1314 skb_reset_network_header(skb);
1315 memcpy(skb_network_header(skb), tmp_hdr, hlen);
1316
1317 - ipv6_select_ident(fh, rt);
1318 + ipv6_select_ident(fh, &rt->rt6i_dst.addr);
1319 fh->nexthdr = nexthdr;
1320 fh->reserved = 0;
1321 fh->frag_off = htons(IP6_MF);
1322 @@ -855,7 +855,7 @@ slow_path:
1323 fh->nexthdr = nexthdr;
1324 fh->reserved = 0;
1325 if (!frag_id) {
1326 - ipv6_select_ident(fh, rt);
1327 + ipv6_select_ident(fh, &rt->rt6i_dst.addr);
1328 frag_id = fh->identification;
1329 } else
1330 fh->identification = frag_id;
1331 @@ -1146,7 +1146,7 @@ static inline int ip6_ufo_append_data(struct sock *sk,
1332 skb_shinfo(skb)->gso_size = (mtu - fragheaderlen -
1333 sizeof(struct frag_hdr)) & ~7;
1334 skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
1335 - ipv6_select_ident(&fhdr, rt);
1336 + ipv6_select_ident(&fhdr, &rt->rt6i_dst.addr);
1337 skb_shinfo(skb)->ip6_frag_id = fhdr.identification;
1338 __skb_queue_tail(&sk->sk_write_queue, skb);
1339
1340 diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
1341 index 29213b5..0d920c5 100644
1342 --- a/net/ipv6/udp.c
1343 +++ b/net/ipv6/udp.c
1344 @@ -1309,6 +1309,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, u32 features)
1345 u8 frag_hdr_sz = sizeof(struct frag_hdr);
1346 int offset;
1347 __wsum csum;
1348 + struct rt6_info *rt = (struct rt6_info *)skb_dst(skb);
1349
1350 mss = skb_shinfo(skb)->gso_size;
1351 if (unlikely(skb->len <= mss))
1352 @@ -1359,7 +1360,8 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, u32 features)
1353 fptr = (struct frag_hdr *)(skb_network_header(skb) + unfrag_ip6hlen);
1354 fptr->nexthdr = nexthdr;
1355 fptr->reserved = 0;
1356 - ipv6_select_ident(fptr, (struct rt6_info *)skb_dst(skb));
1357 + ipv6_select_ident(fptr,
1358 + rt ? &rt->rt6i_dst.addr : &ipv6_hdr(skb)->daddr);
1359
1360 /* Fragment the skb. ipv6 header and the remaining fields of the
1361 * fragment header are updated in ipv6_gso_segment()
1362 diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c
1363 index ffa2ffe..aa091a0 100644
1364 --- a/sound/soc/codecs/wm8753.c
1365 +++ b/sound/soc/codecs/wm8753.c
1366 @@ -1454,8 +1454,8 @@ static int wm8753_probe(struct snd_soc_codec *codec)
1367 /* set the update bits */
1368 snd_soc_update_bits(codec, WM8753_LDAC, 0x0100, 0x0100);
1369 snd_soc_update_bits(codec, WM8753_RDAC, 0x0100, 0x0100);
1370 - snd_soc_update_bits(codec, WM8753_LDAC, 0x0100, 0x0100);
1371 - snd_soc_update_bits(codec, WM8753_RDAC, 0x0100, 0x0100);
1372 + snd_soc_update_bits(codec, WM8753_LADC, 0x0100, 0x0100);
1373 + snd_soc_update_bits(codec, WM8753_RADC, 0x0100, 0x0100);
1374 snd_soc_update_bits(codec, WM8753_LOUT1V, 0x0100, 0x0100);
1375 snd_soc_update_bits(codec, WM8753_ROUT1V, 0x0100, 0x0100);
1376 snd_soc_update_bits(codec, WM8753_LOUT2V, 0x0100, 0x0100);
1377 diff --git a/sound/soc/pxa/zylonite.c b/sound/soc/pxa/zylonite.c
1378 index b644575..2b8350b 100644
1379 --- a/sound/soc/pxa/zylonite.c
1380 +++ b/sound/soc/pxa/zylonite.c
1381 @@ -196,20 +196,20 @@ static int zylonite_probe(struct snd_soc_card *card)
1382 if (clk_pout) {
1383 pout = clk_get(NULL, "CLK_POUT");
1384 if (IS_ERR(pout)) {
1385 - dev_err(&pdev->dev, "Unable to obtain CLK_POUT: %ld\n",
1386 + dev_err(card->dev, "Unable to obtain CLK_POUT: %ld\n",
1387 PTR_ERR(pout));
1388 return PTR_ERR(pout);
1389 }
1390
1391 ret = clk_enable(pout);
1392 if (ret != 0) {
1393 - dev_err(&pdev->dev, "Unable to enable CLK_POUT: %d\n",
1394 + dev_err(card->dev, "Unable to enable CLK_POUT: %d\n",
1395 ret);
1396 clk_put(pout);
1397 return ret;
1398 }
1399
1400 - dev_dbg(&pdev->dev, "MCLK enabled at %luHz\n",
1401 + dev_dbg(card->dev, "MCLK enabled at %luHz\n",
1402 clk_get_rate(pout));
1403 }
1404
1405 @@ -241,7 +241,7 @@ static int zylonite_resume_pre(struct snd_soc_card *card)
1406 if (clk_pout) {
1407 ret = clk_enable(pout);
1408 if (ret != 0)
1409 - dev_err(&pdev->dev, "Unable to enable CLK_POUT: %d\n",
1410 + dev_err(card->dev, "Unable to enable CLK_POUT: %d\n",
1411 ret);
1412 }
1413

  ViewVC Help
Powered by ViewVC 1.1.20