Magellan Linux

Annotation of /trunk/kernel-mcore/patches-3.0-r2/0106-3.0.7-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


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