Magellan Linux

Annotation of /trunk/kernel26-alx/patches-2.6.29-r1/0105-2.6.29.6-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 875 - (hide annotations) (download)
Tue Aug 4 20:59:11 2009 UTC (14 years, 9 months ago) by niro
File size: 43597 byte(s)
-2.6.29-alx-r1

1 niro 875 diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
2     index 7c878f6..ef6f390 100644
3     --- a/arch/x86/kernel/cpu/amd.c
4     +++ b/arch/x86/kernel/cpu/amd.c
5     @@ -207,13 +207,15 @@ static void __cpuinit amd_detect_cmp(struct cpuinfo_x86 *c)
6     {
7     #ifdef CONFIG_X86_HT
8     unsigned bits;
9     + int cpu = smp_processor_id();
10    
11     bits = c->x86_coreid_bits;
12     -
13     /* Low order bits define the core id (index of core in socket) */
14     c->cpu_core_id = c->initial_apicid & ((1 << bits)-1);
15     /* Convert the initial APIC ID into the socket ID */
16     c->phys_proc_id = c->initial_apicid >> bits;
17     + /* use socket ID also for last level cache */
18     + per_cpu(cpu_llc_id, cpu) = c->phys_proc_id;
19     #endif
20     }
21    
22     diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
23     index 4526b3a..ba763f2 100644
24     --- a/arch/x86/kernel/reboot.c
25     +++ b/arch/x86/kernel/reboot.c
26     @@ -193,6 +193,15 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
27     DMI_MATCH(DMI_BOARD_NAME, "0KP561"),
28     },
29     },
30     + { /* Handle problems with rebooting on Dell Optiplex 360 with 0T656F */
31     + .callback = set_bios_reboot,
32     + .ident = "Dell OptiPlex 360",
33     + .matches = {
34     + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
35     + DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 360"),
36     + DMI_MATCH(DMI_BOARD_NAME, "0T656F"),
37     + },
38     + },
39     { /* Handle problems with rebooting on Dell 2400's */
40     .callback = set_bios_reboot,
41     .ident = "Dell PowerEdge 2400",
42     diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
43     index 6a8811a..12f6802 100644
44     --- a/arch/x86/kernel/setup.c
45     +++ b/arch/x86/kernel/setup.c
46     @@ -255,15 +255,13 @@ static inline void copy_edd(void)
47    
48     #ifdef CONFIG_BLK_DEV_INITRD
49    
50     -#ifdef CONFIG_X86_32
51     -
52     #define MAX_MAP_CHUNK (NR_FIX_BTMAPS << PAGE_SHIFT)
53     static void __init relocate_initrd(void)
54     {
55    
56     u64 ramdisk_image = boot_params.hdr.ramdisk_image;
57     u64 ramdisk_size = boot_params.hdr.ramdisk_size;
58     - u64 end_of_lowmem = max_low_pfn << PAGE_SHIFT;
59     + u64 end_of_lowmem = max_low_pfn_mapped << PAGE_SHIFT;
60     u64 ramdisk_here;
61     unsigned long slop, clen, mapaddr;
62     char *p, *q;
63     @@ -319,14 +317,13 @@ static void __init relocate_initrd(void)
64     ramdisk_image, ramdisk_image + ramdisk_size - 1,
65     ramdisk_here, ramdisk_here + ramdisk_size - 1);
66     }
67     -#endif
68    
69     static void __init reserve_initrd(void)
70     {
71     u64 ramdisk_image = boot_params.hdr.ramdisk_image;
72     u64 ramdisk_size = boot_params.hdr.ramdisk_size;
73     u64 ramdisk_end = ramdisk_image + ramdisk_size;
74     - u64 end_of_lowmem = max_low_pfn << PAGE_SHIFT;
75     + u64 end_of_lowmem = max_low_pfn_mapped << PAGE_SHIFT;
76    
77     if (!boot_params.hdr.type_of_loader ||
78     !ramdisk_image || !ramdisk_size)
79     @@ -356,14 +353,8 @@ static void __init reserve_initrd(void)
80     return;
81     }
82    
83     -#ifdef CONFIG_X86_32
84     relocate_initrd();
85     -#else
86     - printk(KERN_ERR "initrd extends beyond end of memory "
87     - "(0x%08llx > 0x%08llx)\ndisabling initrd\n",
88     - ramdisk_end, end_of_lowmem);
89     - initrd_start = 0;
90     -#endif
91     +
92     free_early(ramdisk_image, ramdisk_end);
93     }
94     #else
95     diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
96     index 83d8ed3..7aa1264 100644
97     --- a/drivers/block/floppy.c
98     +++ b/drivers/block/floppy.c
99     @@ -177,6 +177,7 @@ static int print_unex = 1;
100     #include <linux/interrupt.h>
101     #include <linux/init.h>
102     #include <linux/platform_device.h>
103     +#include <linux/mod_devicetable.h>
104     #include <linux/buffer_head.h> /* for invalidate_buffers() */
105     #include <linux/mutex.h>
106    
107     @@ -4598,6 +4599,13 @@ MODULE_AUTHOR("Alain L. Knaff");
108     MODULE_SUPPORTED_DEVICE("fd");
109     MODULE_LICENSE("GPL");
110    
111     +/* This doesn't actually get used other than for module information */
112     +static const struct pnp_device_id floppy_pnpids[] = {
113     + { "PNP0700", 0 },
114     + { }
115     +};
116     +MODULE_DEVICE_TABLE(pnp, floppy_pnpids);
117     +
118     #else
119    
120     __setup("floppy=", floppy_setup);
121     diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c
122     index 8b0da97..7df96f9 100644
123     --- a/drivers/char/moxa.c
124     +++ b/drivers/char/moxa.c
125     @@ -1184,6 +1184,11 @@ static int moxa_open(struct tty_struct *tty, struct file *filp)
126     return -ENODEV;
127     }
128    
129     + if (port % MAX_PORTS_PER_BOARD >= brd->numPorts) {
130     + retval = -ENODEV;
131     + goto out_unlock;
132     + }
133     +
134     ch = &brd->ports[port % MAX_PORTS_PER_BOARD];
135     ch->port.count++;
136     tty->driver_data = ch;
137     @@ -1208,8 +1213,8 @@ static int moxa_open(struct tty_struct *tty, struct file *filp)
138     moxa_close_port(tty);
139     } else
140     ch->port.flags |= ASYNC_NORMAL_ACTIVE;
141     +out_unlock:
142     mutex_unlock(&moxa_openlock);
143     -
144     return retval;
145     }
146    
147     diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
148     index 402c9f2..ac572a9 100644
149     --- a/drivers/char/mxser.c
150     +++ b/drivers/char/mxser.c
151     @@ -2712,7 +2712,7 @@ static int __init mxser_module_init(void)
152     continue;
153    
154     brd = &mxser_boards[m];
155     - retval = mxser_get_ISA_conf(!ioaddr[b], brd);
156     + retval = mxser_get_ISA_conf(ioaddr[b], brd);
157     if (retval <= 0) {
158     brd->info = NULL;
159     continue;
160     diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c
161     index dbb9125..881934c 100644
162     --- a/drivers/char/pcmcia/cm4000_cs.c
163     +++ b/drivers/char/pcmcia/cm4000_cs.c
164     @@ -1575,7 +1575,8 @@ static long cmm_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
165     clear_bit(LOCK_IO, &dev->flags);
166     wake_up_interruptible(&dev->ioq);
167    
168     - return 0;
169     + rc = 0;
170     + break;
171     case CM_IOCSPTS:
172     {
173     struct ptsreq krnptsreq;
174     diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
175     index a2dee0e..82d2449 100644
176     --- a/drivers/char/vt_ioctl.c
177     +++ b/drivers/char/vt_ioctl.c
178     @@ -396,7 +396,8 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
179     kbd = kbd_table + console;
180     switch (cmd) {
181     case TIOCLINUX:
182     - return tioclinux(tty, arg);
183     + ret = tioclinux(tty, arg);
184     + break;
185     case KIOCSOUND:
186     if (!perm)
187     goto eperm;
188     diff --git a/drivers/firmware/memmap.c b/drivers/firmware/memmap.c
189     index 05aa2d4..d5ea8a6 100644
190     --- a/drivers/firmware/memmap.c
191     +++ b/drivers/firmware/memmap.c
192     @@ -31,8 +31,12 @@
193     * information is necessary as for the resource tree.
194     */
195     struct firmware_map_entry {
196     - resource_size_t start; /* start of the memory range */
197     - resource_size_t end; /* end of the memory range (incl.) */
198     + /*
199     + * start and end must be u64 rather than resource_size_t, because e820
200     + * resources can lie at addresses above 4G.
201     + */
202     + u64 start; /* start of the memory range */
203     + u64 end; /* end of the memory range (incl.) */
204     const char *type; /* type of the memory range */
205     struct list_head list; /* entry for the linked list */
206     struct kobject kobj; /* kobject for each entry */
207     @@ -101,7 +105,7 @@ static LIST_HEAD(map_entries);
208     * Common implementation of firmware_map_add() and firmware_map_add_early()
209     * which expects a pre-allocated struct firmware_map_entry.
210     **/
211     -static int firmware_map_add_entry(resource_size_t start, resource_size_t end,
212     +static int firmware_map_add_entry(u64 start, u64 end,
213     const char *type,
214     struct firmware_map_entry *entry)
215     {
216     @@ -132,8 +136,7 @@ static int firmware_map_add_entry(resource_size_t start, resource_size_t end,
217     *
218     * Returns 0 on success, or -ENOMEM if no memory could be allocated.
219     **/
220     -int firmware_map_add(resource_size_t start, resource_size_t end,
221     - const char *type)
222     +int firmware_map_add(u64 start, u64 end, const char *type)
223     {
224     struct firmware_map_entry *entry;
225    
226     @@ -157,8 +160,7 @@ int firmware_map_add(resource_size_t start, resource_size_t end,
227     *
228     * Returns 0 on success, or -ENOMEM if no memory could be allocated.
229     **/
230     -int __init firmware_map_add_early(resource_size_t start, resource_size_t end,
231     - const char *type)
232     +int __init firmware_map_add_early(u64 start, u64 end, const char *type)
233     {
234     struct firmware_map_entry *entry;
235    
236     diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
237     index a91cb4c..1406c46 100644
238     --- a/drivers/infiniband/hw/mlx4/qp.c
239     +++ b/drivers/infiniband/hw/mlx4/qp.c
240     @@ -1585,12 +1585,16 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
241     break;
242    
243     case IB_WR_LOCAL_INV:
244     + ctrl->srcrb_flags |=
245     + cpu_to_be32(MLX4_WQE_CTRL_STRONG_ORDER);
246     set_local_inv_seg(wqe, wr->ex.invalidate_rkey);
247     wqe += sizeof (struct mlx4_wqe_local_inval_seg);
248     size += sizeof (struct mlx4_wqe_local_inval_seg) / 16;
249     break;
250    
251     case IB_WR_FAST_REG_MR:
252     + ctrl->srcrb_flags |=
253     + cpu_to_be32(MLX4_WQE_CTRL_STRONG_ORDER);
254     set_fmr_seg(wqe, wr);
255     wqe += sizeof (struct mlx4_wqe_fmr_seg);
256     size += sizeof (struct mlx4_wqe_fmr_seg) / 16;
257     diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
258     index 45470f1..df3f8aa 100644
259     --- a/drivers/input/keyboard/atkbd.c
260     +++ b/drivers/input/keyboard/atkbd.c
261     @@ -229,7 +229,8 @@ struct atkbd {
262     /*
263     * System-specific ketymap fixup routine
264     */
265     -static void (*atkbd_platform_fixup)(struct atkbd *);
266     +static void (*atkbd_platform_fixup)(struct atkbd *, const void *data);
267     +static void *atkbd_platform_fixup_data;
268    
269     static ssize_t atkbd_attr_show_helper(struct device *dev, char *buf,
270     ssize_t (*handler)(struct atkbd *, char *));
271     @@ -834,87 +835,71 @@ static void atkbd_disconnect(struct serio *serio)
272     }
273    
274     /*
275     - * Most special keys (Fn+F?) on Dell laptops do not generate release
276     - * events so we have to do it ourselves.
277     + * generate release events for the keycodes given in data
278     */
279     -static void atkbd_dell_laptop_keymap_fixup(struct atkbd *atkbd)
280     +static void atkbd_apply_forced_release_keylist(struct atkbd* atkbd,
281     + const void *data)
282     {
283     - static const unsigned int forced_release_keys[] = {
284     - 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8f, 0x93,
285     - };
286     - int i;
287     + const unsigned int *keys = data;
288     + unsigned int i;
289    
290     if (atkbd->set == 2)
291     - for (i = 0; i < ARRAY_SIZE(forced_release_keys); i++)
292     - __set_bit(forced_release_keys[i],
293     - atkbd->force_release_mask);
294     + for (i = 0; keys[i] != -1U; i++)
295     + __set_bit(keys[i], atkbd->force_release_mask);
296     }
297    
298     /*
299     + * Most special keys (Fn+F?) on Dell laptops do not generate release
300     + * events so we have to do it ourselves.
301     + */
302     +static unsigned int atkbd_dell_laptop_forced_release_keys[] = {
303     + 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8f, 0x93, -1U
304     +};
305     +
306     +/*
307     * Perform fixup for HP system that doesn't generate release
308     * for its video switch
309     */
310     -static void atkbd_hp_keymap_fixup(struct atkbd *atkbd)
311     -{
312     - static const unsigned int forced_release_keys[] = {
313     - 0x94,
314     - };
315     - int i;
316     -
317     - if (atkbd->set == 2)
318     - for (i = 0; i < ARRAY_SIZE(forced_release_keys); i++)
319     - __set_bit(forced_release_keys[i],
320     - atkbd->force_release_mask);
321     -}
322     +static unsigned int atkbd_hp_forced_release_keys[] = {
323     + 0x94, -1U
324     +};
325    
326     /*
327     * Inventec system with broken key release on volume keys
328     */
329     -static void atkbd_inventec_keymap_fixup(struct atkbd *atkbd)
330     -{
331     - const unsigned int forced_release_keys[] = {
332     - 0xae, 0xb0,
333     - };
334     - int i;
335     -
336     - if (atkbd->set == 2)
337     - for (i = 0; i < ARRAY_SIZE(forced_release_keys); i++)
338     - __set_bit(forced_release_keys[i],
339     - atkbd->force_release_mask);
340     -}
341     +static unsigned int atkbd_inventec_forced_release_keys[] = {
342     + 0xae, 0xb0, -1U
343     +};
344    
345     /*
346     * Perform fixup for HP Pavilion ZV6100 laptop that doesn't generate release
347     * for its volume buttons
348     */
349     -static void atkbd_hp_zv6100_keymap_fixup(struct atkbd *atkbd)
350     -{
351     - const unsigned int forced_release_keys[] = {
352     - 0xae, 0xb0,
353     - };
354     - int i;
355     +static unsigned int atkbd_hp_zv6100_forced_release_keys[] = {
356     + 0xae, 0xb0, -1U
357     +};
358    
359     - if (atkbd->set == 2)
360     - for (i = 0; i < ARRAY_SIZE(forced_release_keys); i++)
361     - __set_bit(forced_release_keys[i],
362     - atkbd->force_release_mask);
363     -}
364     +/*
365     + * Samsung NC10,NC20 with Fn+F? key release not working
366     + */
367     +static unsigned int atkbd_samsung_forced_release_keys[] = {
368     + 0x82, 0x83, 0x84, 0x86, 0x88, 0x89, 0xb3, 0xf7, 0xf9, -1U
369     +};
370    
371     /*
372     - * Samsung NC10 with Fn+F? key release not working
373     + * The volume up and volume down special keys on a Fujitsu Amilo PA 1510 laptop
374     + * do not generate release events so we have to do it ourselves.
375     */
376     -static void atkbd_samsung_keymap_fixup(struct atkbd *atkbd)
377     -{
378     - const unsigned int forced_release_keys[] = {
379     - 0x82, 0x83, 0x84, 0x86, 0x88, 0x89, 0xb3, 0xf7, 0xf9,
380     - };
381     - int i;
382     +static unsigned int atkbd_amilo_pa1510_forced_release_keys[] = {
383     + 0xb0, 0xae, -1U
384     +};
385    
386     - if (atkbd->set == 2)
387     - for (i = 0; i < ARRAY_SIZE(forced_release_keys); i++)
388     - __set_bit(forced_release_keys[i],
389     - atkbd->force_release_mask);
390     -}
391     +/*
392     + * Amilo Xi 3650 key release for light touch bar not working
393     + */
394     +static unsigned int atkbd_amilo_xi3650_forced_release_keys[] = {
395     + 0x67, 0xed, 0x90, 0xa2, 0x99, 0xa4, 0xae, 0xb0, -1U
396     +};
397    
398     /*
399     * atkbd_set_keycode_table() initializes keyboard's keycode table
400     @@ -967,7 +952,7 @@ static void atkbd_set_keycode_table(struct atkbd *atkbd)
401     * Perform additional fixups
402     */
403     if (atkbd_platform_fixup)
404     - atkbd_platform_fixup(atkbd);
405     + atkbd_platform_fixup(atkbd, atkbd_platform_fixup_data);
406     }
407    
408     /*
409     @@ -1492,9 +1477,11 @@ static ssize_t atkbd_show_err_count(struct atkbd *atkbd, char *buf)
410     return sprintf(buf, "%lu\n", atkbd->err_count);
411     }
412    
413     -static int __init atkbd_setup_fixup(const struct dmi_system_id *id)
414     +static int __init atkbd_setup_forced_release(const struct dmi_system_id *id)
415     {
416     - atkbd_platform_fixup = id->driver_data;
417     + atkbd_platform_fixup = atkbd_apply_forced_release_keylist;
418     + atkbd_platform_fixup_data = id->driver_data;
419     +
420     return 0;
421     }
422    
423     @@ -1505,8 +1492,8 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = {
424     DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
425     DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
426     },
427     - .callback = atkbd_setup_fixup,
428     - .driver_data = atkbd_dell_laptop_keymap_fixup,
429     + .callback = atkbd_setup_forced_release,
430     + .driver_data = atkbd_dell_laptop_forced_release_keys,
431     },
432     {
433     .ident = "Dell Laptop",
434     @@ -1514,8 +1501,8 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = {
435     DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
436     DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
437     },
438     - .callback = atkbd_setup_fixup,
439     - .driver_data = atkbd_dell_laptop_keymap_fixup,
440     + .callback = atkbd_setup_forced_release,
441     + .driver_data = atkbd_dell_laptop_forced_release_keys,
442     },
443     {
444     .ident = "HP 2133",
445     @@ -1523,8 +1510,8 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = {
446     DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
447     DMI_MATCH(DMI_PRODUCT_NAME, "HP 2133"),
448     },
449     - .callback = atkbd_setup_fixup,
450     - .driver_data = atkbd_hp_keymap_fixup,
451     + .callback = atkbd_setup_forced_release,
452     + .driver_data = atkbd_hp_forced_release_keys,
453     },
454     {
455     .ident = "HP Pavilion ZV6100",
456     @@ -1532,8 +1519,8 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = {
457     DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
458     DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion ZV6100"),
459     },
460     - .callback = atkbd_setup_fixup,
461     - .driver_data = atkbd_hp_zv6100_keymap_fixup,
462     + .callback = atkbd_setup_forced_release,
463     + .driver_data = atkbd_hp_zv6100_forced_release_keys,
464     },
465     {
466     .ident = "Inventec Symphony",
467     @@ -1541,8 +1528,8 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = {
468     DMI_MATCH(DMI_SYS_VENDOR, "INVENTEC"),
469     DMI_MATCH(DMI_PRODUCT_NAME, "SYMPHONY 6.0/7.0"),
470     },
471     - .callback = atkbd_setup_fixup,
472     - .driver_data = atkbd_inventec_keymap_fixup,
473     + .callback = atkbd_setup_forced_release,
474     + .driver_data = atkbd_inventec_forced_release_keys,
475     },
476     {
477     .ident = "Samsung NC10",
478     @@ -1550,8 +1537,44 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = {
479     DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
480     DMI_MATCH(DMI_PRODUCT_NAME, "NC10"),
481     },
482     - .callback = atkbd_setup_fixup,
483     - .driver_data = atkbd_samsung_keymap_fixup,
484     + .callback = atkbd_setup_forced_release,
485     + .driver_data = atkbd_samsung_forced_release_keys,
486     + },
487     + {
488     + .ident = "Samsung NC20",
489     + .matches = {
490     + DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
491     + DMI_MATCH(DMI_PRODUCT_NAME, "NC20"),
492     + },
493     + .callback = atkbd_setup_forced_release,
494     + .driver_data = atkbd_samsung_forced_release_keys,
495     + },
496     + {
497     + .ident = "Samsung SQ45S70S",
498     + .matches = {
499     + DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
500     + DMI_MATCH(DMI_PRODUCT_NAME, "SQ45S70S"),
501     + },
502     + .callback = atkbd_setup_forced_release,
503     + .driver_data = atkbd_samsung_forced_release_keys,
504     + },
505     + {
506     + .ident = "Fujitsu Amilo PA 1510",
507     + .matches = {
508     + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
509     + DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pa 1510"),
510     + },
511     + .callback = atkbd_setup_forced_release,
512     + .driver_data = atkbd_amilo_pa1510_forced_release_keys,
513     + },
514     + {
515     + .ident = "Fujitsu Amilo Xi 3650",
516     + .matches = {
517     + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
518     + DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Xi 3650"),
519     + },
520     + .callback = atkbd_setup_forced_release,
521     + .driver_data = atkbd_amilo_xi3650_forced_release_keys,
522     },
523     { }
524     };
525     diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c
526     index f126566..3d337d9 100644
527     --- a/drivers/isdn/hisax/hfc_pci.c
528     +++ b/drivers/isdn/hisax/hfc_pci.c
529     @@ -82,8 +82,9 @@ release_io_hfcpci(struct IsdnCardState *cs)
530     Write_hfc(cs, HFCPCI_INT_M2, cs->hw.hfcpci.int_m2);
531     pci_write_config_word(cs->hw.hfcpci.dev, PCI_COMMAND, 0); /* disable memory mapped ports + busmaster */
532     del_timer(&cs->hw.hfcpci.timer);
533     - kfree(cs->hw.hfcpci.share_start);
534     - cs->hw.hfcpci.share_start = NULL;
535     + pci_free_consistent(cs->hw.hfcpci.dev, 0x8000,
536     + cs->hw.hfcpci.fifos, cs->hw.hfcpci.dma);
537     + cs->hw.hfcpci.fifos = NULL;
538     iounmap((void *)cs->hw.hfcpci.pci_io);
539     }
540    
541     @@ -1663,8 +1664,19 @@ setup_hfcpci(struct IsdnCard *card)
542     dev_hfcpci);
543     i++;
544     if (tmp_hfcpci) {
545     + dma_addr_t dma_mask = DMA_BIT_MASK(32) & ~0x7fffUL;
546     if (pci_enable_device(tmp_hfcpci))
547     continue;
548     + if (pci_set_dma_mask(tmp_hfcpci, dma_mask)) {
549     + printk(KERN_WARNING
550     + "HiSax hfc_pci: No suitable DMA available.\n");
551     + continue;
552     + }
553     + if (pci_set_consistent_dma_mask(tmp_hfcpci, dma_mask)) {
554     + printk(KERN_WARNING
555     + "HiSax hfc_pci: No suitable consistent DMA available.\n");
556     + continue;
557     + }
558     pci_set_master(tmp_hfcpci);
559     if ((card->para[0]) && (card->para[0] != (tmp_hfcpci->resource[ 0].start & PCI_BASE_ADDRESS_IO_MASK)))
560     continue;
561     @@ -1693,22 +1705,29 @@ setup_hfcpci(struct IsdnCard *card)
562     printk(KERN_WARNING "HFC-PCI: No IO-Mem for PCI card found\n");
563     return (0);
564     }
565     +
566     /* Allocate memory for FIFOS */
567     - /* Because the HFC-PCI needs a 32K physical alignment, we */
568     - /* need to allocate the double mem and align the address */
569     - if (!(cs->hw.hfcpci.share_start = kmalloc(65536, GFP_KERNEL))) {
570     - printk(KERN_WARNING "HFC-PCI: Error allocating memory for FIFO!\n");
571     + cs->hw.hfcpci.fifos = pci_alloc_consistent(cs->hw.hfcpci.dev,
572     + 0x8000, &cs->hw.hfcpci.dma);
573     + if (!cs->hw.hfcpci.fifos) {
574     + printk(KERN_WARNING "HFC-PCI: Error allocating FIFO memory!\n");
575     + return 0;
576     + }
577     + if (cs->hw.hfcpci.dma & 0x7fff) {
578     + printk(KERN_WARNING
579     + "HFC-PCI: Error DMA memory not on 32K boundary (%lx)\n",
580     + (u_long)cs->hw.hfcpci.dma);
581     + pci_free_consistent(cs->hw.hfcpci.dev, 0x8000,
582     + cs->hw.hfcpci.fifos, cs->hw.hfcpci.dma);
583     return 0;
584     }
585     - cs->hw.hfcpci.fifos = (void *)
586     - (((ulong) cs->hw.hfcpci.share_start) & ~0x7FFF) + 0x8000;
587     - pci_write_config_dword(cs->hw.hfcpci.dev, 0x80, (u_int) virt_to_bus(cs->hw.hfcpci.fifos));
588     + pci_write_config_dword(cs->hw.hfcpci.dev, 0x80, (u32)cs->hw.hfcpci.dma);
589     cs->hw.hfcpci.pci_io = ioremap((ulong) cs->hw.hfcpci.pci_io, 256);
590     printk(KERN_INFO
591     - "HFC-PCI: defined at mem %p fifo %p(%#x) IRQ %d HZ %d\n",
592     + "HFC-PCI: defined at mem %p fifo %p(%lx) IRQ %d HZ %d\n",
593     cs->hw.hfcpci.pci_io,
594     cs->hw.hfcpci.fifos,
595     - (u_int) virt_to_bus(cs->hw.hfcpci.fifos),
596     + (u_long)cs->hw.hfcpci.dma,
597     cs->irq, HZ);
598    
599     spin_lock_irqsave(&cs->lock, flags);
600     diff --git a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h
601     index e8d429f..f1a828b 100644
602     --- a/drivers/isdn/hisax/hisax.h
603     +++ b/drivers/isdn/hisax/hisax.h
604     @@ -694,7 +694,7 @@ struct hfcPCI_hw {
605     int nt_timer;
606     struct pci_dev *dev;
607     unsigned char *pci_io; /* start of PCI IO memory */
608     - void *share_start; /* shared memory for Fifos start */
609     + dma_addr_t dma; /* dma handle for Fifos */
610     void *fifos; /* FIFO memory */
611     int last_bfifo_cnt[2]; /* marker saving last b-fifo frame count */
612     struct timer_list timer;
613     diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
614     index 095f77b..774cc49 100644
615     --- a/drivers/md/dm-mpath.c
616     +++ b/drivers/md/dm-mpath.c
617     @@ -554,6 +554,12 @@ static int parse_path_selector(struct arg_set *as, struct priority_group *pg,
618     return -EINVAL;
619     }
620    
621     + if (ps_argc > as->argc) {
622     + dm_put_path_selector(pst);
623     + ti->error = "not enough arguments for path selector";
624     + return -EINVAL;
625     + }
626     +
627     r = pst->create(&pg->ps, ps_argc, as->argv);
628     if (r) {
629     dm_put_path_selector(pst);
630     @@ -700,6 +706,11 @@ static int parse_hw_handler(struct arg_set *as, struct multipath *m)
631     if (!hw_argc)
632     return 0;
633    
634     + if (hw_argc > as->argc) {
635     + ti->error = "not enough arguments for hardware handler";
636     + return -EINVAL;
637     + }
638     +
639     m->hw_handler_name = kstrdup(shift(as), GFP_KERNEL);
640     request_module("scsi_dh_%s", m->hw_handler_name);
641     if (scsi_dh_handler_exist(m->hw_handler_name) == 0) {
642     diff --git a/drivers/md/dm.c b/drivers/md/dm.c
643     index 8d40f27..377bb6e 100644
644     --- a/drivers/md/dm.c
645     +++ b/drivers/md/dm.c
646     @@ -1728,6 +1728,10 @@ struct mapped_device *dm_get_from_kobject(struct kobject *kobj)
647     if (&md->kobj != kobj)
648     return NULL;
649    
650     + if (test_bit(DMF_FREEING, &md->flags) ||
651     + test_bit(DMF_DELETING, &md->flags))
652     + return NULL;
653     +
654     dm_get(md);
655     return md;
656     }
657     diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
658     index a5ba080..b437eb6 100644
659     --- a/drivers/md/raid5.c
660     +++ b/drivers/md/raid5.c
661     @@ -3465,6 +3465,7 @@ static int make_request(struct request_queue *q, struct bio * bi)
662     spin_unlock_irq(&conf->device_lock);
663     if (must_retry) {
664     release_stripe(sh);
665     + schedule();
666     goto retry;
667     }
668     }
669     diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
670     index d287315..cd95093 100644
671     --- a/drivers/net/bonding/bond_sysfs.c
672     +++ b/drivers/net/bonding/bond_sysfs.c
673     @@ -1538,6 +1538,7 @@ int bond_create_sysfs(void)
674     printk(KERN_ERR
675     "network device named %s already exists in sysfs",
676     class_attr_bonding_masters.attr.name);
677     + ret = 0;
678     }
679    
680     return ret;
681     diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
682     index 0b8ec7f..7dc288e 100644
683     --- a/drivers/net/r8169.c
684     +++ b/drivers/net/r8169.c
685     @@ -66,7 +66,6 @@ static const int multicast_filter_limit = 32;
686     #define RX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */
687     #define TX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */
688     #define EarlyTxThld 0x3F /* 0x3F means NO early transmit */
689     -#define RxPacketMaxSize 0x3FE8 /* 16K - 1 - ETH_HLEN - VLAN - CRC... */
690     #define SafeMtu 0x1c20 /* ... actually life sucks beyond ~7k */
691     #define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */
692    
693     @@ -2357,10 +2356,10 @@ static u16 rtl_rw_cpluscmd(void __iomem *ioaddr)
694     return cmd;
695     }
696    
697     -static void rtl_set_rx_max_size(void __iomem *ioaddr)
698     +static void rtl_set_rx_max_size(void __iomem *ioaddr, unsigned int rx_buf_sz)
699     {
700     /* Low hurts. Let's disable the filtering. */
701     - RTL_W16(RxMaxSize, 16383);
702     + RTL_W16(RxMaxSize, rx_buf_sz);
703     }
704    
705     static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version)
706     @@ -2407,7 +2406,7 @@ static void rtl_hw_start_8169(struct net_device *dev)
707    
708     RTL_W8(EarlyTxThres, EarlyTxThld);
709    
710     - rtl_set_rx_max_size(ioaddr);
711     + rtl_set_rx_max_size(ioaddr, tp->rx_buf_sz);
712    
713     if ((tp->mac_version == RTL_GIGA_MAC_VER_01) ||
714     (tp->mac_version == RTL_GIGA_MAC_VER_02) ||
715     @@ -2668,7 +2667,7 @@ static void rtl_hw_start_8168(struct net_device *dev)
716    
717     RTL_W8(EarlyTxThres, EarlyTxThld);
718    
719     - rtl_set_rx_max_size(ioaddr);
720     + rtl_set_rx_max_size(ioaddr, tp->rx_buf_sz);
721    
722     tp->cp_cmd |= RTL_R16(CPlusCmd) | PktCntrDisable | INTT_1;
723    
724     @@ -2846,7 +2845,7 @@ static void rtl_hw_start_8101(struct net_device *dev)
725    
726     RTL_W8(EarlyTxThres, EarlyTxThld);
727    
728     - rtl_set_rx_max_size(ioaddr);
729     + rtl_set_rx_max_size(ioaddr, tp->rx_buf_sz);
730    
731     tp->cp_cmd |= rtl_rw_cpluscmd(ioaddr) | PCIMulRW;
732    
733     diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
734     index 96f3bdf..b31320c 100644
735     --- a/drivers/parport/parport_pc.c
736     +++ b/drivers/parport/parport_pc.c
737     @@ -1413,11 +1413,13 @@ static void __devinit decode_smsc(int efer, int key, int devid, int devrev)
738    
739     static void __devinit winbond_check(int io, int key)
740     {
741     - int devid,devrev,oldid,x_devid,x_devrev,x_oldid;
742     + int origval, devid, devrev, oldid, x_devid, x_devrev, x_oldid;
743    
744     if (!request_region(io, 3, __func__))
745     return;
746    
747     + origval = inb(io); /* Save original value */
748     +
749     /* First probe without key */
750     outb(0x20,io);
751     x_devid=inb(io+1);
752     @@ -1437,6 +1439,8 @@ static void __devinit winbond_check(int io, int key)
753     oldid=inb(io+1);
754     outb(0xaa,io); /* Magic Seal */
755    
756     + outb(origval, io); /* in case we poked some entirely different hardware */
757     +
758     if ((x_devid == devid) && (x_devrev == devrev) && (x_oldid == oldid))
759     goto out; /* protection against false positives */
760    
761     @@ -1447,11 +1451,15 @@ out:
762    
763     static void __devinit winbond_check2(int io,int key)
764     {
765     - int devid,devrev,oldid,x_devid,x_devrev,x_oldid;
766     + int origval[3], devid, devrev, oldid, x_devid, x_devrev, x_oldid;
767    
768     if (!request_region(io, 3, __func__))
769     return;
770    
771     + origval[0] = inb(io); /* Save original values */
772     + origval[1] = inb(io + 1);
773     + origval[2] = inb(io + 2);
774     +
775     /* First probe without the key */
776     outb(0x20,io+2);
777     x_devid=inb(io+2);
778     @@ -1470,6 +1478,10 @@ static void __devinit winbond_check2(int io,int key)
779     oldid=inb(io+2);
780     outb(0xaa,io); /* Magic Seal */
781    
782     + outb(origval[0], io); /* in case we poked some entirely different hardware */
783     + outb(origval[1], io + 1);
784     + outb(origval[2], io + 2);
785     +
786     if ((x_devid == devid) && (x_devrev == devrev) && (x_oldid == oldid))
787     goto out; /* protection against false positives */
788    
789     @@ -1480,11 +1492,13 @@ out:
790    
791     static void __devinit smsc_check(int io, int key)
792     {
793     - int id,rev,oldid,oldrev,x_id,x_rev,x_oldid,x_oldrev;
794     + int origval, id, rev, oldid, oldrev, x_id, x_rev, x_oldid, x_oldrev;
795    
796     if (!request_region(io, 3, __func__))
797     return;
798    
799     + origval = inb(io); /* Save original value */
800     +
801     /* First probe without the key */
802     outb(0x0d,io);
803     x_oldid=inb(io+1);
804     @@ -1508,6 +1522,8 @@ static void __devinit smsc_check(int io, int key)
805     rev=inb(io+1);
806     outb(0xaa,io); /* Magic Seal */
807    
808     + outb(origval, io); /* in case we poked some entirely different hardware */
809     +
810     if ((x_id == id) && (x_oldrev == oldrev) &&
811     (x_oldid == oldid) && (x_rev == rev))
812     goto out; /* protection against false positives */
813     @@ -1544,11 +1560,12 @@ static void __devinit detect_and_report_smsc (void)
814     static void __devinit detect_and_report_it87(void)
815     {
816     u16 dev;
817     - u8 r;
818     + u8 origval, r;
819     if (verbose_probing)
820     printk(KERN_DEBUG "IT8705 Super-IO detection, now testing port 2E ...\n");
821     - if (!request_region(0x2e, 1, __func__))
822     + if (!request_region(0x2e, 2, __func__))
823     return;
824     + origval = inb(0x2e); /* Save original value */
825     outb(0x87, 0x2e);
826     outb(0x01, 0x2e);
827     outb(0x55, 0x2e);
828     @@ -1568,8 +1585,10 @@ static void __devinit detect_and_report_it87(void)
829     outb(r | 8, 0x2F);
830     outb(0x02, 0x2E); /* Lock */
831     outb(0x02, 0x2F);
832     + } else {
833     + outb(origval, 0x2e); /* Oops, sorry to disturb */
834     }
835     - release_region(0x2e, 1);
836     + release_region(0x2e, 2);
837     }
838     #endif /* CONFIG_PARPORT_PC_SUPERIO */
839    
840     @@ -2192,6 +2211,9 @@ struct parport *parport_pc_probe_port (unsigned long int base,
841     if (IS_ERR(pdev))
842     return NULL;
843     dev = &pdev->dev;
844     +
845     + dev->coherent_dma_mask = DMA_BIT_MASK(24);
846     + dev->dma_mask = &dev->coherent_dma_mask;
847     }
848    
849     ops = kmalloc(sizeof (struct parport_operations), GFP_KERNEL);
850     diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c
851     index 032db81..f349211 100644
852     --- a/drivers/parport/parport_serial.c
853     +++ b/drivers/parport/parport_serial.c
854     @@ -30,6 +30,7 @@ enum parport_pc_pci_cards {
855     titan_210l,
856     netmos_9xx5_combo,
857     netmos_9855,
858     + netmos_9855_2p,
859     avlab_1s1p,
860     avlab_1s2p,
861     avlab_2s1p,
862     @@ -62,7 +63,7 @@ struct parport_pc_pci {
863     struct parport_pc_pci *card, int failed);
864     };
865    
866     -static int __devinit netmos_parallel_init(struct pci_dev *dev, struct parport_pc_pci *card, int autoirq, int autodma)
867     +static int __devinit netmos_parallel_init(struct pci_dev *dev, struct parport_pc_pci *par, int autoirq, int autodma)
868     {
869     /* the rule described below doesn't hold for this device */
870     if (dev->device == PCI_DEVICE_ID_NETMOS_9835 &&
871     @@ -74,9 +75,17 @@ static int __devinit netmos_parallel_init(struct pci_dev *dev, struct parport_pc
872     * and serial ports. The form is 0x00PS, where <P> is the number of
873     * parallel ports and <S> is the number of serial ports.
874     */
875     - card->numports = (dev->subsystem_device & 0xf0) >> 4;
876     - if (card->numports > ARRAY_SIZE(card->addr))
877     - card->numports = ARRAY_SIZE(card->addr);
878     + par->numports = (dev->subsystem_device & 0xf0) >> 4;
879     + if (par->numports > ARRAY_SIZE(par->addr))
880     + par->numports = ARRAY_SIZE(par->addr);
881     + /*
882     + * This function is currently only called for cards with up to
883     + * one parallel port.
884     + * Parallel port BAR is either before or after serial ports BARS;
885     + * hence, lo should be either 0 or equal to the number of serial ports.
886     + */
887     + if (par->addr[0].lo != 0)
888     + par->addr[0].lo = dev->subsystem_device & 0xf;
889     return 0;
890     }
891    
892     @@ -84,7 +93,8 @@ static struct parport_pc_pci cards[] __devinitdata = {
893     /* titan_110l */ { 1, { { 3, -1 }, } },
894     /* titan_210l */ { 1, { { 3, -1 }, } },
895     /* netmos_9xx5_combo */ { 1, { { 2, -1 }, }, netmos_parallel_init },
896     - /* netmos_9855 */ { 1, { { 2, -1 }, }, netmos_parallel_init },
897     + /* netmos_9855 */ { 1, { { 0, -1 }, }, netmos_parallel_init },
898     + /* netmos_9855_2p */ { 2, { { 0, -1 }, { 2, -1 }, } },
899     /* avlab_1s1p */ { 1, { { 1, 2}, } },
900     /* avlab_1s2p */ { 2, { { 1, 2}, { 3, 4 },} },
901     /* avlab_2s1p */ { 1, { { 2, 3}, } },
902     @@ -110,6 +120,10 @@ static struct pci_device_id parport_serial_pci_tbl[] = {
903     { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9845,
904     PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9xx5_combo },
905     { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9855,
906     + 0x1000, 0x0020, 0, 0, netmos_9855_2p },
907     + { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9855,
908     + 0x1000, 0x0022, 0, 0, netmos_9855_2p },
909     + { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9855,
910     PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9855 },
911     /* PCI_VENDOR_ID_AVLAB/Intek21 has another bunch of cards ...*/
912     { PCI_VENDOR_ID_AFAVLAB, 0x2110,
913     @@ -192,6 +206,12 @@ static struct pciserial_board pci_parport_serial_boards[] __devinitdata = {
914     .uart_offset = 8,
915     },
916     [netmos_9855] = {
917     + .flags = FL_BASE2 | FL_BASE_BARS,
918     + .num_ports = 1,
919     + .base_baud = 115200,
920     + .uart_offset = 8,
921     + },
922     + [netmos_9855_2p] = {
923     .flags = FL_BASE4 | FL_BASE_BARS,
924     .num_ports = 1,
925     .base_baud = 115200,
926     diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
927     index 6d61200..e074343 100644
928     --- a/drivers/pci/pci.c
929     +++ b/drivers/pci/pci.c
930     @@ -479,6 +479,8 @@ pci_raw_set_power_state(struct pci_dev *dev, pci_power_t state, bool wait)
931     pmcsr &= ~PCI_PM_CTRL_STATE_MASK;
932     pmcsr |= state;
933     break;
934     + case PCI_D3hot:
935     + case PCI_D3cold:
936     case PCI_UNKNOWN: /* Boot-up */
937     if ((pmcsr & PCI_PM_CTRL_STATE_MASK) == PCI_D3hot
938     && !(pmcsr & PCI_PM_CTRL_NO_SOFT_RESET)) {
939     @@ -1196,15 +1198,14 @@ pci_power_t pci_target_state(struct pci_dev *dev)
940     default:
941     target_state = state;
942     }
943     + } else if (!dev->pm_cap) {
944     + target_state = PCI_D0;
945     } else if (device_may_wakeup(&dev->dev)) {
946     /*
947     * Find the deepest state from which the device can generate
948     * wake-up events, make it the target state and enable device
949     * to generate PME#.
950     */
951     - if (!dev->pm_cap)
952     - return PCI_POWER_ERROR;
953     -
954     if (dev->pme_support) {
955     while (target_state
956     && !(dev->pme_support & (1 << target_state)))
957     diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
958     index b0367f1..777b2c7 100644
959     --- a/drivers/pci/pcie/aspm.c
960     +++ b/drivers/pci/pcie/aspm.c
961     @@ -638,6 +638,10 @@ void pcie_aspm_init_link_state(struct pci_dev *pdev)
962     if (pdev->pcie_type != PCI_EXP_TYPE_ROOT_PORT &&
963     pdev->pcie_type != PCI_EXP_TYPE_DOWNSTREAM)
964     return;
965     + /* VIA has a strange chipset, root port is under a bridge */
966     + if (pdev->pcie_type == PCI_EXP_TYPE_ROOT_PORT &&
967     + pdev->bus->self)
968     + return;
969     down_read(&pci_bus_sem);
970     if (list_empty(&pdev->subordinate->devices))
971     goto out;
972     diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
973     index 34760f8..00856ba 100644
974     --- a/drivers/scsi/qla2xxx/qla_dbg.c
975     +++ b/drivers/scsi/qla2xxx/qla_dbg.c
976     @@ -218,7 +218,7 @@ qla24xx_soft_reset(struct qla_hw_data *ha)
977    
978     static int
979     qla2xxx_dump_ram(struct qla_hw_data *ha, uint32_t addr, uint16_t *ram,
980     - uint16_t ram_words, void **nxt)
981     + uint32_t ram_words, void **nxt)
982     {
983     int rval;
984     uint32_t cnt, stat, timer, words, idx;
985     diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
986     index b4b3981..a0127e9 100644
987     --- a/drivers/serial/8250.c
988     +++ b/drivers/serial/8250.c
989     @@ -137,6 +137,7 @@ struct uart_8250_port {
990     unsigned char mcr;
991     unsigned char mcr_mask; /* mask of user bits */
992     unsigned char mcr_force; /* mask of forced bits */
993     + unsigned char cur_iotype; /* Running I/O type */
994    
995     /*
996     * Some bits in registers are cleared on a read, so they must
997     @@ -471,6 +472,7 @@ static void io_serial_out(struct uart_port *p, int offset, int value)
998    
999     static void set_io_from_upio(struct uart_port *p)
1000     {
1001     + struct uart_8250_port *up = (struct uart_8250_port *)p;
1002     switch (p->iotype) {
1003     case UPIO_HUB6:
1004     p->serial_in = hub6_serial_in;
1005     @@ -509,6 +511,8 @@ static void set_io_from_upio(struct uart_port *p)
1006     p->serial_out = io_serial_out;
1007     break;
1008     }
1009     + /* Remember loaded iotype */
1010     + up->cur_iotype = p->iotype;
1011     }
1012    
1013     static void
1014     @@ -1937,6 +1941,9 @@ static int serial8250_startup(struct uart_port *port)
1015     up->capabilities = uart_config[up->port.type].flags;
1016     up->mcr = 0;
1017    
1018     + if (up->port.iotype != up->cur_iotype)
1019     + set_io_from_upio(port);
1020     +
1021     if (up->port.type == PORT_16C950) {
1022     /* Wake up and initialize UART */
1023     up->acr = 0;
1024     @@ -2563,6 +2570,9 @@ static void serial8250_config_port(struct uart_port *port, int flags)
1025     if (ret < 0)
1026     probeflags &= ~PROBE_RSA;
1027    
1028     + if (up->port.iotype != up->cur_iotype)
1029     + set_io_from_upio(port);
1030     +
1031     if (flags & UART_CONFIG_TYPE)
1032     autoconfig(up, probeflags);
1033     if (up->port.type != PORT_UNKNOWN && flags & UART_CONFIG_IRQ)
1034     @@ -2671,6 +2681,11 @@ serial8250_register_ports(struct uart_driver *drv, struct device *dev)
1035     {
1036     int i;
1037    
1038     + for (i = 0; i < nr_uarts; i++) {
1039     + struct uart_8250_port *up = &serial8250_ports[i];
1040     + up->cur_iotype = 0xFF;
1041     + }
1042     +
1043     serial8250_isa_init_ports();
1044    
1045     for (i = 0; i < nr_uarts; i++) {
1046     diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
1047     index c40a9b2..3703789 100644
1048     --- a/drivers/usb/class/usbtmc.c
1049     +++ b/drivers/usb/class/usbtmc.c
1050     @@ -927,21 +927,27 @@ static long usbtmc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
1051     switch (cmd) {
1052     case USBTMC_IOCTL_CLEAR_OUT_HALT:
1053     retval = usbtmc_ioctl_clear_out_halt(data);
1054     + break;
1055    
1056     case USBTMC_IOCTL_CLEAR_IN_HALT:
1057     retval = usbtmc_ioctl_clear_in_halt(data);
1058     + break;
1059    
1060     case USBTMC_IOCTL_INDICATOR_PULSE:
1061     retval = usbtmc_ioctl_indicator_pulse(data);
1062     + break;
1063    
1064     case USBTMC_IOCTL_CLEAR:
1065     retval = usbtmc_ioctl_clear(data);
1066     + break;
1067    
1068     case USBTMC_IOCTL_ABORT_BULK_OUT:
1069     retval = usbtmc_ioctl_abort_bulk_out(data);
1070     + break;
1071    
1072     case USBTMC_IOCTL_ABORT_BULK_IN:
1073     retval = usbtmc_ioctl_abort_bulk_in(data);
1074     + break;
1075     }
1076    
1077     mutex_unlock(&data->io_mutex);
1078     diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
1079     index 9a577a8..2fb63f6 100644
1080     --- a/drivers/video/atmel_lcdfb.c
1081     +++ b/drivers/video/atmel_lcdfb.c
1082     @@ -29,14 +29,8 @@
1083    
1084     /* configurable parameters */
1085     #define ATMEL_LCDC_CVAL_DEFAULT 0xc8
1086     -#define ATMEL_LCDC_DMA_BURST_LEN 8
1087     -
1088     -#if defined(CONFIG_ARCH_AT91SAM9263) || defined(CONFIG_ARCH_AT91CAP9) || \
1089     - defined(CONFIG_ARCH_AT91SAM9RL)
1090     -#define ATMEL_LCDC_FIFO_SIZE 2048
1091     -#else
1092     -#define ATMEL_LCDC_FIFO_SIZE 512
1093     -#endif
1094     +#define ATMEL_LCDC_DMA_BURST_LEN 8 /* words */
1095     +#define ATMEL_LCDC_FIFO_SIZE 512 /* words */
1096    
1097     #if defined(CONFIG_ARCH_AT91)
1098     #define ATMEL_LCDFB_FBINFO_DEFAULT (FBINFO_DEFAULT \
1099     diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
1100     index f81f9e7..6bb5808 100644
1101     --- a/fs/fs-writeback.c
1102     +++ b/fs/fs-writeback.c
1103     @@ -274,7 +274,6 @@ __sync_single_inode(struct inode *inode, struct writeback_control *wbc)
1104     int ret;
1105    
1106     BUG_ON(inode->i_state & I_SYNC);
1107     - WARN_ON(inode->i_state & I_NEW);
1108    
1109     /* Set I_SYNC, reset I_DIRTY */
1110     dirty = inode->i_state & I_DIRTY;
1111     @@ -299,7 +298,6 @@ __sync_single_inode(struct inode *inode, struct writeback_control *wbc)
1112     }
1113    
1114     spin_lock(&inode_lock);
1115     - WARN_ON(inode->i_state & I_NEW);
1116     inode->i_state &= ~I_SYNC;
1117     if (!(inode->i_state & I_FREEING)) {
1118     if (!(inode->i_state & I_DIRTY) &&
1119     diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c
1120     index 3fbffb1..30de111 100644
1121     --- a/fs/jbd/commit.c
1122     +++ b/fs/jbd/commit.c
1123     @@ -238,7 +238,7 @@ write_out_data:
1124     spin_lock(&journal->j_list_lock);
1125     }
1126     /* Someone already cleaned up the buffer? */
1127     - if (!buffer_jbd(bh)
1128     + if (!buffer_jbd(bh) || bh2jh(bh) != jh
1129     || jh->b_transaction != commit_transaction
1130     || jh->b_jlist != BJ_SyncData) {
1131     jbd_unlock_bh_state(bh);
1132     @@ -466,7 +466,9 @@ void journal_commit_transaction(journal_t *journal)
1133     spin_lock(&journal->j_list_lock);
1134     continue;
1135     }
1136     - if (buffer_jbd(bh) && jh->b_jlist == BJ_Locked) {
1137     + if (buffer_jbd(bh) && bh2jh(bh) == jh &&
1138     + jh->b_transaction == commit_transaction &&
1139     + jh->b_jlist == BJ_Locked) {
1140     __journal_unfile_buffer(jh);
1141     jbd_unlock_bh_state(bh);
1142     journal_remove_journal_head(bh);
1143     diff --git a/include/linux/firmware-map.h b/include/linux/firmware-map.h
1144     index cca686b..875451f 100644
1145     --- a/include/linux/firmware-map.h
1146     +++ b/include/linux/firmware-map.h
1147     @@ -24,21 +24,17 @@
1148     */
1149     #ifdef CONFIG_FIRMWARE_MEMMAP
1150    
1151     -int firmware_map_add(resource_size_t start, resource_size_t end,
1152     - const char *type);
1153     -int firmware_map_add_early(resource_size_t start, resource_size_t end,
1154     - const char *type);
1155     +int firmware_map_add(u64 start, u64 end, const char *type);
1156     +int firmware_map_add_early(u64 start, u64 end, const char *type);
1157    
1158     #else /* CONFIG_FIRMWARE_MEMMAP */
1159    
1160     -static inline int firmware_map_add(resource_size_t start, resource_size_t end,
1161     - const char *type)
1162     +static inline int firmware_map_add(u64 start, u64 end, const char *type)
1163     {
1164     return 0;
1165     }
1166    
1167     -static inline int firmware_map_add_early(resource_size_t start,
1168     - resource_size_t end, const char *type)
1169     +static inline int firmware_map_add_early(u64 start, u64 end, const char *type)
1170     {
1171     return 0;
1172     }
1173     diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
1174     index bf8f119..9f29d86 100644
1175     --- a/include/linux/mlx4/qp.h
1176     +++ b/include/linux/mlx4/qp.h
1177     @@ -165,6 +165,7 @@ enum {
1178     MLX4_WQE_CTRL_IP_CSUM = 1 << 4,
1179     MLX4_WQE_CTRL_TCP_UDP_CSUM = 1 << 5,
1180     MLX4_WQE_CTRL_INS_VLAN = 1 << 6,
1181     + MLX4_WQE_CTRL_STRONG_ORDER = 1 << 7,
1182     };
1183    
1184     struct mlx4_wqe_ctrl_seg {
1185     diff --git a/kernel/acct.c b/kernel/acct.c
1186     index 7afa315..9f33910 100644
1187     --- a/kernel/acct.c
1188     +++ b/kernel/acct.c
1189     @@ -215,6 +215,7 @@ static void acct_file_reopen(struct bsd_acct_struct *acct, struct file *file,
1190     static int acct_on(char *name)
1191     {
1192     struct file *file;
1193     + struct vfsmount *mnt;
1194     int error;
1195     struct pid_namespace *ns;
1196     struct bsd_acct_struct *acct = NULL;
1197     @@ -256,11 +257,12 @@ static int acct_on(char *name)
1198     acct = NULL;
1199     }
1200    
1201     - mnt_pin(file->f_path.mnt);
1202     + mnt = file->f_path.mnt;
1203     + mnt_pin(mnt);
1204     acct_file_reopen(ns->bacct, file, ns);
1205     spin_unlock(&acct_lock);
1206    
1207     - mntput(file->f_path.mnt); /* it's pinned, now give up active reference */
1208     + mntput(mnt); /* it's pinned, now give up active reference */
1209     kfree(acct);
1210    
1211     return 0;
1212     diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
1213     index 1bcf9cd..a0879b2 100644
1214     --- a/lib/Kconfig.debug
1215     +++ b/lib/Kconfig.debug
1216     @@ -402,7 +402,7 @@ config LOCKDEP
1217     bool
1218     depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
1219     select STACKTRACE
1220     - select FRAME_POINTER if !X86 && !MIPS && !PPC
1221     + select FRAME_POINTER if !MIPS && !PPC
1222     select KALLSYMS
1223     select KALLSYMS_ALL
1224    
1225     diff --git a/mm/page_alloc.c b/mm/page_alloc.c
1226     index 5c44ed4..16169c1 100644
1227     --- a/mm/page_alloc.c
1228     +++ b/mm/page_alloc.c
1229     @@ -2804,7 +2804,7 @@ bad:
1230     if (dzone == zone)
1231     break;
1232     kfree(zone_pcp(dzone, cpu));
1233     - zone_pcp(dzone, cpu) = NULL;
1234     + zone_pcp(dzone, cpu) = &boot_pageset[cpu];
1235     }
1236     return -ENOMEM;
1237     }
1238     @@ -2819,7 +2819,7 @@ static inline void free_zone_pagesets(int cpu)
1239     /* Free per_cpu_pageset if it is slab allocated */
1240     if (pset != &boot_pageset[cpu])
1241     kfree(pset);
1242     - zone_pcp(zone, cpu) = NULL;
1243     + zone_pcp(zone, cpu) = &boot_pageset[cpu];
1244     }
1245     }
1246    
1247     @@ -4494,6 +4494,8 @@ int percpu_pagelist_fraction_sysctl_handler(ctl_table *table, int write,
1248     if (!write || (ret == -EINVAL))
1249     return ret;
1250     for_each_zone(zone) {
1251     + if (!populated_zone(zone))
1252     + continue;
1253     for_each_online_cpu(cpu) {
1254     unsigned long high;
1255     high = zone->present_pages / percpu_pagelist_fraction;
1256     diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c
1257     index d9233ec..2681dfa 100644
1258     --- a/net/mac80211/rc80211_minstrel.c
1259     +++ b/net/mac80211/rc80211_minstrel.c
1260     @@ -216,7 +216,7 @@ minstrel_get_next_sample(struct minstrel_sta_info *mi)
1261     unsigned int sample_ndx;
1262     sample_ndx = SAMPLE_TBL(mi, mi->sample_idx, mi->sample_column);
1263     mi->sample_idx++;
1264     - if (mi->sample_idx > (mi->n_rates - 2)) {
1265     + if ((int) mi->sample_idx > (mi->n_rates - 2)) {
1266     mi->sample_idx = 0;
1267     mi->sample_column++;
1268     if (mi->sample_column >= SAMPLE_COLUMNS)
1269     diff --git a/sound/core/seq/seq_midi_event.c b/sound/core/seq/seq_midi_event.c
1270     index 8284f17..b5d6ea4 100644
1271     --- a/sound/core/seq/seq_midi_event.c
1272     +++ b/sound/core/seq/seq_midi_event.c
1273     @@ -504,10 +504,10 @@ static int extra_decode_xrpn(struct snd_midi_event *dev, unsigned char *buf,
1274     if (dev->nostat && count < 12)
1275     return -ENOMEM;
1276     cmd = MIDI_CMD_CONTROL|(ev->data.control.channel & 0x0f);
1277     - bytes[0] = ev->data.control.param & 0x007f;
1278     - bytes[1] = (ev->data.control.param & 0x3f80) >> 7;
1279     - bytes[2] = ev->data.control.value & 0x007f;
1280     - bytes[3] = (ev->data.control.value & 0x3f80) >> 7;
1281     + bytes[0] = (ev->data.control.param & 0x3f80) >> 7;
1282     + bytes[1] = ev->data.control.param & 0x007f;
1283     + bytes[2] = (ev->data.control.value & 0x3f80) >> 7;
1284     + bytes[3] = ev->data.control.value & 0x007f;
1285     if (cmd != dev->lastcmd && !dev->nostat) {
1286     if (count < 9)
1287     return -ENOMEM;
1288     diff --git a/sound/pci/ca0106/ca0106_mixer.c b/sound/pci/ca0106/ca0106_mixer.c
1289     index ad28887..b02eab6 100644
1290     --- a/sound/pci/ca0106/ca0106_mixer.c
1291     +++ b/sound/pci/ca0106/ca0106_mixer.c
1292     @@ -841,6 +841,9 @@ int __devinit snd_ca0106_mixer(struct snd_ca0106 *emu)
1293     snd_ca0106_master_db_scale);
1294     if (!vmaster)
1295     return -ENOMEM;
1296     + err = snd_ctl_add(card, vmaster);
1297     + if (err < 0)
1298     + return err;
1299     add_slaves(card, vmaster, slave_vols);
1300    
1301     if (emu->details->spi_dac == 1) {
1302     @@ -848,6 +851,9 @@ int __devinit snd_ca0106_mixer(struct snd_ca0106 *emu)
1303     NULL);
1304     if (!vmaster)
1305     return -ENOMEM;
1306     + err = snd_ctl_add(card, vmaster);
1307     + if (err < 0)
1308     + return err;
1309     add_slaves(card, vmaster, slave_sws);
1310     }
1311     return 0;