Magellan Linux

Annotation of /trunk/kernel26-alx/patches-2.6.27-r3/0125-2.6.27.26-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1176 - (hide annotations) (download)
Thu Oct 14 15:11:06 2010 UTC (13 years, 7 months ago) by niro
File size: 37088 byte(s)
-2.6.27-alx-r3: new magellan 0.5.2 kernel
1 niro 1176 diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
2     index dfaa343..1177f10 100644
3     --- a/arch/x86/kernel/reboot.c
4     +++ b/arch/x86/kernel/reboot.c
5     @@ -169,6 +169,24 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
6     DMI_MATCH(DMI_BOARD_NAME, "0KW626"),
7     },
8     },
9     + { /* Handle problems with rebooting on Dell Optiplex 360 with 0T656F */
10     + .callback = set_bios_reboot,
11     + .ident = "Dell OptiPlex 360",
12     + .matches = {
13     + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
14     + DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 360"),
15     + DMI_MATCH(DMI_BOARD_NAME, "0T656F"),
16     + },
17     + },
18     + { /* Handle problems with rebooting on Dell Optiplex 330 with 0KP561 */
19     + .callback = set_bios_reboot,
20     + .ident = "Dell OptiPlex 330",
21     + .matches = {
22     + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
23     + DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 330"),
24     + DMI_MATCH(DMI_BOARD_NAME, "0KP561"),
25     + },
26     + },
27     { /* Handle problems with rebooting on Dell 2400's */
28     .callback = set_bios_reboot,
29     .ident = "Dell PowerEdge 2400",
30     diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
31     index 2781331..f0b164b 100644
32     --- a/arch/x86/kernel/setup.c
33     +++ b/arch/x86/kernel/setup.c
34     @@ -250,15 +250,13 @@ static inline void copy_edd(void)
35    
36     #ifdef CONFIG_BLK_DEV_INITRD
37    
38     -#ifdef CONFIG_X86_32
39     -
40     #define MAX_MAP_CHUNK (NR_FIX_BTMAPS << PAGE_SHIFT)
41     static void __init relocate_initrd(void)
42     {
43    
44     u64 ramdisk_image = boot_params.hdr.ramdisk_image;
45     u64 ramdisk_size = boot_params.hdr.ramdisk_size;
46     - u64 end_of_lowmem = max_low_pfn << PAGE_SHIFT;
47     + u64 end_of_lowmem = max_low_pfn_mapped << PAGE_SHIFT;
48     u64 ramdisk_here;
49     unsigned long slop, clen, mapaddr;
50     char *p, *q;
51     @@ -314,14 +312,13 @@ static void __init relocate_initrd(void)
52     ramdisk_image, ramdisk_image + ramdisk_size - 1,
53     ramdisk_here, ramdisk_here + ramdisk_size - 1);
54     }
55     -#endif
56    
57     static void __init reserve_initrd(void)
58     {
59     u64 ramdisk_image = boot_params.hdr.ramdisk_image;
60     u64 ramdisk_size = boot_params.hdr.ramdisk_size;
61     u64 ramdisk_end = ramdisk_image + ramdisk_size;
62     - u64 end_of_lowmem = max_low_pfn << PAGE_SHIFT;
63     + u64 end_of_lowmem = max_low_pfn_mapped << PAGE_SHIFT;
64    
65     if (!boot_params.hdr.type_of_loader ||
66     !ramdisk_image || !ramdisk_size)
67     @@ -351,14 +348,8 @@ static void __init reserve_initrd(void)
68     return;
69     }
70    
71     -#ifdef CONFIG_X86_32
72     relocate_initrd();
73     -#else
74     - printk(KERN_ERR "initrd extends beyond end of memory "
75     - "(0x%08llx > 0x%08llx)\ndisabling initrd\n",
76     - ramdisk_end, end_of_lowmem);
77     - initrd_start = 0;
78     -#endif
79     +
80     free_early(ramdisk_image, ramdisk_end);
81     }
82     #else
83     diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
84     index 395f8ea..615fcd3 100644
85     --- a/drivers/block/floppy.c
86     +++ b/drivers/block/floppy.c
87     @@ -177,6 +177,7 @@ static int print_unex = 1;
88     #include <linux/interrupt.h>
89     #include <linux/init.h>
90     #include <linux/platform_device.h>
91     +#include <linux/mod_devicetable.h>
92     #include <linux/buffer_head.h> /* for invalidate_buffers() */
93     #include <linux/mutex.h>
94    
95     @@ -551,6 +552,8 @@ static void process_fd_request(void);
96     static void recalibrate_floppy(void);
97     static void floppy_shutdown(unsigned long);
98    
99     +static int floppy_request_regions(int);
100     +static void floppy_release_regions(int);
101     static int floppy_grab_irq_and_dma(void);
102     static void floppy_release_irq_and_dma(void);
103    
104     @@ -4273,8 +4276,7 @@ static int __init floppy_init(void)
105     FDCS->rawcmd = 2;
106     if (user_reset_fdc(-1, FD_RESET_ALWAYS, 0)) {
107     /* free ioports reserved by floppy_grab_irq_and_dma() */
108     - release_region(FDCS->address + 2, 4);
109     - release_region(FDCS->address + 7, 1);
110     + floppy_release_regions(fdc);
111     FDCS->address = -1;
112     FDCS->version = FDC_NONE;
113     continue;
114     @@ -4283,8 +4285,7 @@ static int __init floppy_init(void)
115     FDCS->version = get_fdc_version();
116     if (FDCS->version == FDC_NONE) {
117     /* free ioports reserved by floppy_grab_irq_and_dma() */
118     - release_region(FDCS->address + 2, 4);
119     - release_region(FDCS->address + 7, 1);
120     + floppy_release_regions(fdc);
121     FDCS->address = -1;
122     continue;
123     }
124     @@ -4357,6 +4358,47 @@ out_put_disk:
125    
126     static DEFINE_SPINLOCK(floppy_usage_lock);
127    
128     +static const struct io_region {
129     + int offset;
130     + int size;
131     +} io_regions[] = {
132     + { 2, 1 },
133     + /* address + 3 is sometimes reserved by pnp bios for motherboard */
134     + { 4, 2 },
135     + /* address + 6 is reserved, and may be taken by IDE.
136     + * Unfortunately, Adaptec doesn't know this :-(, */
137     + { 7, 1 },
138     +};
139     +
140     +static void floppy_release_allocated_regions(int fdc, const struct io_region *p)
141     +{
142     + while (p != io_regions) {
143     + p--;
144     + release_region(FDCS->address + p->offset, p->size);
145     + }
146     +}
147     +
148     +#define ARRAY_END(X) (&((X)[ARRAY_SIZE(X)]))
149     +
150     +static int floppy_request_regions(int fdc)
151     +{
152     + const struct io_region *p;
153     +
154     + for (p = io_regions; p < ARRAY_END(io_regions); p++) {
155     + if (!request_region(FDCS->address + p->offset, p->size, "floppy")) {
156     + DPRINT("Floppy io-port 0x%04lx in use\n", FDCS->address + p->offset);
157     + floppy_release_allocated_regions(fdc, p);
158     + return -EBUSY;
159     + }
160     + }
161     + return 0;
162     +}
163     +
164     +static void floppy_release_regions(int fdc)
165     +{
166     + floppy_release_allocated_regions(fdc, ARRAY_END(io_regions));
167     +}
168     +
169     static int floppy_grab_irq_and_dma(void)
170     {
171     unsigned long flags;
172     @@ -4398,18 +4440,8 @@ static int floppy_grab_irq_and_dma(void)
173    
174     for (fdc = 0; fdc < N_FDC; fdc++) {
175     if (FDCS->address != -1) {
176     - if (!request_region(FDCS->address + 2, 4, "floppy")) {
177     - DPRINT("Floppy io-port 0x%04lx in use\n",
178     - FDCS->address + 2);
179     - goto cleanup1;
180     - }
181     - if (!request_region(FDCS->address + 7, 1, "floppy DIR")) {
182     - DPRINT("Floppy io-port 0x%04lx in use\n",
183     - FDCS->address + 7);
184     - goto cleanup2;
185     - }
186     - /* address + 6 is reserved, and may be taken by IDE.
187     - * Unfortunately, Adaptec doesn't know this :-(, */
188     + if (floppy_request_regions(fdc))
189     + goto cleanup;
190     }
191     }
192     for (fdc = 0; fdc < N_FDC; fdc++) {
193     @@ -4431,15 +4463,11 @@ static int floppy_grab_irq_and_dma(void)
194     fdc = 0;
195     irqdma_allocated = 1;
196     return 0;
197     -cleanup2:
198     - release_region(FDCS->address + 2, 4);
199     -cleanup1:
200     +cleanup:
201     fd_free_irq();
202     fd_free_dma();
203     - while (--fdc >= 0) {
204     - release_region(FDCS->address + 2, 4);
205     - release_region(FDCS->address + 7, 1);
206     - }
207     + while (--fdc >= 0)
208     + floppy_release_regions(fdc);
209     spin_lock_irqsave(&floppy_usage_lock, flags);
210     usage_count--;
211     spin_unlock_irqrestore(&floppy_usage_lock, flags);
212     @@ -4500,10 +4528,8 @@ static void floppy_release_irq_and_dma(void)
213     #endif
214     old_fdc = fdc;
215     for (fdc = 0; fdc < N_FDC; fdc++)
216     - if (FDCS->address != -1) {
217     - release_region(FDCS->address + 2, 4);
218     - release_region(FDCS->address + 7, 1);
219     - }
220     + if (FDCS->address != -1)
221     + floppy_release_regions(fdc);
222     fdc = old_fdc;
223     }
224    
225     @@ -4572,6 +4598,13 @@ MODULE_AUTHOR("Alain L. Knaff");
226     MODULE_SUPPORTED_DEVICE("fd");
227     MODULE_LICENSE("GPL");
228    
229     +/* This doesn't actually get used other than for module information */
230     +static const struct pnp_device_id floppy_pnpids[] = {
231     + { "PNP0700", 0 },
232     + { }
233     +};
234     +MODULE_DEVICE_TABLE(pnp, floppy_pnpids);
235     +
236     #else
237    
238     __setup("floppy=", floppy_setup);
239     diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c
240     index d3d7864..729be5e 100644
241     --- a/drivers/char/moxa.c
242     +++ b/drivers/char/moxa.c
243     @@ -1158,6 +1158,11 @@ static int moxa_open(struct tty_struct *tty, struct file *filp)
244     return -ENODEV;
245     }
246    
247     + if (port % MAX_PORTS_PER_BOARD >= brd->numPorts) {
248     + retval = -ENODEV;
249     + goto out_unlock;
250     + }
251     +
252     ch = &brd->ports[port % MAX_PORTS_PER_BOARD];
253     ch->port.count++;
254     tty->driver_data = ch;
255     @@ -1182,8 +1187,8 @@ static int moxa_open(struct tty_struct *tty, struct file *filp)
256     moxa_close_port(ch);
257     } else
258     ch->port.flags |= ASYNC_NORMAL_ACTIVE;
259     +out_unlock:
260     mutex_unlock(&moxa_openlock);
261     -
262     return retval;
263     }
264    
265     diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
266     index b638403..ebda9a8 100644
267     --- a/drivers/char/mxser.c
268     +++ b/drivers/char/mxser.c
269     @@ -2790,7 +2790,7 @@ static int __init mxser_module_init(void)
270     continue;
271    
272     brd = &mxser_boards[m];
273     - retval = mxser_get_ISA_conf(!ioaddr[b], brd);
274     + retval = mxser_get_ISA_conf(ioaddr[b], brd);
275     if (retval <= 0) {
276     brd->info = NULL;
277     continue;
278     diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c
279     index f070ae7..0b255b9 100644
280     --- a/drivers/char/pcmcia/cm4000_cs.c
281     +++ b/drivers/char/pcmcia/cm4000_cs.c
282     @@ -1575,7 +1575,8 @@ static long cmm_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
283     clear_bit(LOCK_IO, &dev->flags);
284     wake_up_interruptible(&dev->ioq);
285    
286     - return 0;
287     + rc = 0;
288     + break;
289     case CM_IOCSPTS:
290     {
291     struct ptsreq krnptsreq;
292     diff --git a/drivers/firmware/memmap.c b/drivers/firmware/memmap.c
293     index 3bf8ee1..a36e9aa 100644
294     --- a/drivers/firmware/memmap.c
295     +++ b/drivers/firmware/memmap.c
296     @@ -31,8 +31,12 @@
297     * information is necessary as for the resource tree.
298     */
299     struct firmware_map_entry {
300     - resource_size_t start; /* start of the memory range */
301     - resource_size_t end; /* end of the memory range (incl.) */
302     + /*
303     + * start and end must be u64 rather than resource_size_t, because e820
304     + * resources can lie at addresses above 4G.
305     + */
306     + u64 start; /* start of the memory range */
307     + u64 end; /* end of the memory range (incl.) */
308     const char *type; /* type of the memory range */
309     struct list_head list; /* entry for the linked list */
310     struct kobject kobj; /* kobject for each entry */
311     @@ -101,7 +105,7 @@ static LIST_HEAD(map_entries);
312     * Common implementation of firmware_map_add() and firmware_map_add_early()
313     * which expects a pre-allocated struct firmware_map_entry.
314     **/
315     -static int firmware_map_add_entry(resource_size_t start, resource_size_t end,
316     +static int firmware_map_add_entry(u64 start, u64 end,
317     const char *type,
318     struct firmware_map_entry *entry)
319     {
320     @@ -132,8 +136,7 @@ static int firmware_map_add_entry(resource_size_t start, resource_size_t end,
321     *
322     * Returns 0 on success, or -ENOMEM if no memory could be allocated.
323     **/
324     -int firmware_map_add(resource_size_t start, resource_size_t end,
325     - const char *type)
326     +int firmware_map_add(u64 start, u64 end, const char *type)
327     {
328     struct firmware_map_entry *entry;
329    
330     @@ -157,8 +160,7 @@ int firmware_map_add(resource_size_t start, resource_size_t end,
331     *
332     * Returns 0 on success, or -ENOMEM if no memory could be allocated.
333     **/
334     -int __init firmware_map_add_early(resource_size_t start, resource_size_t end,
335     - const char *type)
336     +int __init firmware_map_add_early(u64 start, u64 end, const char *type)
337     {
338     struct firmware_map_entry *entry;
339    
340     diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
341     index 9559248..8c844a1 100644
342     --- a/drivers/infiniband/hw/mlx4/qp.c
343     +++ b/drivers/infiniband/hw/mlx4/qp.c
344     @@ -1563,12 +1563,16 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
345     break;
346    
347     case IB_WR_LOCAL_INV:
348     + ctrl->srcrb_flags |=
349     + cpu_to_be32(MLX4_WQE_CTRL_STRONG_ORDER);
350     set_local_inv_seg(wqe, wr->ex.invalidate_rkey);
351     wqe += sizeof (struct mlx4_wqe_local_inval_seg);
352     size += sizeof (struct mlx4_wqe_local_inval_seg) / 16;
353     break;
354    
355     case IB_WR_FAST_REG_MR:
356     + ctrl->srcrb_flags |=
357     + cpu_to_be32(MLX4_WQE_CTRL_STRONG_ORDER);
358     set_fmr_seg(wqe, wr);
359     wqe += sizeof (struct mlx4_wqe_fmr_seg);
360     size += sizeof (struct mlx4_wqe_fmr_seg) / 16;
361     diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c
362     index f126566..3d337d9 100644
363     --- a/drivers/isdn/hisax/hfc_pci.c
364     +++ b/drivers/isdn/hisax/hfc_pci.c
365     @@ -82,8 +82,9 @@ release_io_hfcpci(struct IsdnCardState *cs)
366     Write_hfc(cs, HFCPCI_INT_M2, cs->hw.hfcpci.int_m2);
367     pci_write_config_word(cs->hw.hfcpci.dev, PCI_COMMAND, 0); /* disable memory mapped ports + busmaster */
368     del_timer(&cs->hw.hfcpci.timer);
369     - kfree(cs->hw.hfcpci.share_start);
370     - cs->hw.hfcpci.share_start = NULL;
371     + pci_free_consistent(cs->hw.hfcpci.dev, 0x8000,
372     + cs->hw.hfcpci.fifos, cs->hw.hfcpci.dma);
373     + cs->hw.hfcpci.fifos = NULL;
374     iounmap((void *)cs->hw.hfcpci.pci_io);
375     }
376    
377     @@ -1663,8 +1664,19 @@ setup_hfcpci(struct IsdnCard *card)
378     dev_hfcpci);
379     i++;
380     if (tmp_hfcpci) {
381     + dma_addr_t dma_mask = DMA_BIT_MASK(32) & ~0x7fffUL;
382     if (pci_enable_device(tmp_hfcpci))
383     continue;
384     + if (pci_set_dma_mask(tmp_hfcpci, dma_mask)) {
385     + printk(KERN_WARNING
386     + "HiSax hfc_pci: No suitable DMA available.\n");
387     + continue;
388     + }
389     + if (pci_set_consistent_dma_mask(tmp_hfcpci, dma_mask)) {
390     + printk(KERN_WARNING
391     + "HiSax hfc_pci: No suitable consistent DMA available.\n");
392     + continue;
393     + }
394     pci_set_master(tmp_hfcpci);
395     if ((card->para[0]) && (card->para[0] != (tmp_hfcpci->resource[ 0].start & PCI_BASE_ADDRESS_IO_MASK)))
396     continue;
397     @@ -1693,22 +1705,29 @@ setup_hfcpci(struct IsdnCard *card)
398     printk(KERN_WARNING "HFC-PCI: No IO-Mem for PCI card found\n");
399     return (0);
400     }
401     +
402     /* Allocate memory for FIFOS */
403     - /* Because the HFC-PCI needs a 32K physical alignment, we */
404     - /* need to allocate the double mem and align the address */
405     - if (!(cs->hw.hfcpci.share_start = kmalloc(65536, GFP_KERNEL))) {
406     - printk(KERN_WARNING "HFC-PCI: Error allocating memory for FIFO!\n");
407     + cs->hw.hfcpci.fifos = pci_alloc_consistent(cs->hw.hfcpci.dev,
408     + 0x8000, &cs->hw.hfcpci.dma);
409     + if (!cs->hw.hfcpci.fifos) {
410     + printk(KERN_WARNING "HFC-PCI: Error allocating FIFO memory!\n");
411     + return 0;
412     + }
413     + if (cs->hw.hfcpci.dma & 0x7fff) {
414     + printk(KERN_WARNING
415     + "HFC-PCI: Error DMA memory not on 32K boundary (%lx)\n",
416     + (u_long)cs->hw.hfcpci.dma);
417     + pci_free_consistent(cs->hw.hfcpci.dev, 0x8000,
418     + cs->hw.hfcpci.fifos, cs->hw.hfcpci.dma);
419     return 0;
420     }
421     - cs->hw.hfcpci.fifos = (void *)
422     - (((ulong) cs->hw.hfcpci.share_start) & ~0x7FFF) + 0x8000;
423     - pci_write_config_dword(cs->hw.hfcpci.dev, 0x80, (u_int) virt_to_bus(cs->hw.hfcpci.fifos));
424     + pci_write_config_dword(cs->hw.hfcpci.dev, 0x80, (u32)cs->hw.hfcpci.dma);
425     cs->hw.hfcpci.pci_io = ioremap((ulong) cs->hw.hfcpci.pci_io, 256);
426     printk(KERN_INFO
427     - "HFC-PCI: defined at mem %p fifo %p(%#x) IRQ %d HZ %d\n",
428     + "HFC-PCI: defined at mem %p fifo %p(%lx) IRQ %d HZ %d\n",
429     cs->hw.hfcpci.pci_io,
430     cs->hw.hfcpci.fifos,
431     - (u_int) virt_to_bus(cs->hw.hfcpci.fifos),
432     + (u_long)cs->hw.hfcpci.dma,
433     cs->irq, HZ);
434    
435     spin_lock_irqsave(&cs->lock, flags);
436     diff --git a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h
437     index e8d429f..f1a828b 100644
438     --- a/drivers/isdn/hisax/hisax.h
439     +++ b/drivers/isdn/hisax/hisax.h
440     @@ -694,7 +694,7 @@ struct hfcPCI_hw {
441     int nt_timer;
442     struct pci_dev *dev;
443     unsigned char *pci_io; /* start of PCI IO memory */
444     - void *share_start; /* shared memory for Fifos start */
445     + dma_addr_t dma; /* dma handle for Fifos */
446     void *fifos; /* FIFO memory */
447     int last_bfifo_cnt[2]; /* marker saving last b-fifo frame count */
448     struct timer_list timer;
449     diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
450     index 61f5753..7830b01 100644
451     --- a/drivers/md/dm-mpath.c
452     +++ b/drivers/md/dm-mpath.c
453     @@ -540,6 +540,12 @@ static int parse_path_selector(struct arg_set *as, struct priority_group *pg,
454     return -EINVAL;
455     }
456    
457     + if (ps_argc > as->argc) {
458     + dm_put_path_selector(pst);
459     + ti->error = "not enough arguments for path selector";
460     + return -EINVAL;
461     + }
462     +
463     r = pst->create(&pg->ps, ps_argc, as->argv);
464     if (r) {
465     dm_put_path_selector(pst);
466     @@ -684,6 +690,11 @@ static int parse_hw_handler(struct arg_set *as, struct multipath *m)
467     if (!hw_argc)
468     return 0;
469    
470     + if (hw_argc > as->argc) {
471     + ti->error = "not enough arguments for hardware handler";
472     + return -EINVAL;
473     + }
474     +
475     m->hw_handler_name = kstrdup(shift(as), GFP_KERNEL);
476     request_module("scsi_dh_%s", m->hw_handler_name);
477     if (scsi_dh_handler_exist(m->hw_handler_name) == 0) {
478     diff --git a/drivers/md/dm.c b/drivers/md/dm.c
479     index ace998c..925efaf 100644
480     --- a/drivers/md/dm.c
481     +++ b/drivers/md/dm.c
482     @@ -265,6 +265,10 @@ static int dm_blk_open(struct inode *inode, struct file *file)
483     goto out;
484     }
485    
486     + if (test_bit(DMF_FREEING, &md->flags) ||
487     + test_bit(DMF_DELETING, &md->flags))
488     + return NULL;
489     +
490     dm_get(md);
491     atomic_inc(&md->open_count);
492    
493     diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
494     index 224de02..562ab63 100644
495     --- a/drivers/md/raid5.c
496     +++ b/drivers/md/raid5.c
497     @@ -3431,6 +3431,7 @@ static int make_request(struct request_queue *q, struct bio * bi)
498     spin_unlock_irq(&conf->device_lock);
499     if (must_retry) {
500     release_stripe(sh);
501     + schedule();
502     goto retry;
503     }
504     }
505     diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
506     index 3bdb473..f164239 100644
507     --- a/drivers/net/bonding/bond_sysfs.c
508     +++ b/drivers/net/bonding/bond_sysfs.c
509     @@ -1464,6 +1464,7 @@ int bond_create_sysfs(void)
510     printk(KERN_ERR
511     "network device named %s already exists in sysfs",
512     class_attr_bonding_masters.attr.name);
513     + ret = 0;
514     }
515    
516     return ret;
517     diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
518     index a98d31a..5952522 100644
519     --- a/drivers/net/r8169.c
520     +++ b/drivers/net/r8169.c
521     @@ -65,7 +65,6 @@ static const int multicast_filter_limit = 32;
522     #define RX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */
523     #define TX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */
524     #define EarlyTxThld 0x3F /* 0x3F means NO early transmit */
525     -#define RxPacketMaxSize 0x3FE8 /* 16K - 1 - ETH_HLEN - VLAN - CRC... */
526     #define SafeMtu 0x1c20 /* ... actually life sucks beyond ~7k */
527     #define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */
528    
529     @@ -1976,10 +1975,10 @@ static u16 rtl_rw_cpluscmd(void __iomem *ioaddr)
530     return cmd;
531     }
532    
533     -static void rtl_set_rx_max_size(void __iomem *ioaddr)
534     +static void rtl_set_rx_max_size(void __iomem *ioaddr, unsigned int rx_buf_sz)
535     {
536     /* Low hurts. Let's disable the filtering. */
537     - RTL_W16(RxMaxSize, 16383);
538     + RTL_W16(RxMaxSize, rx_buf_sz);
539     }
540    
541     static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version)
542     @@ -2026,7 +2025,7 @@ static void rtl_hw_start_8169(struct net_device *dev)
543    
544     RTL_W8(EarlyTxThres, EarlyTxThld);
545    
546     - rtl_set_rx_max_size(ioaddr);
547     + rtl_set_rx_max_size(ioaddr, tp->rx_buf_sz);
548    
549     if ((tp->mac_version == RTL_GIGA_MAC_VER_01) ||
550     (tp->mac_version == RTL_GIGA_MAC_VER_02) ||
551     @@ -2090,7 +2089,7 @@ static void rtl_hw_start_8168(struct net_device *dev)
552    
553     RTL_W8(EarlyTxThres, EarlyTxThld);
554    
555     - rtl_set_rx_max_size(ioaddr);
556     + rtl_set_rx_max_size(ioaddr, tp->rx_buf_sz);
557    
558     rtl_set_rx_tx_config_registers(tp);
559    
560     @@ -2142,7 +2141,7 @@ static void rtl_hw_start_8101(struct net_device *dev)
561    
562     RTL_W8(EarlyTxThres, EarlyTxThld);
563    
564     - rtl_set_rx_max_size(ioaddr);
565     + rtl_set_rx_max_size(ioaddr, tp->rx_buf_sz);
566    
567     tp->cp_cmd |= rtl_rw_cpluscmd(ioaddr) | PCIMulRW;
568    
569     diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
570     index 8a846ad..7f0c60c 100644
571     --- a/drivers/parport/parport_pc.c
572     +++ b/drivers/parport/parport_pc.c
573     @@ -1413,11 +1413,13 @@ static void __devinit decode_smsc(int efer, int key, int devid, int devrev)
574    
575     static void __devinit winbond_check(int io, int key)
576     {
577     - int devid,devrev,oldid,x_devid,x_devrev,x_oldid;
578     + int origval, devid, devrev, oldid, x_devid, x_devrev, x_oldid;
579    
580     if (!request_region(io, 3, __func__))
581     return;
582    
583     + origval = inb(io); /* Save original value */
584     +
585     /* First probe without key */
586     outb(0x20,io);
587     x_devid=inb(io+1);
588     @@ -1437,6 +1439,8 @@ static void __devinit winbond_check(int io, int key)
589     oldid=inb(io+1);
590     outb(0xaa,io); /* Magic Seal */
591    
592     + outb(origval, io); /* in case we poked some entirely different hardware */
593     +
594     if ((x_devid == devid) && (x_devrev == devrev) && (x_oldid == oldid))
595     goto out; /* protection against false positives */
596    
597     @@ -1447,11 +1451,15 @@ out:
598    
599     static void __devinit winbond_check2(int io,int key)
600     {
601     - int devid,devrev,oldid,x_devid,x_devrev,x_oldid;
602     + int origval[3], devid, devrev, oldid, x_devid, x_devrev, x_oldid;
603    
604     if (!request_region(io, 3, __func__))
605     return;
606    
607     + origval[0] = inb(io); /* Save original values */
608     + origval[1] = inb(io + 1);
609     + origval[2] = inb(io + 2);
610     +
611     /* First probe without the key */
612     outb(0x20,io+2);
613     x_devid=inb(io+2);
614     @@ -1470,6 +1478,10 @@ static void __devinit winbond_check2(int io,int key)
615     oldid=inb(io+2);
616     outb(0xaa,io); /* Magic Seal */
617    
618     + outb(origval[0], io); /* in case we poked some entirely different hardware */
619     + outb(origval[1], io + 1);
620     + outb(origval[2], io + 2);
621     +
622     if ((x_devid == devid) && (x_devrev == devrev) && (x_oldid == oldid))
623     goto out; /* protection against false positives */
624    
625     @@ -1480,11 +1492,13 @@ out:
626    
627     static void __devinit smsc_check(int io, int key)
628     {
629     - int id,rev,oldid,oldrev,x_id,x_rev,x_oldid,x_oldrev;
630     + int origval, id, rev, oldid, oldrev, x_id, x_rev, x_oldid, x_oldrev;
631    
632     if (!request_region(io, 3, __func__))
633     return;
634    
635     + origval = inb(io); /* Save original value */
636     +
637     /* First probe without the key */
638     outb(0x0d,io);
639     x_oldid=inb(io+1);
640     @@ -1508,6 +1522,8 @@ static void __devinit smsc_check(int io, int key)
641     rev=inb(io+1);
642     outb(0xaa,io); /* Magic Seal */
643    
644     + outb(origval, io); /* in case we poked some entirely different hardware */
645     +
646     if ((x_id == id) && (x_oldrev == oldrev) &&
647     (x_oldid == oldid) && (x_rev == rev))
648     goto out; /* protection against false positives */
649     @@ -1544,11 +1560,12 @@ static void __devinit detect_and_report_smsc (void)
650     static void __devinit detect_and_report_it87(void)
651     {
652     u16 dev;
653     - u8 r;
654     + u8 origval, r;
655     if (verbose_probing)
656     printk(KERN_DEBUG "IT8705 Super-IO detection, now testing port 2E ...\n");
657     - if (!request_region(0x2e, 1, __func__))
658     + if (!request_region(0x2e, 2, __func__))
659     return;
660     + origval = inb(0x2e); /* Save original value */
661     outb(0x87, 0x2e);
662     outb(0x01, 0x2e);
663     outb(0x55, 0x2e);
664     @@ -1568,8 +1585,10 @@ static void __devinit detect_and_report_it87(void)
665     outb(r | 8, 0x2F);
666     outb(0x02, 0x2E); /* Lock */
667     outb(0x02, 0x2F);
668     + } else {
669     + outb(origval, 0x2e); /* Oops, sorry to disturb */
670     }
671     - release_region(0x2e, 1);
672     + release_region(0x2e, 2);
673     }
674     #endif /* CONFIG_PARPORT_PC_SUPERIO */
675    
676     @@ -2192,6 +2211,9 @@ struct parport *parport_pc_probe_port (unsigned long int base,
677     if (IS_ERR(pdev))
678     return NULL;
679     dev = &pdev->dev;
680     +
681     + dev->coherent_dma_mask = DMA_BIT_MASK(24);
682     + dev->dma_mask = &dev->coherent_dma_mask;
683     }
684    
685     ops = kmalloc(sizeof (struct parport_operations), GFP_KERNEL);
686     diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c
687     index 032db81..f349211 100644
688     --- a/drivers/parport/parport_serial.c
689     +++ b/drivers/parport/parport_serial.c
690     @@ -30,6 +30,7 @@ enum parport_pc_pci_cards {
691     titan_210l,
692     netmos_9xx5_combo,
693     netmos_9855,
694     + netmos_9855_2p,
695     avlab_1s1p,
696     avlab_1s2p,
697     avlab_2s1p,
698     @@ -62,7 +63,7 @@ struct parport_pc_pci {
699     struct parport_pc_pci *card, int failed);
700     };
701    
702     -static int __devinit netmos_parallel_init(struct pci_dev *dev, struct parport_pc_pci *card, int autoirq, int autodma)
703     +static int __devinit netmos_parallel_init(struct pci_dev *dev, struct parport_pc_pci *par, int autoirq, int autodma)
704     {
705     /* the rule described below doesn't hold for this device */
706     if (dev->device == PCI_DEVICE_ID_NETMOS_9835 &&
707     @@ -74,9 +75,17 @@ static int __devinit netmos_parallel_init(struct pci_dev *dev, struct parport_pc
708     * and serial ports. The form is 0x00PS, where <P> is the number of
709     * parallel ports and <S> is the number of serial ports.
710     */
711     - card->numports = (dev->subsystem_device & 0xf0) >> 4;
712     - if (card->numports > ARRAY_SIZE(card->addr))
713     - card->numports = ARRAY_SIZE(card->addr);
714     + par->numports = (dev->subsystem_device & 0xf0) >> 4;
715     + if (par->numports > ARRAY_SIZE(par->addr))
716     + par->numports = ARRAY_SIZE(par->addr);
717     + /*
718     + * This function is currently only called for cards with up to
719     + * one parallel port.
720     + * Parallel port BAR is either before or after serial ports BARS;
721     + * hence, lo should be either 0 or equal to the number of serial ports.
722     + */
723     + if (par->addr[0].lo != 0)
724     + par->addr[0].lo = dev->subsystem_device & 0xf;
725     return 0;
726     }
727    
728     @@ -84,7 +93,8 @@ static struct parport_pc_pci cards[] __devinitdata = {
729     /* titan_110l */ { 1, { { 3, -1 }, } },
730     /* titan_210l */ { 1, { { 3, -1 }, } },
731     /* netmos_9xx5_combo */ { 1, { { 2, -1 }, }, netmos_parallel_init },
732     - /* netmos_9855 */ { 1, { { 2, -1 }, }, netmos_parallel_init },
733     + /* netmos_9855 */ { 1, { { 0, -1 }, }, netmos_parallel_init },
734     + /* netmos_9855_2p */ { 2, { { 0, -1 }, { 2, -1 }, } },
735     /* avlab_1s1p */ { 1, { { 1, 2}, } },
736     /* avlab_1s2p */ { 2, { { 1, 2}, { 3, 4 },} },
737     /* avlab_2s1p */ { 1, { { 2, 3}, } },
738     @@ -110,6 +120,10 @@ static struct pci_device_id parport_serial_pci_tbl[] = {
739     { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9845,
740     PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9xx5_combo },
741     { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9855,
742     + 0x1000, 0x0020, 0, 0, netmos_9855_2p },
743     + { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9855,
744     + 0x1000, 0x0022, 0, 0, netmos_9855_2p },
745     + { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9855,
746     PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9855 },
747     /* PCI_VENDOR_ID_AVLAB/Intek21 has another bunch of cards ...*/
748     { PCI_VENDOR_ID_AFAVLAB, 0x2110,
749     @@ -192,6 +206,12 @@ static struct pciserial_board pci_parport_serial_boards[] __devinitdata = {
750     .uart_offset = 8,
751     },
752     [netmos_9855] = {
753     + .flags = FL_BASE2 | FL_BASE_BARS,
754     + .num_ports = 1,
755     + .base_baud = 115200,
756     + .uart_offset = 8,
757     + },
758     + [netmos_9855_2p] = {
759     .flags = FL_BASE4 | FL_BASE_BARS,
760     .num_ports = 1,
761     .base_baud = 115200,
762     diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
763     index 409e00e..33cc148 100644
764     --- a/drivers/pci/pci.c
765     +++ b/drivers/pci/pci.c
766     @@ -473,6 +473,8 @@ pci_raw_set_power_state(struct pci_dev *dev, pci_power_t state)
767     pmcsr &= ~PCI_PM_CTRL_STATE_MASK;
768     pmcsr |= state;
769     break;
770     + case PCI_D3hot:
771     + case PCI_D3cold:
772     case PCI_UNKNOWN: /* Boot-up */
773     if ((pmcsr & PCI_PM_CTRL_STATE_MASK) == PCI_D3hot
774     && !(pmcsr & PCI_PM_CTRL_NO_SOFT_RESET))
775     @@ -1184,15 +1186,14 @@ pci_power_t pci_target_state(struct pci_dev *dev)
776     default:
777     target_state = state;
778     }
779     + } else if (!dev->pm_cap) {
780     + target_state = PCI_D0;
781     } else if (device_may_wakeup(&dev->dev)) {
782     /*
783     * Find the deepest state from which the device can generate
784     * wake-up events, make it the target state and enable device
785     * to generate PME#.
786     */
787     - if (!dev->pm_cap)
788     - return PCI_POWER_ERROR;
789     -
790     if (dev->pme_support) {
791     while (target_state
792     && !(dev->pme_support & (1 << target_state)))
793     diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
794     index e4df84b..def3398 100644
795     --- a/drivers/pci/pcie/aspm.c
796     +++ b/drivers/pci/pcie/aspm.c
797     @@ -633,6 +633,10 @@ void pcie_aspm_init_link_state(struct pci_dev *pdev)
798     if (pdev->pcie_type != PCI_EXP_TYPE_ROOT_PORT &&
799     pdev->pcie_type != PCI_EXP_TYPE_DOWNSTREAM)
800     return;
801     + /* VIA has a strange chipset, root port is under a bridge */
802     + if (pdev->pcie_type == PCI_EXP_TYPE_ROOT_PORT &&
803     + pdev->bus->self)
804     + return;
805     down_read(&pci_bus_sem);
806     if (list_empty(&pdev->subordinate->devices))
807     goto out;
808     diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
809     index 75dac57..3105bdc 100644
810     --- a/drivers/video/atmel_lcdfb.c
811     +++ b/drivers/video/atmel_lcdfb.c
812     @@ -29,14 +29,8 @@
813    
814     /* configurable parameters */
815     #define ATMEL_LCDC_CVAL_DEFAULT 0xc8
816     -#define ATMEL_LCDC_DMA_BURST_LEN 8
817     -
818     -#if defined(CONFIG_ARCH_AT91SAM9263) || defined(CONFIG_ARCH_AT91CAP9) || \
819     - defined(CONFIG_ARCH_AT91SAM9RL)
820     -#define ATMEL_LCDC_FIFO_SIZE 2048
821     -#else
822     -#define ATMEL_LCDC_FIFO_SIZE 512
823     -#endif
824     +#define ATMEL_LCDC_DMA_BURST_LEN 8 /* words */
825     +#define ATMEL_LCDC_FIFO_SIZE 512 /* words */
826    
827     #if defined(CONFIG_ARCH_AT91)
828     #define ATMEL_LCDFB_FBINFO_DEFAULT (FBINFO_DEFAULT \
829     diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c
830     index ae08c05..558088d 100644
831     --- a/fs/jbd/commit.c
832     +++ b/fs/jbd/commit.c
833     @@ -238,7 +238,7 @@ write_out_data:
834     spin_lock(&journal->j_list_lock);
835     }
836     /* Someone already cleaned up the buffer? */
837     - if (!buffer_jbd(bh)
838     + if (!buffer_jbd(bh) || bh2jh(bh) != jh
839     || jh->b_transaction != commit_transaction
840     || jh->b_jlist != BJ_SyncData) {
841     jbd_unlock_bh_state(bh);
842     @@ -463,7 +463,9 @@ void journal_commit_transaction(journal_t *journal)
843     spin_lock(&journal->j_list_lock);
844     continue;
845     }
846     - if (buffer_jbd(bh) && jh->b_jlist == BJ_Locked) {
847     + if (buffer_jbd(bh) && bh2jh(bh) == jh &&
848     + jh->b_transaction == commit_transaction &&
849     + jh->b_jlist == BJ_Locked) {
850     __journal_unfile_buffer(jh);
851     jbd_unlock_bh_state(bh);
852     journal_remove_journal_head(bh);
853     diff --git a/include/linux/firmware-map.h b/include/linux/firmware-map.h
854     index 6e199c8..67e88a6 100644
855     --- a/include/linux/firmware-map.h
856     +++ b/include/linux/firmware-map.h
857     @@ -24,21 +24,17 @@
858     */
859     #ifdef CONFIG_FIRMWARE_MEMMAP
860    
861     -int firmware_map_add(resource_size_t start, resource_size_t end,
862     - const char *type);
863     -int firmware_map_add_early(resource_size_t start, resource_size_t end,
864     - const char *type);
865     +int firmware_map_add(u64 start, u64 end, const char *type);
866     +int firmware_map_add_early(u64 start, u64 end, const char *type);
867    
868     #else /* CONFIG_FIRMWARE_MEMMAP */
869    
870     -static inline int firmware_map_add(resource_size_t start, resource_size_t end,
871     - const char *type)
872     +static inline int firmware_map_add(u64 start, u64 end, const char *type)
873     {
874     return 0;
875     }
876    
877     -static inline int firmware_map_add_early(resource_size_t start,
878     - resource_size_t end, const char *type)
879     +static inline int firmware_map_add_early(u64 start, u64 end, const char *type)
880     {
881     return 0;
882     }
883     diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
884     index bf8f119..9f29d86 100644
885     --- a/include/linux/mlx4/qp.h
886     +++ b/include/linux/mlx4/qp.h
887     @@ -165,6 +165,7 @@ enum {
888     MLX4_WQE_CTRL_IP_CSUM = 1 << 4,
889     MLX4_WQE_CTRL_TCP_UDP_CSUM = 1 << 5,
890     MLX4_WQE_CTRL_INS_VLAN = 1 << 6,
891     + MLX4_WQE_CTRL_STRONG_ORDER = 1 << 7,
892     };
893    
894     struct mlx4_wqe_ctrl_seg {
895     diff --git a/kernel/acct.c b/kernel/acct.c
896     index a272f53..2dac228 100644
897     --- a/kernel/acct.c
898     +++ b/kernel/acct.c
899     @@ -215,6 +215,7 @@ static void acct_file_reopen(struct bsd_acct_struct *acct, struct file *file,
900     static int acct_on(char *name)
901     {
902     struct file *file;
903     + struct vfsmount *mnt;
904     int error;
905     struct pid_namespace *ns;
906     struct bsd_acct_struct *acct = NULL;
907     @@ -256,11 +257,12 @@ static int acct_on(char *name)
908     acct = NULL;
909     }
910    
911     - mnt_pin(file->f_path.mnt);
912     + mnt = file->f_path.mnt;
913     + mnt_pin(mnt);
914     acct_file_reopen(ns->bacct, file, ns);
915     spin_unlock(&acct_lock);
916    
917     - mntput(file->f_path.mnt); /* it's pinned, now give up active reference */
918     + mntput(mnt); /* it's pinned, now give up active reference */
919     kfree(acct);
920    
921     return 0;
922     diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
923     index 0b50481..d3dce7c 100644
924     --- a/lib/Kconfig.debug
925     +++ b/lib/Kconfig.debug
926     @@ -394,7 +394,7 @@ config LOCKDEP
927     bool
928     depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
929     select STACKTRACE
930     - select FRAME_POINTER if !X86 && !MIPS && !PPC
931     + select FRAME_POINTER if !MIPS && !PPC
932     select KALLSYMS
933     select KALLSYMS_ALL
934    
935     diff --git a/mm/page_alloc.c b/mm/page_alloc.c
936     index 4205f7f..85799e8 100644
937     --- a/mm/page_alloc.c
938     +++ b/mm/page_alloc.c
939     @@ -2764,7 +2764,7 @@ bad:
940     if (dzone == zone)
941     break;
942     kfree(zone_pcp(dzone, cpu));
943     - zone_pcp(dzone, cpu) = NULL;
944     + zone_pcp(dzone, cpu) = &boot_pageset[cpu];
945     }
946     return -ENOMEM;
947     }
948     @@ -2779,7 +2779,7 @@ static inline void free_zone_pagesets(int cpu)
949     /* Free per_cpu_pageset if it is slab allocated */
950     if (pset != &boot_pageset[cpu])
951     kfree(pset);
952     - zone_pcp(zone, cpu) = NULL;
953     + zone_pcp(zone, cpu) = &boot_pageset[cpu];
954     }
955     }
956    
957     @@ -4409,6 +4409,8 @@ int percpu_pagelist_fraction_sysctl_handler(ctl_table *table, int write,
958     if (!write || (ret == -EINVAL))
959     return ret;
960     for_each_zone(zone) {
961     + if (!populated_zone(zone))
962     + continue;
963     for_each_online_cpu(cpu) {
964     unsigned long high;
965     high = zone->present_pages / percpu_pagelist_fraction;
966     diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
967     index 011478e..0b3c404 100644
968     --- a/net/ipv4/tcp_ipv4.c
969     +++ b/net/ipv4/tcp_ipv4.c
970     @@ -1364,6 +1364,10 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
971     tcp_mtup_init(newsk);
972     tcp_sync_mss(newsk, dst_mtu(dst));
973     newtp->advmss = dst_metric(dst, RTAX_ADVMSS);
974     + if (tcp_sk(sk)->rx_opt.user_mss &&
975     + tcp_sk(sk)->rx_opt.user_mss < newtp->advmss)
976     + newtp->advmss = tcp_sk(sk)->rx_opt.user_mss;
977     +
978     tcp_initialize_rcv_mss(newsk);
979    
980     #ifdef CONFIG_TCP_MD5SIG
981     diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
982     index d083f9a..c89cd75 100644
983     --- a/net/ipv4/tcp_output.c
984     +++ b/net/ipv4/tcp_output.c
985     @@ -2252,6 +2252,7 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst,
986     struct sk_buff *skb;
987     struct tcp_md5sig_key *md5;
988     __u8 *md5_hash_location;
989     + int mss;
990    
991     skb = sock_wmalloc(sk, MAX_TCP_HEADER + 15, 1, GFP_ATOMIC);
992     if (skb == NULL)
993     @@ -2262,13 +2263,17 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst,
994    
995     skb->dst = dst_clone(dst);
996    
997     + mss = dst_metric(dst, RTAX_ADVMSS);
998     + if (tp->rx_opt.user_mss && tp->rx_opt.user_mss < mss)
999     + mss = tp->rx_opt.user_mss;
1000     +
1001     if (req->rcv_wnd == 0) { /* ignored for retransmitted syns */
1002     __u8 rcv_wscale;
1003     /* Set this up on the first call only */
1004     req->window_clamp = tp->window_clamp ? : dst_metric(dst, RTAX_WINDOW);
1005     /* tcp_full_space because it is guaranteed to be the first packet */
1006     tcp_select_initial_window(tcp_full_space(sk),
1007     - dst_metric(dst, RTAX_ADVMSS) - (ireq->tstamp_ok ? TCPOLEN_TSTAMP_ALIGNED : 0),
1008     + mss - (ireq->tstamp_ok ? TCPOLEN_TSTAMP_ALIGNED : 0),
1009     &req->rcv_wnd,
1010     &req->window_clamp,
1011     ireq->wscale_ok,
1012     @@ -2283,8 +2288,7 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst,
1013     else
1014     #endif
1015     TCP_SKB_CB(skb)->when = tcp_time_stamp;
1016     - tcp_header_size = tcp_synack_options(sk, req,
1017     - dst_metric(dst, RTAX_ADVMSS),
1018     + tcp_header_size = tcp_synack_options(sk, req, mss,
1019     skb, &opts, &md5) +
1020     sizeof(struct tcphdr);
1021    
1022     @@ -2353,6 +2357,9 @@ static void tcp_connect_init(struct sock *sk)
1023     if (!tp->window_clamp)
1024     tp->window_clamp = dst_metric(dst, RTAX_WINDOW);
1025     tp->advmss = dst_metric(dst, RTAX_ADVMSS);
1026     + if (tp->rx_opt.user_mss && tp->rx_opt.user_mss < tp->advmss)
1027     + tp->advmss = tp->rx_opt.user_mss;
1028     +
1029     tcp_initialize_rcv_mss(sk);
1030    
1031     tcp_select_initial_window(tcp_full_space(sk),
1032     diff --git a/scripts/unifdef.c b/scripts/unifdef.c
1033     index 552025e..05a31a6 100644
1034     --- a/scripts/unifdef.c
1035     +++ b/scripts/unifdef.c
1036     @@ -206,7 +206,7 @@ static void done(void);
1037     static void error(const char *);
1038     static int findsym(const char *);
1039     static void flushline(bool);
1040     -static Linetype getline(void);
1041     +static Linetype get_line(void);
1042     static Linetype ifeval(const char **);
1043     static void ignoreoff(void);
1044     static void ignoreon(void);
1045     @@ -512,7 +512,7 @@ process(void)
1046    
1047     for (;;) {
1048     linenum++;
1049     - lineval = getline();
1050     + lineval = get_line();
1051     trans_table[ifstate[depth]][lineval]();
1052     debug("process %s -> %s depth %d",
1053     linetype_name[lineval],
1054     @@ -526,7 +526,7 @@ process(void)
1055     * help from skipcomment().
1056     */
1057     static Linetype
1058     -getline(void)
1059     +get_line(void)
1060     {
1061     const char *cp;
1062     int cursym;
1063     diff --git a/sound/core/seq/seq_midi_event.c b/sound/core/seq/seq_midi_event.c
1064     index 8284f17..b5d6ea4 100644
1065     --- a/sound/core/seq/seq_midi_event.c
1066     +++ b/sound/core/seq/seq_midi_event.c
1067     @@ -504,10 +504,10 @@ static int extra_decode_xrpn(struct snd_midi_event *dev, unsigned char *buf,
1068     if (dev->nostat && count < 12)
1069     return -ENOMEM;
1070     cmd = MIDI_CMD_CONTROL|(ev->data.control.channel & 0x0f);
1071     - bytes[0] = ev->data.control.param & 0x007f;
1072     - bytes[1] = (ev->data.control.param & 0x3f80) >> 7;
1073     - bytes[2] = ev->data.control.value & 0x007f;
1074     - bytes[3] = (ev->data.control.value & 0x3f80) >> 7;
1075     + bytes[0] = (ev->data.control.param & 0x3f80) >> 7;
1076     + bytes[1] = ev->data.control.param & 0x007f;
1077     + bytes[2] = (ev->data.control.value & 0x3f80) >> 7;
1078     + bytes[3] = ev->data.control.value & 0x007f;
1079     if (cmd != dev->lastcmd && !dev->nostat) {
1080     if (count < 9)
1081     return -ENOMEM;
1082     diff --git a/sound/pci/ca0106/ca0106_mixer.c b/sound/pci/ca0106/ca0106_mixer.c
1083     index 3025ed1..c0f4718 100644
1084     --- a/sound/pci/ca0106/ca0106_mixer.c
1085     +++ b/sound/pci/ca0106/ca0106_mixer.c
1086     @@ -761,6 +761,9 @@ int __devinit snd_ca0106_mixer(struct snd_ca0106 *emu)
1087     snd_ca0106_master_db_scale);
1088     if (!vmaster)
1089     return -ENOMEM;
1090     + err = snd_ctl_add(card, vmaster);
1091     + if (err < 0)
1092     + return err;
1093     add_slaves(card, vmaster, slave_vols);
1094    
1095     if (emu->details->spi_dac == 1) {
1096     @@ -768,6 +771,9 @@ int __devinit snd_ca0106_mixer(struct snd_ca0106 *emu)
1097     NULL);
1098     if (!vmaster)
1099     return -ENOMEM;
1100     + err = snd_ctl_add(card, vmaster);
1101     + if (err < 0)
1102     + return err;
1103     add_slaves(card, vmaster, slave_sws);
1104     }
1105     return 0;