/[linux-patches]/genpatches-2.6/trunk/3.0/1058_linux-3.0.59.patch
Gentoo

Contents of /genpatches-2.6/trunk/3.0/1058_linux-3.0.59.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2267 - (hide annotations) (download)
Tue Jan 29 00:51:38 2013 UTC (17 months, 1 week ago) by mpagano
File size: 118495 byte(s)
Linux patches 3.0.58, 3.0.59, 3.0.60 and 3.0.61
1 mpagano 2267 diff --git a/Makefile b/Makefile
2     index 9564edf..d1b37fc 100644
3     --- a/Makefile
4     +++ b/Makefile
5     @@ -1,6 +1,6 @@
6     VERSION = 3
7     PATCHLEVEL = 0
8     -SUBLEVEL = 58
9     +SUBLEVEL = 59
10     EXTRAVERSION =
11     NAME = Sneaky Weasel
12    
13     diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
14     index ba50409..e8befef 100644
15     --- a/arch/powerpc/kernel/head_64.S
16     +++ b/arch/powerpc/kernel/head_64.S
17     @@ -425,7 +425,7 @@ _STATIC(__after_prom_start)
18     tovirt(r6,r6) /* on booke, we already run at PAGE_OFFSET */
19     #endif
20    
21     -#ifdef CONFIG_CRASH_DUMP
22     +#ifdef CONFIG_RELOCATABLE
23     /*
24     * Check if the kernel has to be running as relocatable kernel based on the
25     * variable __run_at_load, if it is set the kernel is treated as relocatable
26     diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
27     index 1becd7b..818d809 100644
28     --- a/arch/powerpc/kernel/time.c
29     +++ b/arch/powerpc/kernel/time.c
30     @@ -859,13 +859,8 @@ void update_vsyscall(struct timespec *wall_time, struct timespec *wtm,
31    
32     void update_vsyscall_tz(void)
33     {
34     - /* Make userspace gettimeofday spin until we're done. */
35     - ++vdso_data->tb_update_count;
36     - smp_mb();
37     vdso_data->tz_minuteswest = sys_tz.tz_minuteswest;
38     vdso_data->tz_dsttime = sys_tz.tz_dsttime;
39     - smp_mb();
40     - ++vdso_data->tb_update_count;
41     }
42    
43     static void __init clocksource_init(void)
44     diff --git a/arch/powerpc/kvm/44x_emulate.c b/arch/powerpc/kvm/44x_emulate.c
45     index 549bb2c..ded8a1a 100644
46     --- a/arch/powerpc/kvm/44x_emulate.c
47     +++ b/arch/powerpc/kvm/44x_emulate.c
48     @@ -79,6 +79,7 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
49     run->dcr.dcrn = dcrn;
50     run->dcr.data = 0;
51     run->dcr.is_write = 0;
52     + vcpu->arch.dcr_is_write = 0;
53     vcpu->arch.io_gpr = rt;
54     vcpu->arch.dcr_needed = 1;
55     kvmppc_account_exit(vcpu, DCR_EXITS);
56     @@ -100,6 +101,7 @@ int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
57     run->dcr.dcrn = dcrn;
58     run->dcr.data = kvmppc_get_gpr(vcpu, rs);
59     run->dcr.is_write = 1;
60     + vcpu->arch.dcr_is_write = 1;
61     vcpu->arch.dcr_needed = 1;
62     kvmppc_account_exit(vcpu, DCR_EXITS);
63     emulated = EMULATE_DO_DCR;
64     diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
65     index 3f4b6da..a93741d 100644
66     --- a/arch/x86/kernel/cpu/amd.c
67     +++ b/arch/x86/kernel/cpu/amd.c
68     @@ -568,6 +568,20 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
69     }
70     }
71    
72     + /*
73     + * The way access filter has a performance penalty on some workloads.
74     + * Disable it on the affected CPUs.
75     + */
76     + if ((c->x86 == 0x15) &&
77     + (c->x86_model >= 0x02) && (c->x86_model < 0x20)) {
78     + u64 val;
79     +
80     + if (!rdmsrl_safe(0xc0011021, &val) && !(val & 0x1E)) {
81     + val |= 0x1E;
82     + checking_wrmsrl(0xc0011021, val);
83     + }
84     + }
85     +
86     cpu_detect_cache_sizes(c);
87    
88     /* Multi core CPU? */
89     diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
90     index 8cb9742..ea1fe0a 100644
91     --- a/drivers/acpi/scan.c
92     +++ b/drivers/acpi/scan.c
93     @@ -789,8 +789,8 @@ acpi_bus_extract_wakeup_device_power_package(acpi_handle handle,
94     static void acpi_bus_set_run_wake_flags(struct acpi_device *device)
95     {
96     struct acpi_device_id button_device_ids[] = {
97     - {"PNP0C0D", 0},
98     {"PNP0C0C", 0},
99     + {"PNP0C0D", 0},
100     {"PNP0C0E", 0},
101     {"", 0},
102     };
103     @@ -802,6 +802,11 @@ static void acpi_bus_set_run_wake_flags(struct acpi_device *device)
104     /* Power button, Lid switch always enable wakeup */
105     if (!acpi_match_device_ids(device, button_device_ids)) {
106     device->wakeup.flags.run_wake = 1;
107     + if (!acpi_match_device_ids(device, &button_device_ids[1])) {
108     + /* Do not use Lid/sleep button for S5 wakeup */
109     + if (device->wakeup.sleep_state == ACPI_STATE_S5)
110     + device->wakeup.sleep_state = ACPI_STATE_S4;
111     + }
112     device_set_wakeup_capable(&device->dev, true);
113     return;
114     }
115     diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
116     index 600ede0..5a72e36 100644
117     --- a/drivers/ata/libata-core.c
118     +++ b/drivers/ata/libata-core.c
119     @@ -2543,6 +2543,7 @@ int ata_bus_probe(struct ata_port *ap)
120     * bus as we may be talking too fast.
121     */
122     dev->pio_mode = XFER_PIO_0;
123     + dev->dma_mode = 0xff;
124    
125     /* If the controller has a pio mode setup function
126     * then use it to set the chipset to rights. Don't
127     diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
128     index 311c92d..1cbb004 100644
129     --- a/drivers/ata/libata-eh.c
130     +++ b/drivers/ata/libata-eh.c
131     @@ -2602,6 +2602,7 @@ int ata_eh_reset(struct ata_link *link, int classify,
132     * bus as we may be talking too fast.
133     */
134     dev->pio_mode = XFER_PIO_0;
135     + dev->dma_mode = 0xff;
136    
137     /* If the controller has a pio mode setup function
138     * then use it to set the chipset to rights. Don't
139     diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
140     index 927f968..3b42a5d 100644
141     --- a/drivers/ata/libata-scsi.c
142     +++ b/drivers/ata/libata-scsi.c
143     @@ -308,7 +308,8 @@ ata_scsi_activity_show(struct device *dev, struct device_attribute *attr,
144     struct ata_port *ap = ata_shost_to_port(sdev->host);
145     struct ata_device *atadev = ata_scsi_find_dev(ap, sdev);
146    
147     - if (ap->ops->sw_activity_show && (ap->flags & ATA_FLAG_SW_ACTIVITY))
148     + if (atadev && ap->ops->sw_activity_show &&
149     + (ap->flags & ATA_FLAG_SW_ACTIVITY))
150     return ap->ops->sw_activity_show(atadev, buf);
151     return -EINVAL;
152     }
153     @@ -323,7 +324,8 @@ ata_scsi_activity_store(struct device *dev, struct device_attribute *attr,
154     enum sw_activity val;
155     int rc;
156    
157     - if (ap->ops->sw_activity_store && (ap->flags & ATA_FLAG_SW_ACTIVITY)) {
158     + if (atadev && ap->ops->sw_activity_store &&
159     + (ap->flags & ATA_FLAG_SW_ACTIVITY)) {
160     val = simple_strtoul(buf, NULL, 0);
161     switch (val) {
162     case OFF: case BLINK_ON: case BLINK_OFF:
163     diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c
164     index a004b1e..ca4646a 100644
165     --- a/drivers/ata/sata_promise.c
166     +++ b/drivers/ata/sata_promise.c
167     @@ -147,6 +147,10 @@ struct pdc_port_priv {
168     dma_addr_t pkt_dma;
169     };
170    
171     +struct pdc_host_priv {
172     + spinlock_t hard_reset_lock;
173     +};
174     +
175     static int pdc_sata_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val);
176     static int pdc_sata_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);
177     static int pdc_ata_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
178     @@ -801,9 +805,10 @@ static void pdc_hard_reset_port(struct ata_port *ap)
179     void __iomem *host_mmio = ap->host->iomap[PDC_MMIO_BAR];
180     void __iomem *pcictl_b1_mmio = host_mmio + PDC_PCI_CTL + 1;
181     unsigned int ata_no = pdc_ata_port_to_ata_no(ap);
182     + struct pdc_host_priv *hpriv = ap->host->private_data;
183     u8 tmp;
184    
185     - spin_lock(&ap->host->lock);
186     + spin_lock(&hpriv->hard_reset_lock);
187    
188     tmp = readb(pcictl_b1_mmio);
189     tmp &= ~(0x10 << ata_no);
190     @@ -814,7 +819,7 @@ static void pdc_hard_reset_port(struct ata_port *ap)
191     writeb(tmp, pcictl_b1_mmio);
192     readb(pcictl_b1_mmio); /* flush */
193    
194     - spin_unlock(&ap->host->lock);
195     + spin_unlock(&hpriv->hard_reset_lock);
196     }
197    
198     static int pdc_sata_hardreset(struct ata_link *link, unsigned int *class,
199     @@ -1183,6 +1188,7 @@ static int pdc_ata_init_one(struct pci_dev *pdev,
200     const struct ata_port_info *pi = &pdc_port_info[ent->driver_data];
201     const struct ata_port_info *ppi[PDC_MAX_PORTS];
202     struct ata_host *host;
203     + struct pdc_host_priv *hpriv;
204     void __iomem *host_mmio;
205     int n_ports, i, rc;
206     int is_sataii_tx4;
207     @@ -1220,6 +1226,11 @@ static int pdc_ata_init_one(struct pci_dev *pdev,
208     dev_printk(KERN_ERR, &pdev->dev, "failed to allocate host\n");
209     return -ENOMEM;
210     }
211     + hpriv = devm_kzalloc(&pdev->dev, sizeof *hpriv, GFP_KERNEL);
212     + if (!hpriv)
213     + return -ENOMEM;
214     + spin_lock_init(&hpriv->hard_reset_lock);
215     + host->private_data = hpriv;
216     host->iomap = pcim_iomap_table(pdev);
217    
218     is_sataii_tx4 = pdc_is_sataii_tx4(pi->flags);
219     diff --git a/drivers/block/aoe/aoe.h b/drivers/block/aoe/aoe.h
220     index db195ab..e49ddd0 100644
221     --- a/drivers/block/aoe/aoe.h
222     +++ b/drivers/block/aoe/aoe.h
223     @@ -1,5 +1,5 @@
224     /* Copyright (c) 2007 Coraid, Inc. See COPYING for GPL terms. */
225     -#define VERSION "47"
226     +#define VERSION "47q"
227     #define AOE_MAJOR 152
228     #define DEVICE_NAME "aoe"
229    
230     diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c
231     index 528f631..2a0fdae 100644
232     --- a/drivers/block/aoe/aoeblk.c
233     +++ b/drivers/block/aoe/aoeblk.c
234     @@ -277,8 +277,6 @@ aoeblk_gdalloc(void *vp)
235     goto err_mempool;
236     blk_queue_make_request(d->blkq, aoeblk_make_request);
237     d->blkq->backing_dev_info.name = "aoe";
238     - if (bdi_init(&d->blkq->backing_dev_info))
239     - goto err_blkq;
240     spin_lock_irqsave(&d->lock, flags);
241     gd->major = AOE_MAJOR;
242     gd->first_minor = d->sysminor * AOE_PARTITIONS;
243     @@ -299,9 +297,6 @@ aoeblk_gdalloc(void *vp)
244     aoedisk_add_sysfs(d);
245     return;
246    
247     -err_blkq:
248     - blk_cleanup_queue(d->blkq);
249     - d->blkq = NULL;
250     err_mempool:
251     mempool_destroy(d->bufpool);
252     err_disk:
253     diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
254     index b9762d0..e74750b 100644
255     --- a/drivers/firewire/net.c
256     +++ b/drivers/firewire/net.c
257     @@ -863,8 +863,8 @@ static void fwnet_receive_broadcast(struct fw_iso_context *context,
258     if (specifier_id == IANA_SPECIFIER_ID && ver == RFC2734_SW_VERSION) {
259     buf_ptr += 2;
260     length -= IEEE1394_GASP_HDR_SIZE;
261     - fwnet_incoming_packet(dev, buf_ptr, length,
262     - source_node_id, -1, true);
263     + fwnet_incoming_packet(dev, buf_ptr, length, source_node_id,
264     + context->card->generation, true);
265     }
266    
267     packet.payload_length = dev->rcv_buffer_size;
268     @@ -959,7 +959,12 @@ static void fwnet_transmit_packet_done(struct fwnet_packet_task *ptask)
269     break;
270     }
271    
272     - skb_pull(skb, ptask->max_payload);
273     + if (ptask->dest_node == IEEE1394_ALL_NODES) {
274     + skb_pull(skb,
275     + ptask->max_payload + IEEE1394_GASP_HDR_SIZE);
276     + } else {
277     + skb_pull(skb, ptask->max_payload);
278     + }
279     if (ptask->outstanding_pkts > 1) {
280     fwnet_make_sf_hdr(&ptask->hdr, RFC2374_HDR_INTFRAG,
281     dg_size, fg_off, datagram_label);
282     @@ -1062,7 +1067,7 @@ static int fwnet_send_packet(struct fwnet_packet_task *ptask)
283     smp_rmb();
284     node_id = dev->card->node_id;
285    
286     - p = skb_push(ptask->skb, 8);
287     + p = skb_push(ptask->skb, IEEE1394_GASP_HDR_SIZE);
288     put_unaligned_be32(node_id << 16 | IANA_SPECIFIER_ID >> 8, p);
289     put_unaligned_be32((IANA_SPECIFIER_ID & 0xff) << 24
290     | RFC2734_SW_VERSION, &p[4]);
291     diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
292     index 557e007..8fa4f7b 100644
293     --- a/drivers/gpu/drm/i915/i915_reg.h
294     +++ b/drivers/gpu/drm/i915/i915_reg.h
295     @@ -2754,6 +2754,8 @@
296     #define _PFA_CTL_1 0x68080
297     #define _PFB_CTL_1 0x68880
298     #define PF_ENABLE (1<<31)
299     +#define PF_PIPE_SEL_MASK_IVB (3<<29)
300     +#define PF_PIPE_SEL_IVB(pipe) ((pipe)<<29)
301     #define PF_FILTER_MASK (3<<23)
302     #define PF_FILTER_PROGRAMMED (0<<23)
303     #define PF_FILTER_MED_3x3 (1<<23)
304     diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
305     index 36d76989..d1dca92 100644
306     --- a/drivers/gpu/drm/i915/intel_display.c
307     +++ b/drivers/gpu/drm/i915/intel_display.c
308     @@ -2696,7 +2696,11 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc)
309     * as some pre-programmed values are broken,
310     * e.g. x201.
311     */
312     - I915_WRITE(PF_CTL(pipe), PF_ENABLE | PF_FILTER_MED_3x3);
313     + if (IS_IVYBRIDGE(dev))
314     + I915_WRITE(PF_CTL(pipe), PF_ENABLE | PF_FILTER_MED_3x3 |
315     + PF_PIPE_SEL_IVB(pipe));
316     + else
317     + I915_WRITE(PF_CTL(pipe), PF_ENABLE | PF_FILTER_MED_3x3);
318     I915_WRITE(PF_WIN_POS(pipe), dev_priv->pch_pf_pos);
319     I915_WRITE(PF_WIN_SZ(pipe), dev_priv->pch_pf_size);
320     }
321     diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
322     index 645f8aa..eebf002 100644
323     --- a/drivers/gpu/drm/i915/intel_lvds.c
324     +++ b/drivers/gpu/drm/i915/intel_lvds.c
325     @@ -753,14 +753,6 @@ static const struct dmi_system_id intel_no_lvds[] = {
326     },
327     {
328     .callback = intel_no_lvds_dmi_callback,
329     - .ident = "ZOTAC ZBOXSD-ID12/ID13",
330     - .matches = {
331     - DMI_MATCH(DMI_BOARD_VENDOR, "ZOTAC"),
332     - DMI_MATCH(DMI_BOARD_NAME, "ZBOXSD-ID12/ID13"),
333     - },
334     - },
335     - {
336     - .callback = intel_no_lvds_dmi_callback,
337     .ident = "Gigabyte GA-D525TUD",
338     .matches = {
339     DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co., Ltd."),
340     diff --git a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
341     index 8165953..a906803 100644
342     --- a/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
343     +++ b/drivers/gpu/drm/radeon/radeon_legacy_encoders.c
344     @@ -617,6 +617,14 @@ static enum drm_connector_status radeon_legacy_primary_dac_detect(struct drm_enc
345     enum drm_connector_status found = connector_status_disconnected;
346     bool color = true;
347    
348     + /* just don't bother on RN50 those chip are often connected to remoting
349     + * console hw and often we get failure to load detect those. So to make
350     + * everyone happy report the encoder as always connected.
351     + */
352     + if (ASIC_IS_RN50(rdev)) {
353     + return connector_status_connected;
354     + }
355     +
356     /* save the regs we need */
357     vclk_ecp_cntl = RREG32_PLL(RADEON_VCLK_ECP_CNTL);
358     crtc_ext_cntl = RREG32(RADEON_CRTC_EXT_CNTL);
359     diff --git a/drivers/infiniband/core/netlink.c b/drivers/infiniband/core/netlink.c
360     index 4a5abaf..9227f4a 100644
361     --- a/drivers/infiniband/core/netlink.c
362     +++ b/drivers/infiniband/core/netlink.c
363     @@ -148,7 +148,7 @@ static int ibnl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
364     return -EINVAL;
365     return netlink_dump_start(nls, skb, nlh,
366     client->cb_table[op].dump,
367     - NULL);
368     + NULL, 0);
369     }
370     }
371    
372     diff --git a/drivers/infiniband/hw/nes/nes.h b/drivers/infiniband/hw/nes/nes.h
373     index 6fe7987..6e30273 100644
374     --- a/drivers/infiniband/hw/nes/nes.h
375     +++ b/drivers/infiniband/hw/nes/nes.h
376     @@ -511,6 +511,7 @@ void nes_iwarp_ce_handler(struct nes_device *, struct nes_hw_cq *);
377     int nes_destroy_cqp(struct nes_device *);
378     int nes_nic_cm_xmit(struct sk_buff *, struct net_device *);
379     void nes_recheck_link_status(struct work_struct *work);
380     +void nes_terminate_timeout(unsigned long context);
381    
382     /* nes_nic.c */
383     struct net_device *nes_netdev_init(struct nes_device *, void __iomem *);
384     diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c
385     index 96fa9a4..ba4814a 100644
386     --- a/drivers/infiniband/hw/nes/nes_hw.c
387     +++ b/drivers/infiniband/hw/nes/nes_hw.c
388     @@ -75,7 +75,6 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev,
389     static void process_critical_error(struct nes_device *nesdev);
390     static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number);
391     static unsigned int nes_reset_adapter_ne020(struct nes_device *nesdev, u8 *OneG_Mode);
392     -static void nes_terminate_timeout(unsigned long context);
393     static void nes_terminate_start_timer(struct nes_qp *nesqp);
394    
395     #ifdef CONFIG_INFINIBAND_NES_DEBUG
396     @@ -3496,7 +3495,7 @@ static void nes_terminate_received(struct nes_device *nesdev,
397     }
398    
399     /* Timeout routine in case terminate fails to complete */
400     -static void nes_terminate_timeout(unsigned long context)
401     +void nes_terminate_timeout(unsigned long context)
402     {
403     struct nes_qp *nesqp = (struct nes_qp *)(unsigned long)context;
404    
405     @@ -3506,11 +3505,7 @@ static void nes_terminate_timeout(unsigned long context)
406     /* Set a timer in case hw cannot complete the terminate sequence */
407     static void nes_terminate_start_timer(struct nes_qp *nesqp)
408     {
409     - init_timer(&nesqp->terminate_timer);
410     - nesqp->terminate_timer.function = nes_terminate_timeout;
411     - nesqp->terminate_timer.expires = jiffies + HZ;
412     - nesqp->terminate_timer.data = (unsigned long)nesqp;
413     - add_timer(&nesqp->terminate_timer);
414     + mod_timer(&nesqp->terminate_timer, (jiffies + HZ));
415     }
416    
417     /**
418     diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
419     index 95ca93c..59db49f 100644
420     --- a/drivers/infiniband/hw/nes/nes_verbs.c
421     +++ b/drivers/infiniband/hw/nes/nes_verbs.c
422     @@ -1414,6 +1414,9 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd,
423     }
424    
425     nesqp->sig_all = (init_attr->sq_sig_type == IB_SIGNAL_ALL_WR);
426     + init_timer(&nesqp->terminate_timer);
427     + nesqp->terminate_timer.function = nes_terminate_timeout;
428     + nesqp->terminate_timer.data = (unsigned long)nesqp;
429    
430     /* update the QP table */
431     nesdev->nesadapter->qp_table[nesqp->hwqp.qp_id-NES_FIRST_QPN] = nesqp;
432     @@ -1423,7 +1426,6 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd,
433     return &nesqp->ibqp;
434     }
435    
436     -
437     /**
438     * nes_clean_cq
439     */
440     @@ -2568,6 +2570,11 @@ static struct ib_mr *nes_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
441     return ibmr;
442     case IWNES_MEMREG_TYPE_QP:
443     case IWNES_MEMREG_TYPE_CQ:
444     + if (!region->length) {
445     + nes_debug(NES_DBG_MR, "Unable to register zero length region for CQ\n");
446     + ib_umem_release(region);
447     + return ERR_PTR(-EINVAL);
448     + }
449     nespbl = kzalloc(sizeof(*nespbl), GFP_KERNEL);
450     if (!nespbl) {
451     nes_debug(NES_DBG_MR, "Unable to allocate PBL\n");
452     diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
453     index 4cacdad..bd3b294 100644
454     --- a/drivers/md/dm-ioctl.c
455     +++ b/drivers/md/dm-ioctl.c
456     @@ -1524,6 +1524,14 @@ static int copy_params(struct dm_ioctl __user *user, struct dm_ioctl **param)
457     if (copy_from_user(dmi, user, tmp.data_size))
458     goto bad;
459    
460     + /*
461     + * Abort if something changed the ioctl data while it was being copied.
462     + */
463     + if (dmi->data_size != tmp.data_size) {
464     + DMERR("rejecting ioctl: data size modified while processing parameters");
465     + goto bad;
466     + }
467     +
468     /* Wipe the user buffer so we do not return it to userspace */
469     if (secure_data && clear_user(user, tmp.data_size))
470     goto bad;
471     diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
472     index acf9dad..b36aadb 100644
473     --- a/drivers/mfd/mfd-core.c
474     +++ b/drivers/mfd/mfd-core.c
475     @@ -18,6 +18,10 @@
476     #include <linux/pm_runtime.h>
477     #include <linux/slab.h>
478    
479     +static struct device_type mfd_dev_type = {
480     + .name = "mfd_device",
481     +};
482     +
483     int mfd_cell_enable(struct platform_device *pdev)
484     {
485     const struct mfd_cell *cell = mfd_get_cell(pdev);
486     @@ -87,6 +91,7 @@ static int mfd_add_device(struct device *parent, int id,
487     goto fail_device;
488    
489     pdev->dev.parent = parent;
490     + pdev->dev.type = &mfd_dev_type;
491    
492     if (cell->pdata_size) {
493     ret = platform_device_add_data(pdev,
494     @@ -182,10 +187,16 @@ EXPORT_SYMBOL(mfd_add_devices);
495    
496     static int mfd_remove_devices_fn(struct device *dev, void *c)
497     {
498     - struct platform_device *pdev = to_platform_device(dev);
499     - const struct mfd_cell *cell = mfd_get_cell(pdev);
500     + struct platform_device *pdev;
501     + const struct mfd_cell *cell;
502     atomic_t **usage_count = c;
503    
504     + if (dev->type != &mfd_dev_type)
505     + return 0;
506     +
507     + pdev = to_platform_device(dev);
508     + cell = mfd_get_cell(pdev);
509     +
510     /* find the base address of usage_count pointers (for freeing) */
511     if (!*usage_count || (cell->usage_count < *usage_count))
512     *usage_count = cell->usage_count;
513     diff --git a/drivers/net/wimax/i2400m/i2400m-usb.h b/drivers/net/wimax/i2400m/i2400m-usb.h
514     index 6650fde..9f1e947 100644
515     --- a/drivers/net/wimax/i2400m/i2400m-usb.h
516     +++ b/drivers/net/wimax/i2400m/i2400m-usb.h
517     @@ -152,6 +152,9 @@ enum {
518     /* Device IDs */
519     USB_DEVICE_ID_I6050 = 0x0186,
520     USB_DEVICE_ID_I6050_2 = 0x0188,
521     + USB_DEVICE_ID_I6150 = 0x07d6,
522     + USB_DEVICE_ID_I6150_2 = 0x07d7,
523     + USB_DEVICE_ID_I6150_3 = 0x07d9,
524     USB_DEVICE_ID_I6250 = 0x0187,
525     };
526    
527     diff --git a/drivers/net/wimax/i2400m/usb.c b/drivers/net/wimax/i2400m/usb.c
528     index 298f2b0..0ddc8db 100644
529     --- a/drivers/net/wimax/i2400m/usb.c
530     +++ b/drivers/net/wimax/i2400m/usb.c
531     @@ -491,6 +491,9 @@ int i2400mu_probe(struct usb_interface *iface,
532     switch (id->idProduct) {
533     case USB_DEVICE_ID_I6050:
534     case USB_DEVICE_ID_I6050_2:
535     + case USB_DEVICE_ID_I6150:
536     + case USB_DEVICE_ID_I6150_2:
537     + case USB_DEVICE_ID_I6150_3:
538     case USB_DEVICE_ID_I6250:
539     i2400mu->i6050 = 1;
540     break;
541     @@ -740,6 +743,9 @@ static
542     struct usb_device_id i2400mu_id_table[] = {
543     { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050) },
544     { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050_2) },
545     + { USB_DEVICE(0x8087, USB_DEVICE_ID_I6150) },
546     + { USB_DEVICE(0x8087, USB_DEVICE_ID_I6150_2) },
547     + { USB_DEVICE(0x8087, USB_DEVICE_ID_I6150_3) },
548     { USB_DEVICE(0x8086, USB_DEVICE_ID_I6250) },
549     { USB_DEVICE(0x8086, 0x0181) },
550     { USB_DEVICE(0x8086, 0x1403) },
551     diff --git a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
552     index 029773c..c84c493 100644
553     --- a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
554     +++ b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
555     @@ -34,98 +34,98 @@ static const u32 ar9300_2p2_radio_postamble[][5] = {
556    
557     static const u32 ar9300Modes_lowest_ob_db_tx_gain_table_2p2[][5] = {
558     /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
559     - {0x0000a2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352},
560     - {0x0000a2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584},
561     - {0x0000a2e4, 0x03fc0000, 0x03fc0000, 0x03f0f800, 0x03f0f800},
562     + {0x0000a2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
563     + {0x0000a2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
564     + {0x0000a2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
565     {0x0000a2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
566     - {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9},
567     - {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
568     - {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002},
569     - {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004},
570     - {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200},
571     - {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202},
572     - {0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400},
573     - {0x0000a518, 0x21002220, 0x21002220, 0x16000402, 0x16000402},
574     - {0x0000a51c, 0x27002223, 0x27002223, 0x19000404, 0x19000404},
575     - {0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603},
576     - {0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02},
577     - {0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04},
578     - {0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20},
579     - {0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20},
580     - {0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22},
581     - {0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24},
582     - {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640},
583     - {0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660},
584     - {0x0000a544, 0x52022470, 0x52022470, 0x3f001861, 0x3f001861},
585     - {0x0000a548, 0x55022490, 0x55022490, 0x43001a81, 0x43001a81},
586     - {0x0000a54c, 0x59022492, 0x59022492, 0x47001a83, 0x47001a83},
587     - {0x0000a550, 0x5d022692, 0x5d022692, 0x4a001c84, 0x4a001c84},
588     - {0x0000a554, 0x61022892, 0x61022892, 0x4e001ce3, 0x4e001ce3},
589     - {0x0000a558, 0x65024890, 0x65024890, 0x52001ce5, 0x52001ce5},
590     - {0x0000a55c, 0x69024892, 0x69024892, 0x56001ce9, 0x56001ce9},
591     - {0x0000a560, 0x6e024c92, 0x6e024c92, 0x5a001ceb, 0x5a001ceb},
592     - {0x0000a564, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
593     - {0x0000a568, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
594     - {0x0000a56c, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
595     - {0x0000a570, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
596     - {0x0000a574, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
597     - {0x0000a578, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
598     - {0x0000a57c, 0x74026e92, 0x74026e92, 0x5d001eec, 0x5d001eec},
599     - {0x0000a580, 0x00800000, 0x00800000, 0x00800000, 0x00800000},
600     - {0x0000a584, 0x06800003, 0x06800003, 0x04800002, 0x04800002},
601     - {0x0000a588, 0x0a800020, 0x0a800020, 0x08800004, 0x08800004},
602     - {0x0000a58c, 0x10800023, 0x10800023, 0x0b800200, 0x0b800200},
603     - {0x0000a590, 0x16800220, 0x16800220, 0x0f800202, 0x0f800202},
604     - {0x0000a594, 0x1c800223, 0x1c800223, 0x12800400, 0x12800400},
605     - {0x0000a598, 0x21802220, 0x21802220, 0x16800402, 0x16800402},
606     - {0x0000a59c, 0x27802223, 0x27802223, 0x19800404, 0x19800404},
607     - {0x0000a5a0, 0x2b822220, 0x2b822220, 0x1c800603, 0x1c800603},
608     - {0x0000a5a4, 0x2f822222, 0x2f822222, 0x21800a02, 0x21800a02},
609     - {0x0000a5a8, 0x34822225, 0x34822225, 0x25800a04, 0x25800a04},
610     - {0x0000a5ac, 0x3a82222a, 0x3a82222a, 0x28800a20, 0x28800a20},
611     - {0x0000a5b0, 0x3e82222c, 0x3e82222c, 0x2c800e20, 0x2c800e20},
612     - {0x0000a5b4, 0x4282242a, 0x4282242a, 0x30800e22, 0x30800e22},
613     - {0x0000a5b8, 0x4782244a, 0x4782244a, 0x34800e24, 0x34800e24},
614     - {0x0000a5bc, 0x4b82244c, 0x4b82244c, 0x38801640, 0x38801640},
615     - {0x0000a5c0, 0x4e82246c, 0x4e82246c, 0x3c801660, 0x3c801660},
616     - {0x0000a5c4, 0x52822470, 0x52822470, 0x3f801861, 0x3f801861},
617     - {0x0000a5c8, 0x55822490, 0x55822490, 0x43801a81, 0x43801a81},
618     - {0x0000a5cc, 0x59822492, 0x59822492, 0x47801a83, 0x47801a83},
619     - {0x0000a5d0, 0x5d822692, 0x5d822692, 0x4a801c84, 0x4a801c84},
620     - {0x0000a5d4, 0x61822892, 0x61822892, 0x4e801ce3, 0x4e801ce3},
621     - {0x0000a5d8, 0x65824890, 0x65824890, 0x52801ce5, 0x52801ce5},
622     - {0x0000a5dc, 0x69824892, 0x69824892, 0x56801ce9, 0x56801ce9},
623     - {0x0000a5e0, 0x6e824c92, 0x6e824c92, 0x5a801ceb, 0x5a801ceb},
624     - {0x0000a5e4, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
625     - {0x0000a5e8, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
626     - {0x0000a5ec, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
627     - {0x0000a5f0, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
628     - {0x0000a5f4, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
629     - {0x0000a5f8, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
630     - {0x0000a5fc, 0x74826e92, 0x74826e92, 0x5d801eec, 0x5d801eec},
631     + {0x0000a410, 0x000050d8, 0x000050d8, 0x000050d9, 0x000050d9},
632     + {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000},
633     + {0x0000a504, 0x04002222, 0x04002222, 0x04000002, 0x04000002},
634     + {0x0000a508, 0x09002421, 0x09002421, 0x08000004, 0x08000004},
635     + {0x0000a50c, 0x0d002621, 0x0d002621, 0x0b000200, 0x0b000200},
636     + {0x0000a510, 0x13004620, 0x13004620, 0x0f000202, 0x0f000202},
637     + {0x0000a514, 0x19004a20, 0x19004a20, 0x11000400, 0x11000400},
638     + {0x0000a518, 0x1d004e20, 0x1d004e20, 0x15000402, 0x15000402},
639     + {0x0000a51c, 0x21005420, 0x21005420, 0x19000404, 0x19000404},
640     + {0x0000a520, 0x26005e20, 0x26005e20, 0x1b000603, 0x1b000603},
641     + {0x0000a524, 0x2b005e40, 0x2b005e40, 0x1f000a02, 0x1f000a02},
642     + {0x0000a528, 0x2f005e42, 0x2f005e42, 0x23000a04, 0x23000a04},
643     + {0x0000a52c, 0x33005e44, 0x33005e44, 0x26000a20, 0x26000a20},
644     + {0x0000a530, 0x38005e65, 0x38005e65, 0x2a000e20, 0x2a000e20},
645     + {0x0000a534, 0x3c005e69, 0x3c005e69, 0x2e000e22, 0x2e000e22},
646     + {0x0000a538, 0x40005e6b, 0x40005e6b, 0x31000e24, 0x31000e24},
647     + {0x0000a53c, 0x44005e6d, 0x44005e6d, 0x34001640, 0x34001640},
648     + {0x0000a540, 0x49005e72, 0x49005e72, 0x38001660, 0x38001660},
649     + {0x0000a544, 0x4e005eb2, 0x4e005eb2, 0x3b001861, 0x3b001861},
650     + {0x0000a548, 0x53005f12, 0x53005f12, 0x3e001a81, 0x3e001a81},
651     + {0x0000a54c, 0x59025eb2, 0x59025eb2, 0x42001a83, 0x42001a83},
652     + {0x0000a550, 0x5e025f12, 0x5e025f12, 0x44001c84, 0x44001c84},
653     + {0x0000a554, 0x61027f12, 0x61027f12, 0x48001ce3, 0x48001ce3},
654     + {0x0000a558, 0x6702bf12, 0x6702bf12, 0x4c001ce5, 0x4c001ce5},
655     + {0x0000a55c, 0x6b02bf14, 0x6b02bf14, 0x50001ce9, 0x50001ce9},
656     + {0x0000a560, 0x6f02bf16, 0x6f02bf16, 0x54001ceb, 0x54001ceb},
657     + {0x0000a564, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
658     + {0x0000a568, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
659     + {0x0000a56c, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
660     + {0x0000a570, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
661     + {0x0000a574, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
662     + {0x0000a578, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
663     + {0x0000a57c, 0x6f02bf16, 0x6f02bf16, 0x56001eec, 0x56001eec},
664     + {0x0000a580, 0x00802220, 0x00802220, 0x00800000, 0x00800000},
665     + {0x0000a584, 0x04802222, 0x04802222, 0x04800002, 0x04800002},
666     + {0x0000a588, 0x09802421, 0x09802421, 0x08800004, 0x08800004},
667     + {0x0000a58c, 0x0d802621, 0x0d802621, 0x0b800200, 0x0b800200},
668     + {0x0000a590, 0x13804620, 0x13804620, 0x0f800202, 0x0f800202},
669     + {0x0000a594, 0x19804a20, 0x19804a20, 0x11800400, 0x11800400},
670     + {0x0000a598, 0x1d804e20, 0x1d804e20, 0x15800402, 0x15800402},
671     + {0x0000a59c, 0x21805420, 0x21805420, 0x19800404, 0x19800404},
672     + {0x0000a5a0, 0x26805e20, 0x26805e20, 0x1b800603, 0x1b800603},
673     + {0x0000a5a4, 0x2b805e40, 0x2b805e40, 0x1f800a02, 0x1f800a02},
674     + {0x0000a5a8, 0x2f805e42, 0x2f805e42, 0x23800a04, 0x23800a04},
675     + {0x0000a5ac, 0x33805e44, 0x33805e44, 0x26800a20, 0x26800a20},
676     + {0x0000a5b0, 0x38805e65, 0x38805e65, 0x2a800e20, 0x2a800e20},
677     + {0x0000a5b4, 0x3c805e69, 0x3c805e69, 0x2e800e22, 0x2e800e22},
678     + {0x0000a5b8, 0x40805e6b, 0x40805e6b, 0x31800e24, 0x31800e24},
679     + {0x0000a5bc, 0x44805e6d, 0x44805e6d, 0x34801640, 0x34801640},
680     + {0x0000a5c0, 0x49805e72, 0x49805e72, 0x38801660, 0x38801660},
681     + {0x0000a5c4, 0x4e805eb2, 0x4e805eb2, 0x3b801861, 0x3b801861},
682     + {0x0000a5c8, 0x53805f12, 0x53805f12, 0x3e801a81, 0x3e801a81},
683     + {0x0000a5cc, 0x59825eb2, 0x59825eb2, 0x42801a83, 0x42801a83},
684     + {0x0000a5d0, 0x5e825f12, 0x5e825f12, 0x44801c84, 0x44801c84},
685     + {0x0000a5d4, 0x61827f12, 0x61827f12, 0x48801ce3, 0x48801ce3},
686     + {0x0000a5d8, 0x6782bf12, 0x6782bf12, 0x4c801ce5, 0x4c801ce5},
687     + {0x0000a5dc, 0x6b82bf14, 0x6b82bf14, 0x50801ce9, 0x50801ce9},
688     + {0x0000a5e0, 0x6f82bf16, 0x6f82bf16, 0x54801ceb, 0x54801ceb},
689     + {0x0000a5e4, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
690     + {0x0000a5e8, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
691     + {0x0000a5ec, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
692     + {0x0000a5f0, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
693     + {0x0000a5f4, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
694     + {0x0000a5f8, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
695     + {0x0000a5fc, 0x6f82bf16, 0x6f82bf16, 0x56801eec, 0x56801eec},
696     {0x0000a600, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
697     {0x0000a604, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
698     {0x0000a608, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
699     {0x0000a60c, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
700     - {0x0000a610, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
701     - {0x0000a614, 0x02004000, 0x02004000, 0x01404000, 0x01404000},
702     - {0x0000a618, 0x02004801, 0x02004801, 0x01404501, 0x01404501},
703     - {0x0000a61c, 0x02808a02, 0x02808a02, 0x02008501, 0x02008501},
704     - {0x0000a620, 0x0380ce03, 0x0380ce03, 0x0280ca03, 0x0280ca03},
705     - {0x0000a624, 0x04411104, 0x04411104, 0x03010c04, 0x03010c04},
706     - {0x0000a628, 0x04411104, 0x04411104, 0x04014c04, 0x04014c04},
707     - {0x0000a62c, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
708     - {0x0000a630, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
709     - {0x0000a634, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
710     - {0x0000a638, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
711     - {0x0000a63c, 0x04411104, 0x04411104, 0x04015005, 0x04015005},
712     - {0x0000b2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352},
713     - {0x0000b2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584},
714     - {0x0000b2e4, 0x03fc0000, 0x03fc0000, 0x03f0f800, 0x03f0f800},
715     + {0x0000a610, 0x00804000, 0x00804000, 0x00000000, 0x00000000},
716     + {0x0000a614, 0x00804201, 0x00804201, 0x01404000, 0x01404000},
717     + {0x0000a618, 0x0280c802, 0x0280c802, 0x01404501, 0x01404501},
718     + {0x0000a61c, 0x0280ca03, 0x0280ca03, 0x02008501, 0x02008501},
719     + {0x0000a620, 0x04c15104, 0x04c15104, 0x0280ca03, 0x0280ca03},
720     + {0x0000a624, 0x04c15305, 0x04c15305, 0x03010c04, 0x03010c04},
721     + {0x0000a628, 0x04c15305, 0x04c15305, 0x04014c04, 0x04014c04},
722     + {0x0000a62c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
723     + {0x0000a630, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
724     + {0x0000a634, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
725     + {0x0000a638, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
726     + {0x0000a63c, 0x04c15305, 0x04c15305, 0x04015005, 0x04015005},
727     + {0x0000b2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
728     + {0x0000b2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
729     + {0x0000b2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
730     {0x0000b2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
731     - {0x0000c2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352},
732     - {0x0000c2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584},
733     - {0x0000c2e4, 0x03fc0000, 0x03fc0000, 0x03f0f800, 0x03f0f800},
734     + {0x0000c2dc, 0x0380c7fc, 0x0380c7fc, 0x03aaa352, 0x03aaa352},
735     + {0x0000c2e0, 0x0000f800, 0x0000f800, 0x03ccc584, 0x03ccc584},
736     + {0x0000c2e4, 0x03ff0000, 0x03ff0000, 0x03f0f800, 0x03f0f800},
737     {0x0000c2e8, 0x00000000, 0x00000000, 0x03ff0000, 0x03ff0000},
738     {0x00016044, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4},
739     {0x00016048, 0x62480001, 0x62480001, 0x62480001, 0x62480001},
740     diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
741     index ab21a49..7f7bc94 100644
742     --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
743     +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
744     @@ -69,13 +69,13 @@
745     #define AR9300_BASE_ADDR 0x3ff
746     #define AR9300_BASE_ADDR_512 0x1ff
747    
748     -#define AR9300_OTP_BASE 0x14000
749     -#define AR9300_OTP_STATUS 0x15f18
750     +#define AR9300_OTP_BASE (AR_SREV_9340(ah) ? 0x30000 : 0x14000)
751     +#define AR9300_OTP_STATUS (AR_SREV_9340(ah) ? 0x30018 : 0x15f18)
752     #define AR9300_OTP_STATUS_TYPE 0x7
753     #define AR9300_OTP_STATUS_VALID 0x4
754     #define AR9300_OTP_STATUS_ACCESS_BUSY 0x2
755     #define AR9300_OTP_STATUS_SM_BUSY 0x1
756     -#define AR9300_OTP_READ_DATA 0x15f1c
757     +#define AR9300_OTP_READ_DATA (AR_SREV_9340(ah) ? 0x3001c : 0x15f1c)
758    
759     enum targetPowerHTRates {
760     HT_TARGET_RATE_0_8_16,
761     diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
762     index 0b4dbcd..3f9a891 100644
763     --- a/drivers/pci/intel-iommu.c
764     +++ b/drivers/pci/intel-iommu.c
765     @@ -1793,10 +1793,17 @@ static int __domain_mapping(struct dmar_domain *domain, unsigned long iov_pfn,
766     if (!pte)
767     return -ENOMEM;
768     /* It is large page*/
769     - if (largepage_lvl > 1)
770     + if (largepage_lvl > 1) {
771     pteval |= DMA_PTE_LARGE_PAGE;
772     - else
773     + /* Ensure that old small page tables are removed to make room
774     + for superpage, if they exist. */
775     + dma_pte_clear_range(domain, iov_pfn,
776     + iov_pfn + lvl_to_nr_pages(largepage_lvl) - 1);
777     + dma_pte_free_pagetable(domain, iov_pfn,
778     + iov_pfn + lvl_to_nr_pages(largepage_lvl) - 1);
779     + } else {
780     pteval &= ~(uint64_t)DMA_PTE_LARGE_PAGE;
781     + }
782    
783     }
784     /* We don't need lock here, nobody else
785     diff --git a/drivers/s390/cio/device_pgid.c b/drivers/s390/cio/device_pgid.c
786     index 07a4fd2..daa6b90 100644
787     --- a/drivers/s390/cio/device_pgid.c
788     +++ b/drivers/s390/cio/device_pgid.c
789     @@ -234,7 +234,7 @@ static int pgid_cmp(struct pgid *p1, struct pgid *p2)
790     * Determine pathgroup state from PGID data.
791     */
792     static void pgid_analyze(struct ccw_device *cdev, struct pgid **p,
793     - int *mismatch, int *reserved, u8 *reset)
794     + int *mismatch, u8 *reserved, u8 *reset)
795     {
796     struct pgid *pgid = &cdev->private->pgid[0];
797     struct pgid *first = NULL;
798     @@ -248,7 +248,7 @@ static void pgid_analyze(struct ccw_device *cdev, struct pgid **p,
799     if ((cdev->private->pgid_valid_mask & lpm) == 0)
800     continue;
801     if (pgid->inf.ps.state2 == SNID_STATE2_RESVD_ELSE)
802     - *reserved = 1;
803     + *reserved |= lpm;
804     if (pgid_is_reset(pgid)) {
805     *reset |= lpm;
806     continue;
807     @@ -316,14 +316,14 @@ static void snid_done(struct ccw_device *cdev, int rc)
808     struct subchannel *sch = to_subchannel(cdev->dev.parent);
809     struct pgid *pgid;
810     int mismatch = 0;
811     - int reserved = 0;
812     + u8 reserved = 0;
813     u8 reset = 0;
814     u8 donepm;
815    
816     if (rc)
817     goto out;
818     pgid_analyze(cdev, &pgid, &mismatch, &reserved, &reset);
819     - if (reserved)
820     + if (reserved == cdev->private->pgid_valid_mask)
821     rc = -EUSERS;
822     else if (mismatch)
823     rc = -EOPNOTSUPP;
824     @@ -336,7 +336,7 @@ static void snid_done(struct ccw_device *cdev, int rc)
825     }
826     out:
827     CIO_MSG_EVENT(2, "snid: device 0.%x.%04x: rc=%d pvm=%02x vpm=%02x "
828     - "todo=%02x mism=%d rsvd=%d reset=%02x\n", id->ssid,
829     + "todo=%02x mism=%d rsvd=%02x reset=%02x\n", id->ssid,
830     id->devno, rc, cdev->private->pgid_valid_mask, sch->vpm,
831     cdev->private->pgid_todo_mask, mismatch, reserved, reset);
832     switch (rc) {
833     diff --git a/drivers/scsi/mvsas/mv_94xx.h b/drivers/scsi/mvsas/mv_94xx.h
834     index 8835bef..d72aa61 100644
835     --- a/drivers/scsi/mvsas/mv_94xx.h
836     +++ b/drivers/scsi/mvsas/mv_94xx.h
837     @@ -193,21 +193,11 @@ struct mvs_prd {
838     #define SPI_ADDR_VLD_94XX (1U << 1)
839     #define SPI_CTRL_SpiStart_94XX (1U << 0)
840    
841     -#define mv_ffc(x) ffz(x)
842     -
843     static inline int
844     mv_ffc64(u64 v)
845     {
846     - int i;
847     - i = mv_ffc((u32)v);
848     - if (i >= 0)
849     - return i;
850     - i = mv_ffc((u32)(v>>32));
851     -
852     - if (i != 0)
853     - return 32 + i;
854     -
855     - return -1;
856     + u64 x = ~v;
857     + return x ? __ffs64(x) : -1;
858     }
859    
860     #define r_reg_set_enable(i) \
861     diff --git a/drivers/scsi/mvsas/mv_sas.h b/drivers/scsi/mvsas/mv_sas.h
862     index 1367d8b..efc6965 100644
863     --- a/drivers/scsi/mvsas/mv_sas.h
864     +++ b/drivers/scsi/mvsas/mv_sas.h
865     @@ -73,7 +73,7 @@ extern struct kmem_cache *mvs_task_list_cache;
866     #define DEV_IS_EXPANDER(type) \
867     ((type == EDGE_DEV) || (type == FANOUT_DEV))
868    
869     -#define bit(n) ((u32)1 << n)
870     +#define bit(n) ((u64)1 << n)
871    
872     #define for_each_phy(__lseq_mask, __mc, __lseq) \
873     for ((__mc) = (__lseq_mask), (__lseq) = 0; \
874     diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
875     index a2a1a83..7e78020 100644
876     --- a/drivers/scsi/qla2xxx/qla_os.c
877     +++ b/drivers/scsi/qla2xxx/qla_os.c
878     @@ -3406,9 +3406,9 @@ qla2x00_do_dpc(void *data)
879     base_vha->host_no));
880     }
881    
882     - if (test_bit(FCPORT_UPDATE_NEEDED, &base_vha->dpc_flags)) {
883     + if (test_and_clear_bit(FCPORT_UPDATE_NEEDED,
884     + &base_vha->dpc_flags)) {
885     qla2x00_update_fcports(base_vha);
886     - clear_bit(FCPORT_UPDATE_NEEDED, &base_vha->dpc_flags);
887     }
888    
889     if (test_bit(ISP_QUIESCE_NEEDED, &base_vha->dpc_flags)) {
890     diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig
891     index 20008a4..727b207d 100644
892     --- a/drivers/staging/comedi/Kconfig
893     +++ b/drivers/staging/comedi/Kconfig
894     @@ -424,6 +424,7 @@ config COMEDI_ADQ12B
895    
896     config COMEDI_NI_AT_A2150
897     tristate "NI AT-A2150 ISA card support"
898     + select COMEDI_FC
899     depends on COMEDI_NI_COMMON
900     depends on VIRT_TO_BUS
901     default N
902     diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
903     index d80b90f..39be673 100644
904     --- a/drivers/staging/comedi/comedi_fops.c
905     +++ b/drivers/staging/comedi/comedi_fops.c
906     @@ -138,6 +138,9 @@ static long comedi_unlocked_ioctl(struct file *file, unsigned int cmd,
907     if (cmd == COMEDI_DEVCONFIG) {
908     rc = do_devconfig_ioctl(dev,
909     (struct comedi_devconfig __user *)arg);
910     + if (rc == 0)
911     + /* Evade comedi_auto_unconfig(). */
912     + dev_file_info->hardware_device = NULL;
913     goto done;
914     }
915    
916     @@ -2207,6 +2210,7 @@ int comedi_alloc_board_minor(struct device *hardware_device)
917     kfree(info);
918     return -ENOMEM;
919     }
920     + info->hardware_device = hardware_device;
921     comedi_device_init(info->device);
922     spin_lock_irqsave(&comedi_file_info_table_lock, flags);
923     for (i = 0; i < COMEDI_NUM_BOARD_MINORS; ++i) {
924     @@ -2296,6 +2300,23 @@ void comedi_free_board_minor(unsigned minor)
925     }
926     }
927    
928     +int comedi_find_board_minor(struct device *hardware_device)
929     +{
930     + int minor;
931     + struct comedi_device_file_info *info;
932     +
933     + for (minor = 0; minor < COMEDI_NUM_BOARD_MINORS; minor++) {
934     + spin_lock(&comedi_file_info_table_lock);
935     + info = comedi_file_info_table[minor];
936     + if (info && info->hardware_device == hardware_device) {
937     + spin_unlock(&comedi_file_info_table_lock);
938     + return minor;
939     + }
940     + spin_unlock(&comedi_file_info_table_lock);
941     + }
942     + return -ENODEV;
943     +}
944     +
945     int comedi_alloc_subdevice_minor(struct comedi_device *dev,
946     struct comedi_subdevice *s)
947     {
948     diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h
949     index 68aa917..5f2745e 100644
950     --- a/drivers/staging/comedi/comedidev.h
951     +++ b/drivers/staging/comedi/comedidev.h
952     @@ -237,6 +237,7 @@ struct comedi_device_file_info {
953     struct comedi_device *device;
954     struct comedi_subdevice *read_subdevice;
955     struct comedi_subdevice *write_subdevice;
956     + struct device *hardware_device;
957     };
958    
959     #ifdef CONFIG_COMEDI_DEBUG
960     diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
961     index 6d60e91..f9b0286 100644
962     --- a/drivers/staging/comedi/drivers.c
963     +++ b/drivers/staging/comedi/drivers.c
964     @@ -819,25 +819,14 @@ static int comedi_auto_config(struct device *hardware_device,
965     int minor;
966     struct comedi_device_file_info *dev_file_info;
967     int retval;
968     - unsigned *private_data = NULL;
969    
970     - if (!comedi_autoconfig) {
971     - dev_set_drvdata(hardware_device, NULL);
972     + if (!comedi_autoconfig)
973     return 0;
974     - }
975    
976     minor = comedi_alloc_board_minor(hardware_device);
977     if (minor < 0)
978     return minor;
979    
980     - private_data = kmalloc(sizeof(unsigned), GFP_KERNEL);
981     - if (private_data == NULL) {
982     - retval = -ENOMEM;
983     - goto cleanup;
984     - }
985     - *private_data = minor;
986     - dev_set_drvdata(hardware_device, private_data);
987     -
988     dev_file_info = comedi_get_device_file_info(minor);
989    
990     memset(&it, 0, sizeof(it));
991     @@ -850,25 +839,22 @@ static int comedi_auto_config(struct device *hardware_device,
992     retval = comedi_device_attach(dev_file_info->device, &it);
993     mutex_unlock(&dev_file_info->device->mutex);
994    
995     -cleanup:
996     - if (retval < 0) {
997     - kfree(private_data);
998     + if (retval < 0)
999     comedi_free_board_minor(minor);
1000     - }
1001     return retval;
1002     }
1003    
1004     static void comedi_auto_unconfig(struct device *hardware_device)
1005     {
1006     - unsigned *minor = (unsigned *)dev_get_drvdata(hardware_device);
1007     - if (minor == NULL)
1008     - return;
1009     -
1010     - BUG_ON(*minor >= COMEDI_NUM_BOARD_MINORS);
1011     + int minor;
1012    
1013     - comedi_free_board_minor(*minor);
1014     - dev_set_drvdata(hardware_device, NULL);
1015     - kfree(minor);
1016     + if (hardware_device == NULL)
1017     + return;
1018     + minor = comedi_find_board_minor(hardware_device);
1019     + if (minor < 0)
1020     + return;
1021     + BUG_ON(minor >= COMEDI_NUM_BOARD_MINORS);
1022     + comedi_free_board_minor(minor);
1023     }
1024    
1025     int comedi_pci_auto_config(struct pci_dev *pcidev, const char *board_name)
1026     diff --git a/drivers/staging/comedi/drivers/comedi_test.c b/drivers/staging/comedi/drivers/comedi_test.c
1027     index a804742..2567f9a 100644
1028     --- a/drivers/staging/comedi/drivers/comedi_test.c
1029     +++ b/drivers/staging/comedi/drivers/comedi_test.c
1030     @@ -461,7 +461,7 @@ static int waveform_ai_cancel(struct comedi_device *dev,
1031     struct comedi_subdevice *s)
1032     {
1033     devpriv->timer_running = 0;
1034     - del_timer(&devpriv->timer);
1035     + del_timer_sync(&devpriv->timer);
1036     return 0;
1037     }
1038    
1039     diff --git a/drivers/staging/comedi/internal.h b/drivers/staging/comedi/internal.h
1040     index 434ce34..4208fb4 100644
1041     --- a/drivers/staging/comedi/internal.h
1042     +++ b/drivers/staging/comedi/internal.h
1043     @@ -7,6 +7,7 @@ int insn_inval(struct comedi_device *dev, struct comedi_subdevice *s,
1044     struct comedi_insn *insn, unsigned int *data);
1045     int comedi_alloc_board_minor(struct device *hardware_device);
1046     void comedi_free_board_minor(unsigned minor);
1047     +int comedi_find_board_minor(struct device *hardware_device);
1048     void comedi_reset_async_buf(struct comedi_async *async);
1049     int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s,
1050     unsigned long new_size);
1051     diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c
1052     index 6d88d1a..af28a62 100644
1053     --- a/drivers/staging/rtl8712/usb_intf.c
1054     +++ b/drivers/staging/rtl8712/usb_intf.c
1055     @@ -62,6 +62,8 @@ static struct usb_device_id rtl871x_usb_id_tbl[] = {
1056     {USB_DEVICE(0x0B05, 0x1791)}, /* 11n mode disable */
1057     /* Belkin */
1058     {USB_DEVICE(0x050D, 0x945A)},
1059     + /* ISY IWL - Belkin clone */
1060     + {USB_DEVICE(0x050D, 0x11F1)},
1061     /* Corega */
1062     {USB_DEVICE(0x07AA, 0x0047)},
1063     /* D-Link */
1064     diff --git a/drivers/staging/speakup/synth.c b/drivers/staging/speakup/synth.c
1065     index c241074..7843111 100644
1066     --- a/drivers/staging/speakup/synth.c
1067     +++ b/drivers/staging/speakup/synth.c
1068     @@ -342,7 +342,7 @@ int synth_init(char *synth_name)
1069    
1070     mutex_lock(&spk_mutex);
1071     /* First, check if we already have it loaded. */
1072     - for (i = 0; synths[i] != NULL && i < MAXSYNTHS; i++)
1073     + for (i = 0; i < MAXSYNTHS && synths[i] != NULL; i++)
1074     if (strcmp(synths[i]->name, synth_name) == 0)
1075     synth = synths[i];
1076    
1077     @@ -423,7 +423,7 @@ int synth_add(struct spk_synth *in_synth)
1078     int i;
1079     int status = 0;
1080     mutex_lock(&spk_mutex);
1081     - for (i = 0; synths[i] != NULL && i < MAXSYNTHS; i++)
1082     + for (i = 0; i < MAXSYNTHS && synths[i] != NULL; i++)
1083     /* synth_remove() is responsible for rotating the array down */
1084     if (in_synth == synths[i]) {
1085     mutex_unlock(&spk_mutex);
1086     diff --git a/drivers/staging/vt6656/dpc.c b/drivers/staging/vt6656/dpc.c
1087     index 921dae5..5918ef7 100644
1088     --- a/drivers/staging/vt6656/dpc.c
1089     +++ b/drivers/staging/vt6656/dpc.c
1090     @@ -1256,7 +1256,7 @@ static BOOL s_bHandleRxEncryption (
1091    
1092     PayloadLen -= (WLAN_HDR_ADDR3_LEN + 8 + 4); // 24 is 802.11 header, 8 is IV&ExtIV, 4 is crc
1093     *pdwRxTSC47_16 = cpu_to_le32(*(PDWORD)(pbyIV + 4));
1094     - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ExtIV: %lx\n",*pdwRxTSC47_16);
1095     + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ExtIV: %x\n", *pdwRxTSC47_16);
1096     if (byDecMode == KEY_CTL_TKIP) {
1097     *pwRxTSC15_0 = cpu_to_le16(MAKEWORD(*(pbyIV+2), *pbyIV));
1098     } else {
1099     @@ -1367,7 +1367,7 @@ static BOOL s_bHostWepRxEncryption (
1100    
1101     PayloadLen -= (WLAN_HDR_ADDR3_LEN + 8 + 4); // 24 is 802.11 header, 8 is IV&ExtIV, 4 is crc
1102     *pdwRxTSC47_16 = cpu_to_le32(*(PDWORD)(pbyIV + 4));
1103     - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ExtIV: %lx\n",*pdwRxTSC47_16);
1104     + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ExtIV: %x\n", *pdwRxTSC47_16);
1105    
1106     if (byDecMode == KEY_CTL_TKIP) {
1107     *pwRxTSC15_0 = cpu_to_le16(MAKEWORD(*(pbyIV+2), *pbyIV));
1108     diff --git a/drivers/staging/vt6656/key.c b/drivers/staging/vt6656/key.c
1109     index 27bb523..fd93e83 100644
1110     --- a/drivers/staging/vt6656/key.c
1111     +++ b/drivers/staging/vt6656/key.c
1112     @@ -223,7 +223,7 @@ BOOL KeybSetKey(
1113     PSKeyManagement pTable,
1114     PBYTE pbyBSSID,
1115     DWORD dwKeyIndex,
1116     - unsigned long uKeyLength,
1117     + u32 uKeyLength,
1118     PQWORD pKeyRSC,
1119     PBYTE pbyKey,
1120     BYTE byKeyDecMode
1121     @@ -235,7 +235,8 @@ BOOL KeybSetKey(
1122     PSKeyItem pKey;
1123     unsigned int uKeyIdx;
1124    
1125     - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Enter KeybSetKey: %lX\n", dwKeyIndex);
1126     + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
1127     + "Enter KeybSetKey: %X\n", dwKeyIndex);
1128    
1129     j = (MAX_KEY_TABLE-1);
1130     for (i=0;i<(MAX_KEY_TABLE-1);i++) {
1131     @@ -261,7 +262,9 @@ BOOL KeybSetKey(
1132     if ((dwKeyIndex & TRANSMIT_KEY) != 0) {
1133     // Group transmit key
1134     pTable->KeyTable[i].dwGTKeyIndex = dwKeyIndex;
1135     - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Group transmit key(R)[%lX]: %d\n", pTable->KeyTable[i].dwGTKeyIndex, i);
1136     + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
1137     + "Group transmit key(R)[%X]: %d\n",
1138     + pTable->KeyTable[i].dwGTKeyIndex, i);
1139     }
1140     pTable->KeyTable[i].wKeyCtl &= 0xFF0F; // clear group key control filed
1141     pTable->KeyTable[i].wKeyCtl |= (byKeyDecMode << 4);
1142     @@ -302,9 +305,12 @@ BOOL KeybSetKey(
1143     }
1144     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n");
1145    
1146     - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwTSC47_16: %lx\n ", pKey->dwTSC47_16);
1147     - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->wTSC15_0: %x\n ", pKey->wTSC15_0);
1148     - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwKeyIndex: %lx\n ", pKey->dwKeyIndex);
1149     + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwTSC47_16: %x\n ",
1150     + pKey->dwTSC47_16);
1151     + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->wTSC15_0: %x\n ",
1152     + pKey->wTSC15_0);
1153     + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwKeyIndex: %x\n ",
1154     + pKey->dwKeyIndex);
1155    
1156     return (TRUE);
1157     }
1158     @@ -326,7 +332,9 @@ BOOL KeybSetKey(
1159     if ((dwKeyIndex & TRANSMIT_KEY) != 0) {
1160     // Group transmit key
1161     pTable->KeyTable[j].dwGTKeyIndex = dwKeyIndex;
1162     - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Group transmit key(N)[%lX]: %d\n", pTable->KeyTable[j].dwGTKeyIndex, j);
1163     + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
1164     + "Group transmit key(N)[%X]: %d\n",
1165     + pTable->KeyTable[j].dwGTKeyIndex, j);
1166     }
1167     pTable->KeyTable[j].wKeyCtl &= 0xFF0F; // clear group key control filed
1168     pTable->KeyTable[j].wKeyCtl |= (byKeyDecMode << 4);
1169     @@ -367,9 +375,11 @@ BOOL KeybSetKey(
1170     }
1171     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n");
1172    
1173     - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwTSC47_16: %lx\n ", pKey->dwTSC47_16);
1174     + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwTSC47_16: %x\n ",
1175     + pKey->dwTSC47_16);
1176     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->wTSC15_0: %x\n ", pKey->wTSC15_0);
1177     - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwKeyIndex: %lx\n ", pKey->dwKeyIndex);
1178     + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwKeyIndex: %x\n ",
1179     + pKey->dwKeyIndex);
1180    
1181     return (TRUE);
1182     }
1183     @@ -597,7 +607,8 @@ BOOL KeybGetTransmitKey(PSKeyManagement pTable, PBYTE pbyBSSID, DWORD dwKeyType,
1184     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"%x ", pTable->KeyTable[i].abyBSSID[ii]);
1185     }
1186     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n");
1187     - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"dwGTKeyIndex: %lX\n", pTable->KeyTable[i].dwGTKeyIndex);
1188     + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"dwGTKeyIndex: %X\n",
1189     + pTable->KeyTable[i].dwGTKeyIndex);
1190    
1191     return (TRUE);
1192     }
1193     @@ -664,7 +675,7 @@ BOOL KeybSetDefaultKey(
1194     void *pDeviceHandler,
1195     PSKeyManagement pTable,
1196     DWORD dwKeyIndex,
1197     - unsigned long uKeyLength,
1198     + u32 uKeyLength,
1199     PQWORD pKeyRSC,
1200     PBYTE pbyKey,
1201     BYTE byKeyDecMode
1202     @@ -693,7 +704,10 @@ BOOL KeybSetDefaultKey(
1203     if ((dwKeyIndex & TRANSMIT_KEY) != 0) {
1204     // Group transmit key
1205     pTable->KeyTable[MAX_KEY_TABLE-1].dwGTKeyIndex = dwKeyIndex;
1206     - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Group transmit key(R)[%lX]: %d\n", pTable->KeyTable[MAX_KEY_TABLE-1].dwGTKeyIndex, MAX_KEY_TABLE-1);
1207     + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
1208     + "Group transmit key(R)[%X]: %d\n",
1209     + pTable->KeyTable[MAX_KEY_TABLE-1].dwGTKeyIndex,
1210     + MAX_KEY_TABLE-1);
1211    
1212     }
1213     pTable->KeyTable[MAX_KEY_TABLE-1].wKeyCtl &= 0x7F00; // clear all key control filed
1214     @@ -744,9 +758,11 @@ BOOL KeybSetDefaultKey(
1215     }
1216     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"\n");
1217    
1218     - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwTSC47_16: %lx\n", pKey->dwTSC47_16);
1219     + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwTSC47_16: %x\n",
1220     + pKey->dwTSC47_16);
1221     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->wTSC15_0: %x\n", pKey->wTSC15_0);
1222     - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwKeyIndex: %lx\n", pKey->dwKeyIndex);
1223     + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pKey->dwKeyIndex: %x\n",
1224     + pKey->dwKeyIndex);
1225    
1226     return (TRUE);
1227     }
1228     @@ -772,7 +788,7 @@ BOOL KeybSetAllGroupKey(
1229     void *pDeviceHandler,
1230     PSKeyManagement pTable,
1231     DWORD dwKeyIndex,
1232     - unsigned long uKeyLength,
1233     + u32 uKeyLength,
1234     PQWORD pKeyRSC,
1235     PBYTE pbyKey,
1236     BYTE byKeyDecMode
1237     @@ -784,7 +800,8 @@ BOOL KeybSetAllGroupKey(
1238     PSKeyItem pKey;
1239     unsigned int uKeyIdx;
1240    
1241     - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Enter KeybSetAllGroupKey: %lX\n", dwKeyIndex);
1242     + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Enter KeybSetAllGroupKey: %X\n",
1243     + dwKeyIndex);
1244    
1245    
1246     if ((dwKeyIndex & PAIRWISE_KEY) != 0) { // Pairwise key
1247     @@ -801,7 +818,9 @@ BOOL KeybSetAllGroupKey(
1248     if ((dwKeyIndex & TRANSMIT_KEY) != 0) {
1249     // Group transmit key
1250     pTable->KeyTable[i].dwGTKeyIndex = dwKeyIndex;
1251     - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Group transmit key(R)[%lX]: %d\n", pTable->KeyTable[i].dwGTKeyIndex, i);
1252     + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
1253     + "Group transmit key(R)[%X]: %d\n",
1254     + pTable->KeyTable[i].dwGTKeyIndex, i);
1255    
1256     }
1257     pTable->KeyTable[i].wKeyCtl &= 0xFF0F; // clear group key control filed
1258     diff --git a/drivers/staging/vt6656/key.h b/drivers/staging/vt6656/key.h
1259     index f749c7a..bd35d39 100644
1260     --- a/drivers/staging/vt6656/key.h
1261     +++ b/drivers/staging/vt6656/key.h
1262     @@ -58,7 +58,7 @@
1263     typedef struct tagSKeyItem
1264     {
1265     BOOL bKeyValid;
1266     - unsigned long uKeyLength;
1267     + u32 uKeyLength;
1268     BYTE abyKey[MAX_KEY_LEN];
1269     QWORD KeyRSC;
1270     DWORD dwTSC47_16;
1271     @@ -107,7 +107,7 @@ BOOL KeybSetKey(
1272     PSKeyManagement pTable,
1273     PBYTE pbyBSSID,
1274     DWORD dwKeyIndex,
1275     - unsigned long uKeyLength,
1276     + u32 uKeyLength,
1277     PQWORD pKeyRSC,
1278     PBYTE pbyKey,
1279     BYTE byKeyDecMode
1280     @@ -146,7 +146,7 @@ BOOL KeybSetDefaultKey(
1281     void *pDeviceHandler,
1282     PSKeyManagement pTable,
1283     DWORD dwKeyIndex,
1284     - unsigned long uKeyLength,
1285     + u32 uKeyLength,
1286     PQWORD pKeyRSC,
1287     PBYTE pbyKey,
1288     BYTE byKeyDecMode
1289     @@ -156,7 +156,7 @@ BOOL KeybSetAllGroupKey(
1290     void *pDeviceHandler,
1291     PSKeyManagement pTable,
1292     DWORD dwKeyIndex,
1293     - unsigned long uKeyLength,
1294     + u32 uKeyLength,
1295     PQWORD pKeyRSC,
1296     PBYTE pbyKey,
1297     BYTE byKeyDecMode
1298     diff --git a/drivers/staging/vt6656/mac.c b/drivers/staging/vt6656/mac.c
1299     index 26c19d1..0636d82 100644
1300     --- a/drivers/staging/vt6656/mac.c
1301     +++ b/drivers/staging/vt6656/mac.c
1302     @@ -262,7 +262,8 @@ BYTE pbyData[24];
1303     dwData1 <<= 16;
1304     dwData1 |= MAKEWORD(*(pbyAddr+4), *(pbyAddr+5));
1305    
1306     - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"1. wOffset: %d, Data: %lX, KeyCtl:%X\n", wOffset, dwData1, wKeyCtl);
1307     + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"1. wOffset: %d, Data: %X,"\
1308     + " KeyCtl:%X\n", wOffset, dwData1, wKeyCtl);
1309    
1310     //VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset);
1311     //VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, dwData);
1312     @@ -279,7 +280,8 @@ BYTE pbyData[24];
1313     dwData2 <<= 8;
1314     dwData2 |= *(pbyAddr+0);
1315    
1316     - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"2. wOffset: %d, Data: %lX\n", wOffset, dwData2);
1317     + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"2. wOffset: %d, Data: %X\n",
1318     + wOffset, dwData2);
1319    
1320     //VNSvOutPortW(dwIoBase + MAC_REG_MISCFFNDEX, wOffset);
1321     //VNSvOutPortD(dwIoBase + MAC_REG_MISCFFDATA, dwData);
1322     diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
1323     index 3fd0478..8cf0881 100644
1324     --- a/drivers/staging/vt6656/rf.c
1325     +++ b/drivers/staging/vt6656/rf.c
1326     @@ -769,6 +769,9 @@ BYTE byPwr = pDevice->byCCKPwr;
1327     return TRUE;
1328     }
1329    
1330     + if (uCH == 0)
1331     + return -EINVAL;
1332     +
1333     switch (uRATE) {
1334     case RATE_1M:
1335     case RATE_2M:
1336     diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
1337     index fe21868..3beb126 100644
1338     --- a/drivers/staging/vt6656/rxtx.c
1339     +++ b/drivers/staging/vt6656/rxtx.c
1340     @@ -377,7 +377,8 @@ s_vFillTxKey (
1341     *(pbyIVHead+3) = (BYTE)(((pDevice->byKeyIndex << 6) & 0xc0) | 0x20); // 0x20 is ExtIV
1342     // Append IV&ExtIV after Mac Header
1343     *pdwExtIV = cpu_to_le32(pTransmitKey->dwTSC47_16);
1344     - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"vFillTxKey()---- pdwExtIV: %lx\n", *pdwExtIV);
1345     + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"vFillTxKey()---- pdwExtIV: %x\n",
1346     + *pdwExtIV);
1347    
1348     } else if (pTransmitKey->byCipherSuite == KEY_CTL_CCMP) {
1349     pTransmitKey->wTSC15_0++;
1350     @@ -1753,7 +1754,8 @@ s_bPacketToWirelessUsb(
1351     MIC_vAppend((PBYTE)&(psEthHeader->abyDstAddr[0]), 12);
1352     dwMIC_Priority = 0;
1353     MIC_vAppend((PBYTE)&dwMIC_Priority, 4);
1354     - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"MIC KEY: %lX, %lX\n", dwMICKey0, dwMICKey1);
1355     + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"MIC KEY: %X, %X\n",
1356     + dwMICKey0, dwMICKey1);
1357    
1358     ///////////////////////////////////////////////////////////////////
1359    
1360     @@ -2635,7 +2637,8 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb) {
1361     MIC_vAppend((PBYTE)&(sEthHeader.abyDstAddr[0]), 12);
1362     dwMIC_Priority = 0;
1363     MIC_vAppend((PBYTE)&dwMIC_Priority, 4);
1364     - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"DMA0_tx_8021:MIC KEY: %lX, %lX\n", dwMICKey0, dwMICKey1);
1365     + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"DMA0_tx_8021:MIC KEY:"\
1366     + " %X, %X\n", dwMICKey0, dwMICKey1);
1367    
1368     uLength = cbHeaderSize + cbMacHdLen + uPadding + cbIVlen;
1369    
1370     @@ -2655,7 +2658,8 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb) {
1371    
1372     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"uLength: %d, %d\n", uLength, cbFrameBodySize);
1373     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"cbReqCount:%d, %d, %d, %d\n", cbReqCount, cbHeaderSize, uPadding, cbIVlen);
1374     - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"MIC:%lx, %lx\n", *pdwMIC_L, *pdwMIC_R);
1375     + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"MIC:%x, %x\n",
1376     + *pdwMIC_L, *pdwMIC_R);
1377    
1378     }
1379    
1380     @@ -3029,7 +3033,8 @@ int nsDMA_tx_packet(PSDevice pDevice, unsigned int uDMAIdx, struct sk_buff *skb)
1381     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"error: KEY is GTK!!~~\n");
1382     }
1383     else {
1384     - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Find PTK [%lX]\n", pTransmitKey->dwKeyIndex);
1385     + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Find PTK [%X]\n",
1386     + pTransmitKey->dwKeyIndex);
1387     bNeedEncryption = TRUE;
1388     }
1389     }
1390     @@ -3043,7 +3048,8 @@ int nsDMA_tx_packet(PSDevice pDevice, unsigned int uDMAIdx, struct sk_buff *skb)
1391     if (pDevice->bEnableHostWEP) {
1392     if ((uNodeIndex != 0) &&
1393     (pMgmt->sNodeDBTable[uNodeIndex].dwKeyIndex & PAIRWISE_KEY)) {
1394     - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Find PTK [%lX]\n", pTransmitKey->dwKeyIndex);
1395     + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Find PTK [%X]\n",
1396     + pTransmitKey->dwKeyIndex);
1397     bNeedEncryption = TRUE;
1398     }
1399     }
1400     diff --git a/drivers/staging/vt6656/ttype.h b/drivers/staging/vt6656/ttype.h
1401     index 8e9450e..dfbf747 100644
1402     --- a/drivers/staging/vt6656/ttype.h
1403     +++ b/drivers/staging/vt6656/ttype.h
1404     @@ -29,6 +29,8 @@
1405     #ifndef __TTYPE_H__
1406     #define __TTYPE_H__
1407    
1408     +#include <linux/types.h>
1409     +
1410     /******* Common definitions and typedefs ***********************************/
1411    
1412     typedef int BOOL;
1413     @@ -42,17 +44,17 @@ typedef int BOOL;
1414    
1415     /****** Simple typedefs ***************************************************/
1416    
1417     -typedef unsigned char BYTE; // 8-bit
1418     -typedef unsigned short WORD; // 16-bit
1419     -typedef unsigned long DWORD; // 32-bit
1420     +typedef u8 BYTE;
1421     +typedef u16 WORD;
1422     +typedef u32 DWORD;
1423    
1424     // QWORD is for those situation that we want
1425     // an 8-byte-aligned 8 byte long structure
1426     // which is NOT really a floating point number.
1427     typedef union tagUQuadWord {
1428     struct {
1429     - DWORD dwLowDword;
1430     - DWORD dwHighDword;
1431     + u32 dwLowDword;
1432     + u32 dwHighDword;
1433     } u;
1434     double DoNotUseThisField;
1435     } UQuadWord;
1436     @@ -60,8 +62,8 @@ typedef UQuadWord QWORD; // 64-bit
1437    
1438     /****** Common pointer types ***********************************************/
1439    
1440     -typedef unsigned long ULONG_PTR; // 32-bit
1441     -typedef unsigned long DWORD_PTR; // 32-bit
1442     +typedef u32 ULONG_PTR;
1443     +typedef u32 DWORD_PTR;
1444    
1445     // boolean pointer
1446    
1447     diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
1448     index 78ea121..31fb96a 100644
1449     --- a/drivers/staging/vt6656/wcmd.c
1450     +++ b/drivers/staging/vt6656/wcmd.c
1451     @@ -316,17 +316,19 @@ s_MgrMakeProbeRequest(
1452     return pTxPacket;
1453     }
1454    
1455     -void vCommandTimerWait(void *hDeviceContext, unsigned int MSecond)
1456     +void vCommandTimerWait(void *hDeviceContext, unsigned long MSecond)
1457     {
1458     - PSDevice pDevice = (PSDevice)hDeviceContext;
1459     + PSDevice pDevice = (PSDevice)hDeviceContext;
1460    
1461     - init_timer(&pDevice->sTimerCommand);
1462     - pDevice->sTimerCommand.data = (unsigned long)pDevice;
1463     - pDevice->sTimerCommand.function = (TimerFunction)vRunCommand;
1464     - // RUN_AT :1 msec ~= (HZ/1024)
1465     - pDevice->sTimerCommand.expires = (unsigned int)RUN_AT((MSecond * HZ) >> 10);
1466     - add_timer(&pDevice->sTimerCommand);
1467     - return;
1468     + init_timer(&pDevice->sTimerCommand);
1469     +
1470     + pDevice->sTimerCommand.data = (unsigned long)pDevice;
1471     + pDevice->sTimerCommand.function = (TimerFunction)vRunCommand;
1472     + pDevice->sTimerCommand.expires = RUN_AT((MSecond * HZ) / 1000);
1473     +
1474     + add_timer(&pDevice->sTimerCommand);
1475     +
1476     + return;
1477     }
1478    
1479     void vRunCommand(void *hDeviceContext)
1480     diff --git a/drivers/staging/vt6656/wpa2.h b/drivers/staging/vt6656/wpa2.h
1481     index 46c2959..c359252 100644
1482     --- a/drivers/staging/vt6656/wpa2.h
1483     +++ b/drivers/staging/vt6656/wpa2.h
1484     @@ -45,8 +45,8 @@ typedef struct tagsPMKIDInfo {
1485     } PMKIDInfo, *PPMKIDInfo;
1486    
1487     typedef struct tagSPMKIDCache {
1488     - unsigned long BSSIDInfoCount;
1489     - PMKIDInfo BSSIDInfo[MAX_PMKID_CACHE];
1490     + u32 BSSIDInfoCount;
1491     + PMKIDInfo BSSIDInfo[MAX_PMKID_CACHE];
1492     } SPMKIDCache, *PSPMKIDCache;
1493    
1494    
1495     diff --git a/drivers/target/tcm_fc/tfc_sess.c b/drivers/target/tcm_fc/tfc_sess.c
1496     index a40541c..087af19 100644
1497     --- a/drivers/target/tcm_fc/tfc_sess.c
1498     +++ b/drivers/target/tcm_fc/tfc_sess.c
1499     @@ -468,7 +468,6 @@ static void ft_sess_rcu_free(struct rcu_head *rcu)
1500     {
1501     struct ft_sess *sess = container_of(rcu, struct ft_sess, rcu);
1502    
1503     - transport_deregister_session(sess->se_sess);
1504     kfree(sess);
1505     }
1506    
1507     @@ -476,6 +475,7 @@ static void ft_sess_free(struct kref *kref)
1508     {
1509     struct ft_sess *sess = container_of(kref, struct ft_sess, kref);
1510    
1511     + transport_deregister_session(sess->se_sess);
1512     call_rcu(&sess->rcu, ft_sess_rcu_free);
1513     }
1514    
1515     diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
1516     index b107339..84e69ea 100644
1517     --- a/drivers/usb/class/cdc-acm.c
1518     +++ b/drivers/usb/class/cdc-acm.c
1519     @@ -1509,6 +1509,9 @@ static const struct usb_device_id acm_ids[] = {
1520     { USB_DEVICE(0x0572, 0x1340), /* Conexant CX93010-2x UCMxx */
1521     .driver_info = NO_UNION_NORMAL,
1522     },
1523     + { USB_DEVICE(0x05f9, 0x4002), /* PSC Scanning, Magellan 800i */
1524     + .driver_info = NO_UNION_NORMAL,
1525     + },
1526     { USB_DEVICE(0x1bbb, 0x0003), /* Alcatel OT-I650 */
1527     .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */
1528     },
1529     diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
1530     index b4688fa..be9cac6 100644
1531     --- a/drivers/usb/core/hub.c
1532     +++ b/drivers/usb/core/hub.c
1533     @@ -2050,7 +2050,7 @@ static unsigned hub_is_wusb(struct usb_hub *hub)
1534     #define HUB_ROOT_RESET_TIME 50 /* times are in msec */
1535     #define HUB_SHORT_RESET_TIME 10
1536     #define HUB_LONG_RESET_TIME 200
1537     -#define HUB_RESET_TIMEOUT 500
1538     +#define HUB_RESET_TIMEOUT 800
1539    
1540     static int hub_port_wait_reset(struct usb_hub *hub, int port1,
1541     struct usb_device *udev, unsigned int delay)
1542     @@ -2413,7 +2413,7 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg)
1543     static int finish_port_resume(struct usb_device *udev)
1544     {
1545     int status = 0;
1546     - u16 devstatus;
1547     + u16 devstatus = 0;
1548    
1549     /* caller owns the udev device lock */
1550     dev_dbg(&udev->dev, "%s\n",
1551     @@ -2458,7 +2458,13 @@ static int finish_port_resume(struct usb_device *udev)
1552     if (status) {
1553     dev_dbg(&udev->dev, "gone after usb resume? status %d\n",
1554     status);
1555     - } else if (udev->actconfig) {
1556     + /*
1557     + * There are a few quirky devices which violate the standard
1558     + * by claiming to have remote wakeup enabled after a reset,
1559     + * which crash if the feature is cleared, hence check for
1560     + * udev->reset_resume
1561     + */
1562     + } else if (udev->actconfig && !udev->reset_resume) {
1563     le16_to_cpus(&devstatus);
1564     if (devstatus & (1 << USB_DEVICE_REMOTE_WAKEUP)) {
1565     status = usb_control_msg(udev,
1566     diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
1567     index d3dcabc..90977fc 100644
1568     --- a/drivers/usb/gadget/dummy_hcd.c
1569     +++ b/drivers/usb/gadget/dummy_hcd.c
1570     @@ -122,10 +122,7 @@ static const char ep0name [] = "ep0";
1571     static const char *const ep_name [] = {
1572     ep0name, /* everyone has ep0 */
1573    
1574     - /* act like a net2280: high speed, six configurable endpoints */
1575     - "ep-a", "ep-b", "ep-c", "ep-d", "ep-e", "ep-f",
1576     -
1577     - /* or like pxa250: fifteen fixed function endpoints */
1578     + /* act like a pxa250: fifteen fixed function endpoints */
1579     "ep1in-bulk", "ep2out-bulk", "ep3in-iso", "ep4out-iso", "ep5in-int",
1580     "ep6in-bulk", "ep7out-bulk", "ep8in-iso", "ep9out-iso", "ep10in-int",
1581     "ep11in-bulk", "ep12out-bulk", "ep13in-iso", "ep14out-iso",
1582     @@ -133,6 +130,10 @@ static const char *const ep_name [] = {
1583    
1584     /* or like sa1100: two fixed function endpoints */
1585     "ep1out-bulk", "ep2in-bulk",
1586     +
1587     + /* and now some generic EPs so we have enough in multi config */
1588     + "ep3out", "ep4in", "ep5out", "ep6out", "ep7in", "ep8out", "ep9in",
1589     + "ep10out", "ep11out", "ep12in", "ep13out", "ep14in", "ep15out",
1590     };
1591     #define DUMMY_ENDPOINTS ARRAY_SIZE(ep_name)
1592    
1593     diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
1594     index a44f2d4..a2b20fe 100644
1595     --- a/drivers/usb/host/xhci-mem.c
1596     +++ b/drivers/usb/host/xhci-mem.c
1597     @@ -1026,6 +1026,8 @@ static unsigned int xhci_microframes_to_exponent(struct usb_device *udev,
1598     static unsigned int xhci_parse_microframe_interval(struct usb_device *udev,
1599     struct usb_host_endpoint *ep)
1600     {
1601     + if (ep->desc.bInterval == 0)
1602     + return 0;
1603     return xhci_microframes_to_exponent(udev, ep,
1604     ep->desc.bInterval, 0, 15);
1605     }
1606     diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
1607     index c3770e5..c855a4a 100644
1608     --- a/drivers/usb/serial/ftdi_sio.c
1609     +++ b/drivers/usb/serial/ftdi_sio.c
1610     @@ -879,6 +879,8 @@ static struct usb_device_id id_table_combined [] = {
1611     { USB_DEVICE(FTDI_VID, FTDI_DISTORTEC_JTAG_LOCK_PICK_PID),
1612     .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
1613     { USB_DEVICE(FTDI_VID, FTDI_LUMEL_PD12_PID) },
1614     + /* Crucible Devices */
1615     + { USB_DEVICE(FTDI_VID, FTDI_CT_COMET_PID) },
1616     { }, /* Optional parameter entry */
1617     { } /* Terminating entry */
1618     };
1619     diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
1620     index aedf65f..dd6edf8 100644
1621     --- a/drivers/usb/serial/ftdi_sio_ids.h
1622     +++ b/drivers/usb/serial/ftdi_sio_ids.h
1623     @@ -1259,3 +1259,9 @@
1624     * ATI command output: Cinterion MC55i
1625     */
1626     #define FTDI_CINTERION_MC55I_PID 0xA951
1627     +
1628     +/*
1629     + * Product: Comet Caller ID decoder
1630     + * Manufacturer: Crucible Technologies
1631     + */
1632     +#define FTDI_CT_COMET_PID 0x8e08
1633     diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
1634     index 872807b..f233bbb 100644
1635     --- a/drivers/usb/serial/option.c
1636     +++ b/drivers/usb/serial/option.c
1637     @@ -288,6 +288,7 @@ static void option_instat_callback(struct urb *urb);
1638     #define ALCATEL_VENDOR_ID 0x1bbb
1639     #define ALCATEL_PRODUCT_X060S_X200 0x0000
1640     #define ALCATEL_PRODUCT_X220_X500D 0x0017
1641     +#define ALCATEL_PRODUCT_L100V 0x011e
1642    
1643     #define PIRELLI_VENDOR_ID 0x1266
1644     #define PIRELLI_PRODUCT_C100_1 0x1002
1645     @@ -429,9 +430,12 @@ static void option_instat_callback(struct urb *urb);
1646     #define MEDIATEK_VENDOR_ID 0x0e8d
1647     #define MEDIATEK_PRODUCT_DC_1COM 0x00a0
1648     #define MEDIATEK_PRODUCT_DC_4COM 0x00a5
1649     +#define MEDIATEK_PRODUCT_DC_4COM2 0x00a7
1650     #define MEDIATEK_PRODUCT_DC_5COM 0x00a4
1651     #define MEDIATEK_PRODUCT_7208_1COM 0x7101
1652     #define MEDIATEK_PRODUCT_7208_2COM 0x7102
1653     +#define MEDIATEK_PRODUCT_7103_2COM 0x7103
1654     +#define MEDIATEK_PRODUCT_7106_2COM 0x7106
1655     #define MEDIATEK_PRODUCT_FP_1COM 0x0003
1656     #define MEDIATEK_PRODUCT_FP_2COM 0x0023
1657     #define MEDIATEK_PRODUCT_FPDC_1COM 0x0043
1658     @@ -441,6 +445,10 @@ static void option_instat_callback(struct urb *urb);
1659     #define CELLIENT_VENDOR_ID 0x2692
1660     #define CELLIENT_PRODUCT_MEN200 0x9005
1661    
1662     +/* Hyundai Petatel Inc. products */
1663     +#define PETATEL_VENDOR_ID 0x1ff4
1664     +#define PETATEL_PRODUCT_NP10T 0x600e
1665     +
1666     /* some devices interfaces need special handling due to a number of reasons */
1667     enum option_blacklist_reason {
1668     OPTION_BLACKLIST_NONE = 0,
1669     @@ -923,7 +931,8 @@ static const struct usb_device_id option_ids[] = {
1670     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0257, 0xff, 0xff, 0xff), /* ZTE MF821 */
1671     .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
1672     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0265, 0xff, 0xff, 0xff) },
1673     - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0284, 0xff, 0xff, 0xff) },
1674     + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0284, 0xff, 0xff, 0xff), /* ZTE MF880 */
1675     + .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
1676     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0317, 0xff, 0xff, 0xff) },
1677     { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0326, 0xff, 0xff, 0xff),
1678     .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
1679     @@ -1190,6 +1199,8 @@ static const struct usb_device_id option_ids[] = {
1680     .driver_info = (kernel_ulong_t)&alcatel_x200_blacklist
1681     },
1682     { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D) },
1683     + { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_L100V),
1684     + .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
1685     { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) },
1686     { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) },
1687     { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14),
1688     @@ -1294,7 +1305,12 @@ static const struct usb_device_id option_ids[] = {
1689     { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FP_2COM, 0x0a, 0x00, 0x00) },
1690     { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FPDC_1COM, 0x0a, 0x00, 0x00) },
1691     { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_FPDC_2COM, 0x0a, 0x00, 0x00) },
1692     + { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_7103_2COM, 0xff, 0x00, 0x00) },
1693     + { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_7106_2COM, 0x02, 0x02, 0x01) },
1694     + { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x02, 0x01) },
1695     + { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x00, 0x00) },
1696     { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) },
1697     + { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T) },
1698     { } /* Terminating entry */
1699     };
1700     MODULE_DEVICE_TABLE(usb, option_ids);
1701     diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
1702     index 0b2f2dd..2f90290 100644
1703     --- a/drivers/video/mxsfb.c
1704     +++ b/drivers/video/mxsfb.c
1705     @@ -365,7 +365,8 @@ static void mxsfb_disable_controller(struct fb_info *fb_info)
1706     loop--;
1707     }
1708    
1709     - writel(VDCTRL4_SYNC_SIGNALS_ON, host->base + LCDC_VDCTRL4 + REG_CLR);
1710     + reg = readl(host->base + LCDC_VDCTRL4);
1711     + writel(reg & ~VDCTRL4_SYNC_SIGNALS_ON, host->base + LCDC_VDCTRL4);
1712    
1713     clk_disable(host->clk);
1714    
1715     diff --git a/fs/eventpoll.c b/fs/eventpoll.c
1716     index 35a852a..35a1a61 100644
1717     --- a/fs/eventpoll.c
1718     +++ b/fs/eventpoll.c
1719     @@ -1197,10 +1197,30 @@ static int ep_modify(struct eventpoll *ep, struct epitem *epi, struct epoll_even
1720     * otherwise we might miss an event that happens between the
1721     * f_op->poll() call and the new event set registering.
1722     */
1723     - epi->event.events = event->events;
1724     + epi->event.events = event->events; /* need barrier below */
1725     epi->event.data = event->data; /* protected by mtx */
1726    
1727     /*
1728     + * The following barrier has two effects:
1729     + *
1730     + * 1) Flush epi changes above to other CPUs. This ensures
1731     + * we do not miss events from ep_poll_callback if an
1732     + * event occurs immediately after we call f_op->poll().
1733     + * We need this because we did not take ep->lock while
1734     + * changing epi above (but ep_poll_callback does take
1735     + * ep->lock).
1736     + *
1737     + * 2) We also need to ensure we do not miss _past_ events
1738     + * when calling f_op->poll(). This barrier also
1739     + * pairs with the barrier in wq_has_sleeper (see
1740     + * comments for wq_has_sleeper).
1741     + *
1742     + * This barrier will now guarantee ep_poll_callback or f_op->poll
1743     + * (or both) will notice the readiness of an item.
1744     + */
1745     + smp_mb();
1746     +
1747     + /*
1748     * Get current event bits. We can safely use the file* here because
1749     * its usage count has been increased by the caller of this function.
1750     */
1751     diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c
1752     index 21eacd7..4922087 100644
1753     --- a/fs/ext4/acl.c
1754     +++ b/fs/ext4/acl.c
1755     @@ -450,8 +450,10 @@ ext4_xattr_set_acl(struct dentry *dentry, const char *name, const void *value,
1756    
1757     retry:
1758     handle = ext4_journal_start(inode, EXT4_DATA_TRANS_BLOCKS(inode->i_sb));
1759     - if (IS_ERR(handle))
1760     - return PTR_ERR(handle);
1761     + if (IS_ERR(handle)) {
1762     + error = PTR_ERR(handle);
1763     + goto release_and_out;
1764     + }
1765     error = ext4_set_acl(handle, inode, type, acl);
1766     ext4_journal_stop(handle);
1767     if (error == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries))
1768     diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
1769     index 611647b..680df5d 100644
1770     --- a/fs/ext4/extents.c
1771     +++ b/fs/ext4/extents.c
1772     @@ -2140,13 +2140,14 @@ ext4_ext_in_cache(struct inode *inode, ext4_lblk_t block,
1773     * last index in the block only.
1774     */
1775     static int ext4_ext_rm_idx(handle_t *handle, struct inode *inode,
1776     - struct ext4_ext_path *path)
1777     + struct ext4_ext_path *path, int depth)
1778     {
1779     int err;
1780     ext4_fsblk_t leaf;
1781    
1782     /* free index block */
1783     - path--;
1784     + depth--;
1785     + path = path + depth;
1786     leaf = ext4_idx_pblock(path->p_idx);
1787     if (unlikely(path->p_hdr->eh_entries == 0)) {
1788     EXT4_ERROR_INODE(inode, "path->p_hdr->eh_entries == 0");
1789     @@ -2162,6 +2163,19 @@ static int ext4_ext_rm_idx(handle_t *handle, struct inode *inode,
1790     ext_debug("index is empty, remove it, free block %llu\n", leaf);
1791     ext4_free_blocks(handle, inode, NULL, leaf, 1,
1792     EXT4_FREE_BLOCKS_METADATA | EXT4_FREE_BLOCKS_FORGET);
1793     +
1794     + while (--depth >= 0) {
1795     + if (path->p_idx != EXT_FIRST_INDEX(path->p_hdr))
1796     + break;
1797     + path--;
1798     + err = ext4_ext_get_access(handle, inode, path);
1799     + if (err)
1800     + break;
1801     + path->p_idx->ei_block = (path+1)->p_idx->ei_block;
1802     + err = ext4_ext_dirty(handle, inode, path);
1803     + if (err)
1804     + break;
1805     + }
1806     return err;
1807     }
1808    
1809     @@ -2509,7 +2523,7 @@ ext4_ext_rm_leaf(handle_t *handle, struct inode *inode,
1810     /* if this leaf is free, then we should
1811     * remove it from index block above */
1812     if (err == 0 && eh->eh_entries == 0 && path[depth].p_bh != NULL)
1813     - err = ext4_ext_rm_idx(handle, inode, path + depth);
1814     + err = ext4_ext_rm_idx(handle, inode, path, depth);
1815    
1816     out:
1817     return err;
1818     @@ -2639,7 +2653,7 @@ again:
1819     /* index is empty, remove it;
1820     * handle must be already prepared by the
1821     * truncatei_leaf() */
1822     - err = ext4_ext_rm_idx(handle, inode, path + i);
1823     + err = ext4_ext_rm_idx(handle, inode, path, i);
1824     }
1825     /* root level has p_bh == NULL, brelse() eats this */
1826     brelse(path[i].p_bh);
1827     diff --git a/fs/ext4/super.c b/fs/ext4/super.c
1828     index 489d406..f1aa1a2 100644
1829     --- a/fs/ext4/super.c
1830     +++ b/fs/ext4/super.c
1831     @@ -2204,7 +2204,9 @@ static void ext4_orphan_cleanup(struct super_block *sb,
1832     __func__, inode->i_ino, inode->i_size);
1833     jbd_debug(2, "truncating inode %lu to %lld bytes\n",
1834     inode->i_ino, inode->i_size);
1835     + mutex_lock(&inode->i_mutex);
1836     ext4_truncate(inode);
1837     + mutex_unlock(&inode->i_mutex);
1838     nr_truncates++;
1839     } else {
1840     ext4_msg(sb, KERN_DEBUG,
1841     @@ -4438,7 +4440,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
1842     }
1843    
1844     ext4_setup_system_zone(sb);
1845     - if (sbi->s_journal == NULL)
1846     + if (sbi->s_journal == NULL && !(old_sb_flags & MS_RDONLY))
1847     ext4_commit_super(sb, 1);
1848    
1849     #ifdef CONFIG_QUOTA
1850     diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
1851     index 05bbb12..c133253 100644
1852     --- a/fs/gfs2/lops.c
1853     +++ b/fs/gfs2/lops.c
1854     @@ -139,16 +139,14 @@ static void buf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le)
1855     struct gfs2_meta_header *mh;
1856     struct gfs2_trans *tr;
1857    
1858     - lock_buffer(bd->bd_bh);
1859     - gfs2_log_lock(sdp);
1860     if (!list_empty(&bd->bd_list_tr))
1861     - goto out;
1862     + return;
1863     tr = current->journal_info;
1864     tr->tr_touched = 1;
1865     tr->tr_num_buf++;
1866     list_add(&bd->bd_list_tr, &tr->tr_list_buf);
1867     if (!list_empty(&le->le_list))
1868     - goto out;
1869     + return;
1870     set_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags);
1871     set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags);
1872     gfs2_meta_check(sdp, bd->bd_bh);
1873     @@ -159,9 +157,6 @@ static void buf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le)
1874     sdp->sd_log_num_buf++;
1875     list_add(&le->le_list, &sdp->sd_log_le_buf);
1876     tr->tr_num_buf_new++;
1877     -out:
1878     - gfs2_log_unlock(sdp);
1879     - unlock_buffer(bd->bd_bh);
1880     }
1881    
1882     static void buf_lo_before_commit(struct gfs2_sbd *sdp)
1883     @@ -528,11 +523,9 @@ static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le)
1884     struct address_space *mapping = bd->bd_bh->b_page->mapping;
1885     struct gfs2_inode *ip = GFS2_I(mapping->host);
1886    
1887     - lock_buffer(bd->bd_bh);
1888     - gfs2_log_lock(sdp);
1889     if (tr) {
1890     if (!list_empty(&bd->bd_list_tr))
1891     - goto out;
1892     + return;
1893     tr->tr_touched = 1;
1894     if (gfs2_is_jdata(ip)) {
1895     tr->tr_num_buf++;
1896     @@ -540,7 +533,7 @@ static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le)
1897     }
1898     }
1899     if (!list_empty(&le->le_list))
1900     - goto out;
1901     + return;
1902    
1903     set_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags);
1904     set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags);
1905     @@ -552,9 +545,6 @@ static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le)
1906     } else {
1907     list_add_tail(&le->le_list, &sdp->sd_log_le_ordered);
1908     }
1909     -out:
1910     - gfs2_log_unlock(sdp);
1911     - unlock_buffer(bd->bd_bh);
1912     }
1913    
1914     static void gfs2_check_magic(struct buffer_head *bh)
1915     diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c
1916     index 9ec73a8..e6453c3 100644
1917     --- a/fs/gfs2/trans.c
1918     +++ b/fs/gfs2/trans.c
1919     @@ -145,14 +145,22 @@ void gfs2_trans_add_bh(struct gfs2_glock *gl, struct buffer_head *bh, int meta)
1920     struct gfs2_sbd *sdp = gl->gl_sbd;
1921     struct gfs2_bufdata *bd;
1922    
1923     + lock_buffer(bh);
1924     + gfs2_log_lock(sdp);
1925     bd = bh->b_private;
1926     if (bd)
1927     gfs2_assert(sdp, bd->bd_gl == gl);
1928     else {
1929     + gfs2_log_unlock(sdp);
1930     + unlock_buffer(bh);
1931     gfs2_attach_bufdata(gl, bh, meta);
1932     bd = bh->b_private;
1933     + lock_buffer(bh);
1934     + gfs2_log_lock(sdp);
1935     }
1936     lops_add(sdp, &bd->bd_le);
1937     + gfs2_log_unlock(sdp);
1938     + unlock_buffer(bh);
1939     }
1940    
1941     void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd)
1942     diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
1943     index 9baa39e..4ef2aae 100644
1944     --- a/fs/jbd2/transaction.c
1945     +++ b/fs/jbd2/transaction.c
1946     @@ -178,7 +178,8 @@ repeat:
1947     if (!new_transaction)
1948     goto alloc_transaction;
1949     write_lock(&journal->j_state_lock);
1950     - if (!journal->j_running_transaction) {
1951     + if (!journal->j_running_transaction &&
1952     + !journal->j_barrier_count) {
1953     jbd2_get_transaction(journal, new_transaction);
1954     new_transaction = NULL;
1955     }
1956     diff --git a/fs/jffs2/nodemgmt.c b/fs/jffs2/nodemgmt.c
1957     index 694aa5b..e304795 100644
1958     --- a/fs/jffs2/nodemgmt.c
1959     +++ b/fs/jffs2/nodemgmt.c
1960     @@ -355,14 +355,16 @@ static int jffs2_do_reserve_space(struct jffs2_sb_info *c, uint32_t minsize,
1961     spin_unlock(&c->erase_completion_lock);
1962    
1963     ret = jffs2_prealloc_raw_node_refs(c, jeb, 1);
1964     - if (ret)
1965     - return ret;
1966     +
1967     /* Just lock it again and continue. Nothing much can change because
1968     we hold c->alloc_sem anyway. In fact, it's not entirely clear why
1969     we hold c->erase_completion_lock in the majority of this function...
1970     but that's a question for another (more caffeine-rich) day. */
1971     spin_lock(&c->erase_completion_lock);
1972    
1973     + if (ret)
1974     + return ret;
1975     +
1976     waste = jeb->free_size;
1977     jffs2_link_node_ref(c, jeb,
1978     (jeb->offset + c->sector_size - waste) | REF_OBSOLETE,
1979     diff --git a/fs/udf/inode.c b/fs/udf/inode.c
1980     index 262050f..957c974 100644
1981     --- a/fs/udf/inode.c
1982     +++ b/fs/udf/inode.c
1983     @@ -575,6 +575,7 @@ static struct buffer_head *inode_getblk(struct inode *inode, sector_t block,
1984     struct udf_inode_info *iinfo = UDF_I(inode);
1985     int goal = 0, pgoal = iinfo->i_location.logicalBlockNum;
1986     int lastblock = 0;
1987     + bool isBeyondEOF;
1988    
1989     prev_epos.offset = udf_file_entry_alloc_offset(inode);
1990     prev_epos.block = iinfo->i_location;
1991     @@ -653,7 +654,7 @@ static struct buffer_head *inode_getblk(struct inode *inode, sector_t block,
1992     /* Are we beyond EOF? */
1993     if (etype == -1) {
1994     int ret;
1995     -
1996     + isBeyondEOF = 1;
1997     if (count) {
1998     if (c)
1999     laarr[0] = laarr[1];
2000     @@ -696,6 +697,7 @@ static struct buffer_head *inode_getblk(struct inode *inode, sector_t block,
2001     endnum = c + 1;
2002     lastblock = 1;
2003     } else {
2004     + isBeyondEOF = 0;
2005     endnum = startnum = ((count > 2) ? 2 : count);
2006    
2007     /* if the current extent is in position 0,
2008     @@ -738,10 +740,13 @@ static struct buffer_head *inode_getblk(struct inode *inode, sector_t block,
2009     goal, err);
2010     if (!newblocknum) {
2011     brelse(prev_epos.bh);
2012     + brelse(cur_epos.bh);
2013     + brelse(next_epos.bh);
2014     *err = -ENOSPC;
2015     return NULL;
2016     }
2017     - iinfo->i_lenExtents += inode->i_sb->s_blocksize;
2018     + if (isBeyondEOF)
2019     + iinfo->i_lenExtents += inode->i_sb->s_blocksize;
2020     }
2021    
2022     /* if the extent the requsted block is located in contains multiple
2023     @@ -768,6 +773,8 @@ static struct buffer_head *inode_getblk(struct inode *inode, sector_t block,
2024     udf_update_extents(inode, laarr, startnum, endnum, &prev_epos);
2025    
2026     brelse(prev_epos.bh);
2027     + brelse(cur_epos.bh);
2028     + brelse(next_epos.bh);
2029    
2030     newblock = udf_get_pblock(inode->i_sb, newblocknum,
2031     iinfo->i_location.partitionReferenceNum, 0);
2032     diff --git a/include/linux/if_link.h b/include/linux/if_link.h
2033     index 0ee969a..61a48b5 100644
2034     --- a/include/linux/if_link.h
2035     +++ b/include/linux/if_link.h
2036     @@ -137,6 +137,7 @@ enum {
2037     IFLA_AF_SPEC,
2038     IFLA_GROUP, /* Group the device belongs to */
2039     IFLA_NET_NS_FD,
2040     + IFLA_EXT_MASK, /* Extended info mask, VFs, etc */
2041     __IFLA_MAX
2042     };
2043    
2044     diff --git a/include/linux/netlink.h b/include/linux/netlink.h
2045     index a9dd895..fdd0188 100644
2046     --- a/include/linux/netlink.h
2047     +++ b/include/linux/netlink.h
2048     @@ -221,7 +221,8 @@ struct netlink_callback {
2049     int (*dump)(struct sk_buff * skb,
2050     struct netlink_callback *cb);
2051     int (*done)(struct netlink_callback *cb);
2052     - int family;
2053     + u16 family;
2054     + u16 min_dump_alloc;
2055     long args[6];
2056     };
2057    
2058     @@ -259,7 +260,8 @@ __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags)
2059     extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
2060     const struct nlmsghdr *nlh,
2061     int (*dump)(struct sk_buff *skb, struct netlink_callback*),
2062     - int (*done)(struct netlink_callback*));
2063     + int (*done)(struct netlink_callback*),
2064     + u16 min_dump_alloc);
2065    
2066    
2067     #define NL_NONROOT_RECV 0x1
2068     diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
2069     index bbad657..5415dfb 100644
2070     --- a/include/linux/rtnetlink.h
2071     +++ b/include/linux/rtnetlink.h
2072     @@ -600,6 +600,9 @@ struct tcamsg {
2073     #define TCA_ACT_TAB 1 /* attr type must be >=1 */
2074     #define TCAA_MAX 1
2075    
2076     +/* New extended info filters for IFLA_EXT_MASK */
2077     +#define RTEXT_FILTER_VF (1 << 0)
2078     +
2079     /* End of information exported to user level */
2080    
2081     #ifdef __KERNEL__
2082     diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
2083     index 4093ca7..3702939 100644
2084     --- a/include/net/rtnetlink.h
2085     +++ b/include/net/rtnetlink.h
2086     @@ -6,11 +6,14 @@
2087    
2088     typedef int (*rtnl_doit_func)(struct sk_buff *, struct nlmsghdr *, void *);
2089     typedef int (*rtnl_dumpit_func)(struct sk_buff *, struct netlink_callback *);
2090     +typedef u16 (*rtnl_calcit_func)(struct sk_buff *, struct nlmsghdr *);
2091    
2092     extern int __rtnl_register(int protocol, int msgtype,
2093     - rtnl_doit_func, rtnl_dumpit_func);
2094     + rtnl_doit_func, rtnl_dumpit_func,
2095     + rtnl_calcit_func);
2096     extern void rtnl_register(int protocol, int msgtype,
2097     - rtnl_doit_func, rtnl_dumpit_func);
2098     + rtnl_doit_func, rtnl_dumpit_func,
2099     + rtnl_calcit_func);
2100     extern int rtnl_unregister(int protocol, int msgtype);
2101     extern void rtnl_unregister_all(int protocol);
2102    
2103     diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
2104     index b0c7aa4..20dff64 100644
2105     --- a/kernel/trace/ring_buffer.c
2106     +++ b/kernel/trace/ring_buffer.c
2107     @@ -2926,6 +2926,8 @@ rb_get_reader_page(struct ring_buffer_per_cpu *cpu_buffer)
2108     * Splice the empty reader page into the list around the head.
2109     */
2110     reader = rb_set_head_page(cpu_buffer);
2111     + if (!reader)
2112     + goto out;
2113     cpu_buffer->reader_page->list.next = rb_list_head(reader->list.next);
2114     cpu_buffer->reader_page->list.prev = reader->list.prev;
2115    
2116     diff --git a/mm/compaction.c b/mm/compaction.c
2117     index 8ea7308..b4689f81 100644
2118     --- a/mm/compaction.c
2119     +++ b/mm/compaction.c
2120     @@ -714,14 +714,12 @@ static int compact_node(int nid)
2121     }
2122    
2123     /* Compact all nodes in the system */
2124     -static int compact_nodes(void)
2125     +static void compact_nodes(void)
2126     {
2127     int nid;
2128    
2129     for_each_online_node(nid)
2130     compact_node(nid);
2131     -
2132     - return COMPACT_COMPLETE;
2133     }
2134    
2135     /* The written value is actually unused, all memory is compacted */
2136     @@ -732,7 +730,7 @@ int sysctl_compaction_handler(struct ctl_table *table, int write,
2137     void __user *buffer, size_t *length, loff_t *ppos)
2138     {
2139     if (write)
2140     - return compact_nodes();
2141     + compact_nodes();
2142    
2143     return 0;
2144     }
2145     diff --git a/mm/huge_memory.c b/mm/huge_memory.c
2146     index 8cc11dd..a9ab45e 100644
2147     --- a/mm/huge_memory.c
2148     +++ b/mm/huge_memory.c
2149     @@ -920,6 +920,8 @@ int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
2150     count_vm_event(THP_FAULT_FALLBACK);
2151     ret = do_huge_pmd_wp_page_fallback(mm, vma, address,
2152     pmd, orig_pmd, page, haddr);
2153     + if (ret & VM_FAULT_OOM)
2154     + split_huge_page(page);
2155     put_page(page);
2156     goto out;
2157     }
2158     @@ -927,6 +929,7 @@ int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
2159    
2160     if (unlikely(mem_cgroup_newpage_charge(new_page, mm, GFP_KERNEL))) {
2161     put_page(new_page);
2162     + split_huge_page(page);
2163     put_page(page);
2164     ret |= VM_FAULT_OOM;
2165     goto out;
2166     diff --git a/mm/memory.c b/mm/memory.c
2167     index 7292acb..4da0f8a 100644
2168     --- a/mm/memory.c
2169     +++ b/mm/memory.c
2170     @@ -3470,6 +3470,7 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
2171     if (unlikely(is_vm_hugetlb_page(vma)))
2172     return hugetlb_fault(mm, vma, address, flags);
2173    
2174     +retry:
2175     pgd = pgd_offset(mm, address);
2176     pud = pud_alloc(mm, pgd, address);
2177     if (!pud)
2178     @@ -3483,13 +3484,24 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
2179     pmd, flags);
2180     } else {
2181     pmd_t orig_pmd = *pmd;
2182     + int ret;
2183     +
2184     barrier();
2185     if (pmd_trans_huge(orig_pmd)) {
2186     if (flags & FAULT_FLAG_WRITE &&
2187     !pmd_write(orig_pmd) &&
2188     - !pmd_trans_splitting(orig_pmd))
2189     - return do_huge_pmd_wp_page(mm, vma, address,
2190     - pmd, orig_pmd);
2191     + !pmd_trans_splitting(orig_pmd)) {
2192     + ret = do_huge_pmd_wp_page(mm, vma, address, pmd,
2193     + orig_pmd);
2194     + /*
2195     + * If COW results in an oom, the huge pmd will
2196     + * have been split, so retry the fault on the
2197     + * pte for a smaller charge.
2198     + */
2199     + if (unlikely(ret & VM_FAULT_OOM))
2200     + goto retry;
2201     + return ret;
2202     + }
2203     return 0;
2204     }
2205     }
2206     diff --git a/mm/page_alloc.c b/mm/page_alloc.c
2207     index eb6b3fd..0ec869e 100644
2208     --- a/mm/page_alloc.c
2209     +++ b/mm/page_alloc.c
2210     @@ -5492,7 +5492,7 @@ static inline int pfn_to_bitidx(struct zone *zone, unsigned long pfn)
2211     pfn &= (PAGES_PER_SECTION-1);
2212     return (pfn >> pageblock_order) * NR_PAGEBLOCK_BITS;
2213     #else
2214     - pfn = pfn - zone->zone_start_pfn;
2215     + pfn = pfn - round_down(zone->zone_start_pfn, pageblock_nr_pages);
2216     return (pfn >> pageblock_order) * NR_PAGEBLOCK_BITS;
2217     #endif /* CONFIG_SPARSEMEM */
2218     }
2219     diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
2220     index 71861a9..d372df2 100644
2221     --- a/net/bridge/br_netlink.c
2222     +++ b/net/bridge/br_netlink.c
2223     @@ -219,19 +219,24 @@ int __init br_netlink_init(void)
2224     if (err < 0)
2225     goto err1;
2226    
2227     - err = __rtnl_register(PF_BRIDGE, RTM_GETLINK, NULL, br_dump_ifinfo);
2228     + err = __rtnl_register(PF_BRIDGE, RTM_GETLINK, NULL,
2229     + br_dump_ifinfo, NULL);
2230     if (err)
2231     goto err2;
2232     - err = __rtnl_register(PF_BRIDGE, RTM_SETLINK, br_rtm_setlink, NULL);
2233     + err = __rtnl_register(PF_BRIDGE, RTM_SETLINK,
2234     + br_rtm_setlink, NULL, NULL);
2235     if (err)
2236     goto err3;
2237     - err = __rtnl_register(PF_BRIDGE, RTM_NEWNEIGH, br_fdb_add, NULL);
2238     + err = __rtnl_register(PF_BRIDGE, RTM_NEWNEIGH,
2239     + br_fdb_add, NULL, NULL);
2240     if (err)
2241     goto err3;
2242     - err = __rtnl_register(PF_BRIDGE, RTM_DELNEIGH, br_fdb_delete, NULL);
2243     + err = __rtnl_register(PF_BRIDGE, RTM_DELNEIGH,
2244     + br_fdb_delete, NULL, NULL);
2245     if (err)
2246     goto err3;
2247     - err = __rtnl_register(PF_BRIDGE, RTM_GETNEIGH, NULL, br_fdb_dump);
2248     + err = __rtnl_register(PF_BRIDGE, RTM_GETNEIGH,
2249     + NULL, br_fdb_dump, NULL);
2250     if (err)
2251     goto err3;
2252    
2253     diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
2254     index f39ef5c..3231b46 100644
2255     --- a/net/core/fib_rules.c
2256     +++ b/net/core/fib_rules.c
2257     @@ -740,9 +740,9 @@ static struct pernet_operations fib_rules_net_ops = {
2258     static int __init fib_rules_init(void)
2259     {
2260     int err;
2261     - rtnl_register(PF_UNSPEC, RTM_NEWRULE, fib_nl_newrule, NULL);
2262     - rtnl_register(PF_UNSPEC, RTM_DELRULE, fib_nl_delrule, NULL);
2263     - rtnl_register(PF_UNSPEC, RTM_GETRULE, NULL, fib_nl_dumprule);
2264     + rtnl_register(PF_UNSPEC, RTM_NEWRULE, fib_nl_newrule, NULL, NULL);
2265     + rtnl_register(PF_UNSPEC, RTM_DELRULE, fib_nl_delrule, NULL, NULL);
2266     + rtnl_register(PF_UNSPEC, RTM_GETRULE, NULL, fib_nl_dumprule, NULL);
2267    
2268     err = register_pernet_subsys(&fib_rules_net_ops);
2269     if (err < 0)
2270     diff --git a/net/core/neighbour.c b/net/core/neighbour.c
2271     index eb8857a..34032f2 100644
2272     --- a/net/core/neighbour.c
2273     +++ b/net/core/neighbour.c
2274     @@ -2918,12 +2918,13 @@ EXPORT_SYMBOL(neigh_sysctl_unregister);
2275    
2276     static int __init neigh_init(void)
2277     {
2278     - rtnl_register(PF_UNSPEC, RTM_NEWNEIGH, neigh_add, NULL);
2279     - rtnl_register(PF_UNSPEC, RTM_DELNEIGH, neigh_delete, NULL);
2280     - rtnl_register(PF_UNSPEC, RTM_GETNEIGH, NULL, neigh_dump_info);
2281     + rtnl_register(PF_UNSPEC, RTM_NEWNEIGH, neigh_add, NULL, NULL);
2282     + rtnl_register(PF_UNSPEC, RTM_DELNEIGH, neigh_delete, NULL, NULL);
2283     + rtnl_register(PF_UNSPEC, RTM_GETNEIGH, NULL, neigh_dump_info, NULL);
2284    
2285     - rtnl_register(PF_UNSPEC, RTM_GETNEIGHTBL, NULL, neightbl_dump_info);
2286     - rtnl_register(PF_UNSPEC, RTM_SETNEIGHTBL, neightbl_set, NULL);
2287     + rtnl_register(PF_UNSPEC, RTM_GETNEIGHTBL, NULL, neightbl_dump_info,
2288     + NULL);
2289     + rtnl_register(PF_UNSPEC, RTM_SETNEIGHTBL, neightbl_set, NULL, NULL);
2290    
2291     return 0;
2292     }
2293     diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
2294     index ac49ad5..49f281e 100644
2295     --- a/net/core/rtnetlink.c
2296     +++ b/net/core/rtnetlink.c
2297     @@ -56,6 +56,7 @@
2298     struct rtnl_link {
2299     rtnl_doit_func doit;
2300     rtnl_dumpit_func dumpit;
2301     + rtnl_calcit_func calcit;
2302     };
2303    
2304     static DEFINE_MUTEX(rtnl_mutex);
2305     @@ -144,12 +145,28 @@ static rtnl_dumpit_func rtnl_get_dumpit(int protocol, int msgindex)
2306     return tab ? tab[msgindex].dumpit : NULL;
2307     }
2308    
2309     +static rtnl_calcit_func rtnl_get_calcit(int protocol, int msgindex)
2310     +{
2311     + struct rtnl_link *tab;
2312     +
2313     + if (protocol <= RTNL_FAMILY_MAX)
2314     + tab = rtnl_msg_handlers[protocol];
2315     + else
2316     + tab = NULL;
2317     +
2318     + if (tab == NULL || tab[msgindex].calcit == NULL)
2319     + tab = rtnl_msg_handlers[PF_UNSPEC];
2320     +
2321     + return tab ? tab[msgindex].calcit : NULL;
2322     +}
2323     +
2324     /**
2325     * __rtnl_register - Register a rtnetlink message type
2326     * @protocol: Protocol family or PF_UNSPEC
2327     * @msgtype: rtnetlink message type
2328     * @doit: Function pointer called for each request message
2329     * @dumpit: Function pointer called for each dump request (NLM_F_DUMP) message
2330     + * @calcit: Function pointer to calc size of dump message
2331     *
2332     * Registers the specified function pointers (at least one of them has
2333     * to be non-NULL) to be called whenever a request message for the
2334     @@ -162,7 +179,8 @@ static rtnl_dumpit_func rtnl_get_dumpit(int protocol, int msgindex)
2335     * Returns 0 on success or a negative error code.
2336     */
2337     int __rtnl_register(int protocol, int msgtype,
2338     - rtnl_doit_func doit, rtnl_dumpit_func dumpit)
2339     + rtnl_doit_func doit, rtnl_dumpit_func dumpit,
2340     + rtnl_calcit_func calcit)
2341     {
2342     struct rtnl_link *tab;
2343     int msgindex;
2344     @@ -185,6 +203,9 @@ int __rtnl_register(int protocol, int msgtype,
2345     if (dumpit)
2346     tab[msgindex].dumpit = dumpit;
2347    
2348     + if (calcit)
2349     + tab[msgindex].calcit = calcit;
2350     +
2351     return 0;
2352     }
2353     EXPORT_SYMBOL_GPL(__rtnl_register);
2354     @@ -199,9 +220,10 @@ EXPORT_SYMBOL_GPL(__rtnl_register);
2355     * of memory implies no sense in continuing.
2356     */
2357     void rtnl_register(int protocol, int msgtype,
2358     - rtnl_doit_func doit, rtnl_dumpit_func dumpit)
2359     + rtnl_doit_func doit, rtnl_dumpit_func dumpit,
2360     + rtnl_calcit_func calcit)
2361     {
2362     - if (__rtnl_register(protocol, msgtype, doit, dumpit) < 0)
2363     + if (__rtnl_register(protocol, msgtype, doit, dumpit, calcit) < 0)
2364     panic("Unable to register rtnetlink message handler, "
2365     "protocol = %d, message type = %d\n",
2366     protocol, msgtype);
2367     @@ -704,10 +726,11 @@ static void copy_rtnl_link_stats64(void *v, const struct rtnl_link_stats64 *b)
2368     }
2369    
2370     /* All VF info */
2371     -static inline int rtnl_vfinfo_size(const struct net_device *dev)
2372     +static inline int rtnl_vfinfo_size(const struct net_device *dev,
2373     + u32 ext_filter_mask)
2374     {
2375     - if (dev->dev.parent && dev_is_pci(dev->dev.parent)) {
2376     -
2377     + if (dev->dev.parent && dev_is_pci(dev->dev.parent) &&
2378     + (ext_filter_mask & RTEXT_FILTER_VF)) {
2379     int num_vfs = dev_num_vf(dev->dev.parent);
2380     size_t size = nla_total_size(sizeof(struct nlattr));
2381     size += nla_total_size(num_vfs * sizeof(struct nlattr));
2382     @@ -745,7 +768,8 @@ static size_t rtnl_port_size(const struct net_device *dev)
2383     return port_self_size;
2384     }
2385    
2386     -static noinline size_t if_nlmsg_size(const struct net_device *dev)
2387     +static noinline size_t if_nlmsg_size(const struct net_device *dev,
2388     + u32 ext_filter_mask)
2389     {
2390     return NLMSG_ALIGN(sizeof(struct ifinfomsg))
2391     + nla_total_size(IFNAMSIZ) /* IFLA_IFNAME */
2392     @@ -763,8 +787,9 @@ static noinline size_t if_nlmsg_size(const struct net_device *dev)
2393     + nla_total_size(4) /* IFLA_MASTER */
2394     + nla_total_size(1) /* IFLA_OPERSTATE */
2395     + nla_total_size(1) /* IFLA_LINKMODE */
2396     - + nla_total_size(4) /* IFLA_NUM_VF */
2397     - + rtnl_vfinfo_size(dev) /* IFLA_VFINFO_LIST */
2398     + + nla_total_size(ext_filter_mask
2399     + & RTEXT_FILTER_VF ? 4 : 0) /* IFLA_NUM_VF */
2400     + + rtnl_vfinfo_size(dev, ext_filter_mask) /* IFLA_VFINFO_LIST */
2401     + rtnl_port_size(dev) /* IFLA_VF_PORTS + IFLA_PORT_SELF */
2402     + rtnl_link_get_size(dev) /* IFLA_LINKINFO */
2403     + rtnl_link_get_af_size(dev); /* IFLA_AF_SPEC */
2404     @@ -847,7 +872,7 @@ static int rtnl_port_fill(struct sk_buff *skb, struct net_device *dev)
2405    
2406     static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
2407     int type, u32 pid, u32 seq, u32 change,
2408     - unsigned int flags)
2409     + unsigned int flags, u32 ext_filter_mask)
2410     {
2411     struct ifinfomsg *ifm;
2412     struct nlmsghdr *nlh;
2413     @@ -920,10 +945,11 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
2414     goto nla_put_failure;
2415     copy_rtnl_link_stats64(nla_data(attr), stats);
2416    
2417     - if (dev->dev.parent)
2418     + if (dev->dev.parent && (ext_filter_mask & RTEXT_FILTER_VF))
2419     NLA_PUT_U32(skb, IFLA_NUM_VF, dev_num_vf(dev->dev.parent));
2420    
2421     - if (dev->netdev_ops->ndo_get_vf_config && dev->dev.parent) {
2422     + if (dev->netdev_ops->ndo_get_vf_config && dev->dev.parent
2423     + && (ext_filter_mask & RTEXT_FILTER_VF)) {
2424     int i;
2425    
2426     struct nlattr *vfinfo, *vf;
2427     @@ -1010,11 +1036,21 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
2428     struct net_device *dev;
2429     struct hlist_head *head;
2430     struct hlist_node *node;
2431     + struct nlattr *tb[IFLA_MAX+1];
2432     + u32 ext_filter_mask = 0;
2433    
2434     s_h = cb->args[0];
2435     s_idx = cb->args[1];
2436    
2437     rcu_read_lock();
2438     +
2439     + if (nlmsg_parse(cb->nlh, sizeof(struct rtgenmsg), tb, IFLA_MAX,
2440     + ifla_policy) >= 0) {
2441     +
2442     + if (tb[IFLA_EXT_MASK])
2443     + ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]);
2444     + }
2445     +
2446     for (h = s_h; h < NETDEV_HASHENTRIES; h++, s_idx = 0) {
2447     idx = 0;
2448     head = &net->dev_index_head[h];
2449     @@ -1024,7 +1060,8 @@ static int rtnl_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb)
2450     if (rtnl_fill_ifinfo(skb, dev, RTM_NEWLINK,
2451     NETLINK_CB(cb->skb).pid,
2452     cb->nlh->nlmsg_seq, 0,
2453     - NLM_F_MULTI) <= 0)
2454     + NLM_F_MULTI,
2455     + ext_filter_mask) <= 0)
2456     goto out;
2457     cont:
2458     idx++;
2459     @@ -1058,6 +1095,7 @@ const struct nla_policy ifla_policy[IFLA_MAX+1] = {
2460     [IFLA_VF_PORTS] = { .type = NLA_NESTED },
2461     [IFLA_PORT_SELF] = { .type = NLA_NESTED },
2462     [IFLA_AF_SPEC] = { .type = NLA_NESTED },
2463     + [IFLA_EXT_MASK] = { .type = NLA_U32 },
2464     };
2465     EXPORT_SYMBOL(ifla_policy);
2466    
2467     @@ -1790,6 +1828,7 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
2468     struct net_device *dev = NULL;
2469     struct sk_buff *nskb;
2470     int err;
2471     + u32 ext_filter_mask = 0;
2472    
2473     err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy);
2474     if (err < 0)
2475     @@ -1798,6 +1837,9 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
2476     if (tb[IFLA_IFNAME])
2477     nla_strlcpy(ifname, tb[IFLA_IFNAME], IFNAMSIZ);
2478    
2479     + if (tb[IFLA_EXT_MASK])
2480     + ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]);
2481     +
2482     ifm = nlmsg_data(nlh);
2483     if (ifm->ifi_index > 0)
2484     dev = __dev_get_by_index(net, ifm->ifi_index);
2485     @@ -1809,12 +1851,12 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
2486     if (dev == NULL)
2487     return -ENODEV;
2488    
2489     - nskb = nlmsg_new(if_nlmsg_size(dev), GFP_KERNEL);
2490     + nskb = nlmsg_new(if_nlmsg_size(dev, ext_filter_mask), GFP_KERNEL);
2491     if (nskb == NULL)
2492     return -ENOBUFS;
2493    
2494     err = rtnl_fill_ifinfo(nskb, dev, RTM_NEWLINK, NETLINK_CB(skb).pid,
2495     - nlh->nlmsg_seq, 0, 0);
2496     + nlh->nlmsg_seq, 0, 0, ext_filter_mask);
2497     if (err < 0) {
2498     /* -EMSGSIZE implies BUG in if_nlmsg_size */
2499     WARN_ON(err == -EMSGSIZE);
2500     @@ -1825,6 +1867,35 @@ static int rtnl_getlink(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
2501     return err;
2502     }
2503    
2504     +static u16 rtnl_calcit(struct sk_buff *skb, struct nlmsghdr *nlh)
2505     +{
2506     + struct net *net = sock_net(skb->sk);
2507     + struct net_device *dev;
2508     + struct nlattr *tb[IFLA_MAX+1];
2509     + u32 ext_filter_mask = 0;
2510     + u16 min_ifinfo_dump_size = 0;
2511     +
2512     + if (nlmsg_parse(nlh, sizeof(struct rtgenmsg), tb, IFLA_MAX,
2513     + ifla_policy) >= 0) {
2514     + if (tb[IFLA_EXT_MASK])
2515     + ext_filter_mask = nla_get_u32(tb[IFLA_EXT_MASK]);
2516     + }
2517     +
2518     + if (!ext_filter_mask)
2519     + return NLMSG_GOODSIZE;
2520     + /*
2521     + * traverse the list of net devices and compute the minimum
2522     + * buffer size based upon the filter mask.
2523     + */
2524     + list_for_each_entry(dev, &net->dev_base_head, dev_list) {
2525     + min_ifinfo_dump_size = max_t(u16, min_ifinfo_dump_size,
2526     + if_nlmsg_size(dev,
2527     + ext_filter_mask));
2528     + }
2529     +
2530     + return min_ifinfo_dump_size;
2531     +}
2532     +
2533     static int rtnl_dump_all(struct sk_buff *skb, struct netlink_callback *cb)
2534     {
2535     int idx;
2536     @@ -1854,12 +1925,13 @@ void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change)
2537     struct net *net = dev_net(dev);
2538     struct sk_buff *skb;
2539     int err = -ENOBUFS;
2540     + size_t if_info_size;
2541    
2542     - skb = nlmsg_new(if_nlmsg_size(dev), GFP_KERNEL);
2543     + skb = nlmsg_new((if_info_size = if_nlmsg_size(dev, 0)), GFP_KERNEL);
2544     if (skb == NULL)
2545     goto errout;
2546    
2547     - err = rtnl_fill_ifinfo(skb, dev, type, 0, 0, change, 0);
2548     + err = rtnl_fill_ifinfo(skb, dev, type, 0, 0, change, 0, 0);
2549     if (err < 0) {
2550     /* -EMSGSIZE implies BUG in if_nlmsg_size() */
2551     WARN_ON(err == -EMSGSIZE);
2552     @@ -1909,14 +1981,20 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
2553     if (kind == 2 && nlh->nlmsg_flags&NLM_F_DUMP) {
2554     struct sock *rtnl;
2555     rtnl_dumpit_func dumpit;
2556     + rtnl_calcit_func calcit;
2557     + u16 min_dump_alloc = 0;
2558    
2559     dumpit = rtnl_get_dumpit(family, type);
2560     if (dumpit == NULL)
2561     return -EOPNOTSUPP;
2562     + calcit = rtnl_get_calcit(family, type);
2563     + if (calcit)
2564     + min_dump_alloc = calcit(skb, nlh);
2565    
2566     __rtnl_unlock();
2567     rtnl = net->rtnl;
2568     - err = netlink_dump_start(rtnl, skb, nlh, dumpit, NULL);
2569     + err = netlink_dump_start(rtnl, skb, nlh, dumpit,
2570     + NULL, min_dump_alloc);
2571     rtnl_lock();
2572     return err;
2573     }
2574     @@ -2026,12 +2104,13 @@ void __init rtnetlink_init(void)
2575     netlink_set_nonroot(NETLINK_ROUTE, NL_NONROOT_RECV);
2576     register_netdevice_notifier(&rtnetlink_dev_notifier);
2577    
2578     - rtnl_register(PF_UNSPEC, RTM_GETLINK, rtnl_getlink, rtnl_dump_ifinfo);
2579     - rtnl_register(PF_UNSPEC, RTM_SETLINK, rtnl_setlink, NULL);
2580     - rtnl_register(PF_UNSPEC, RTM_NEWLINK, rtnl_newlink, NULL);
2581     - rtnl_register(PF_UNSPEC, RTM_DELLINK, rtnl_dellink, NULL);
2582     + rtnl_register(PF_UNSPEC, RTM_GETLINK, rtnl_getlink,
2583     + rtnl_dump_ifinfo, rtnl_calcit);
2584     + rtnl_register(PF_UNSPEC, RTM_SETLINK, rtnl_setlink, NULL, NULL);
2585     + rtnl_register(PF_UNSPEC, RTM_NEWLINK, rtnl_newlink, NULL, NULL);
2586     + rtnl_register(PF_UNSPEC, RTM_DELLINK, rtnl_dellink, NULL, NULL);
2587    
2588     - rtnl_register(PF_UNSPEC, RTM_GETADDR, NULL, rtnl_dump_all);
2589     - rtnl_register(PF_UNSPEC, RTM_GETROUTE, NULL, rtnl_dump_all);
2590     + rtnl_register(PF_UNSPEC, RTM_GETADDR, NULL, rtnl_dump_all, NULL);
2591     + rtnl_register(PF_UNSPEC, RTM_GETROUTE, NULL, rtnl_dump_all, NULL);
2592     }
2593    
2594     diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
2595     index 3609eac..ed1bb8c 100644
2596     --- a/net/dcb/dcbnl.c
2597     +++ b/net/dcb/dcbnl.c
2598     @@ -1819,8 +1819,8 @@ static int __init dcbnl_init(void)
2599     {
2600     INIT_LIST_HEAD(&dcb_app_list);
2601    
2602     - rtnl_register(PF_UNSPEC, RTM_GETDCB, dcb_doit, NULL);
2603     - rtnl_register(PF_UNSPEC, RTM_SETDCB, dcb_doit, NULL);
2604     + rtnl_register(PF_UNSPEC, RTM_GETDCB, dcb_doit, NULL, NULL);
2605     + rtnl_register(PF_UNSPEC, RTM_SETDCB, dcb_doit, NULL, NULL);
2606    
2607     return 0;
2608     }
2609     diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
2610     index cf26ac7..3780fd6 100644
2611     --- a/net/decnet/dn_dev.c
2612     +++ b/net/decnet/dn_dev.c
2613     @@ -1414,9 +1414,9 @@ void __init dn_dev_init(void)
2614    
2615     dn_dev_devices_on();
2616    
2617     - rtnl_register(PF_DECnet, RTM_NEWADDR, dn_nl_newaddr, NULL);
2618     - rtnl_register(PF_DECnet, RTM_DELADDR, dn_nl_deladdr, NULL);
2619     - rtnl_register(PF_DECnet, RTM_GETADDR, NULL, dn_nl_dump_ifaddr);
2620     + rtnl_register(PF_DECnet, RTM_NEWADDR, dn_nl_newaddr, NULL, NULL);
2621     + rtnl_register(PF_DECnet, RTM_DELADDR, dn_nl_deladdr, NULL, NULL);
2622     + rtnl_register(PF_DECnet, RTM_GETADDR, NULL, dn_nl_dump_ifaddr, NULL);
2623    
2624     proc_net_fops_create(&init_net, "decnet_dev", S_IRUGO, &dn_dev_seq_fops);
2625    
2626     diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c
2627     index 1c74ed3..104324d 100644
2628     --- a/net/decnet/dn_fib.c
2629     +++ b/net/decnet/dn_fib.c
2630     @@ -763,8 +763,8 @@ void __init dn_fib_init(void)
2631    
2632     register_dnaddr_notifier(&dn_fib_dnaddr_notifier);
2633    
2634     - rtnl_register(PF_DECnet, RTM_NEWROUTE, dn_fib_rtm_newroute, NULL);
2635     - rtnl_register(PF_DECnet, RTM_DELROUTE, dn_fib_rtm_delroute, NULL);
2636     + rtnl_register(PF_DECnet, RTM_NEWROUTE, dn_fib_rtm_newroute, NULL, NULL);
2637     + rtnl_register(PF_DECnet, RTM_DELROUTE, dn_fib_rtm_delroute, NULL, NULL);
2638     }
2639    
2640    
2641     diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
2642     index b91b603..82d6250 100644
2643     --- a/net/decnet/dn_route.c
2644     +++ b/net/decnet/dn_route.c
2645     @@ -1843,10 +1843,11 @@ void __init dn_route_init(void)
2646     proc_net_fops_create(&init_net, "decnet_cache", S_IRUGO, &dn_rt_cache_seq_fops);
2647    
2648     #ifdef CONFIG_DECNET_ROUTER
2649     - rtnl_register(PF_DECnet, RTM_GETROUTE, dn_cache_getroute, dn_fib_dump);
2650     + rtnl_register(PF_DECnet, RTM_GETROUTE, dn_cache_getroute,
2651     + dn_fib_dump, NULL);
2652     #else
2653     rtnl_register(PF_DECnet, RTM_GETROUTE, dn_cache_getroute,
2654     - dn_cache_dump);
2655     + dn_cache_dump, NULL);
2656     #endif
2657     }
2658    
2659     diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
2660     index 7d7fb20..070f214 100644
2661     --- a/net/ipv4/devinet.c
2662     +++ b/net/ipv4/devinet.c
2663     @@ -1838,8 +1838,8 @@ void __init devinet_init(void)
2664    
2665     rtnl_af_register(&inet_af_ops);
2666    
2667     - rtnl_register(PF_INET, RTM_NEWADDR, inet_rtm_newaddr, NULL);
2668     - rtnl_register(PF_INET, RTM_DELADDR, inet_rtm_deladdr, NULL);
2669     - rtnl_register(PF_INET, RTM_GETADDR, NULL, inet_dump_ifaddr);
2670     + rtnl_register(PF_INET, RTM_NEWADDR, inet_rtm_newaddr, NULL, NULL);
2671     + rtnl_register(PF_INET, RTM_DELADDR, inet_rtm_deladdr, NULL, NULL);
2672     + rtnl_register(PF_INET, RTM_GETADDR, NULL, inet_dump_ifaddr, NULL);
2673     }
2674    
2675     diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
2676     index 2252471..92fc5f6 100644
2677     --- a/net/ipv4/fib_frontend.c
2678     +++ b/net/ipv4/fib_frontend.c
2679     @@ -1124,9 +1124,9 @@ static struct pernet_operations fib_net_ops = {
2680    
2681     void __init ip_fib_init(void)
2682     {
2683     - rtnl_register(PF_INET, RTM_NEWROUTE, inet_rtm_newroute, NULL);
2684     - rtnl_register(PF_INET, RTM_DELROUTE, inet_rtm_delroute, NULL);
2685     - rtnl_register(PF_INET, RTM_GETROUTE, NULL, inet_dump_fib);
2686     + rtnl_register(PF_INET, RTM_NEWROUTE, inet_rtm_newroute, NULL, NULL);
2687     + rtnl_register(PF_INET, RTM_DELROUTE, inet_rtm_delroute, NULL, NULL);
2688     + rtnl_register(PF_INET, RTM_GETROUTE, NULL, inet_dump_fib, NULL);
2689    
2690     register_pernet_subsys(&fib_net_ops);
2691     register_netdevice_notifier(&fib_netdev_notifier);
2692     diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
2693     index 3267d38..389a2e6 100644
2694     --- a/net/ipv4/inet_diag.c
2695     +++ b/net/ipv4/inet_diag.c
2696     @@ -869,7 +869,7 @@ static int inet_diag_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
2697     }
2698    
2699     return netlink_dump_start(idiagnl, skb, nlh,
2700     - inet_diag_dump, NULL);
2701     + inet_diag_dump, NULL, 0);
2702     }
2703    
2704     return inet_diag_get_exact(skb, nlh);
2705     diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
2706     index ec7d8e7..dc89714 100644
2707     --- a/net/ipv4/ipmr.c
2708     +++ b/net/ipv4/ipmr.c
2709     @@ -2554,7 +2554,8 @@ int __init ip_mr_init(void)
2710     goto add_proto_fail;
2711     }
2712     #endif
2713     - rtnl_register(RTNL_FAMILY_IPMR, RTM_GETROUTE, NULL, ipmr_rtm_dumproute);
2714     + rtnl_register(RTNL_FAMILY_IPMR, RTM_GETROUTE,
2715     + NULL, ipmr_rtm_dumproute, NULL);
2716     return 0;
2717    
2718     #ifdef CONFIG_IP_PIMSM_V2
2719     diff --git a/net/ipv4/route.c b/net/ipv4/route.c
2720     index 5ff2614..0428b64 100644
2721     --- a/net/ipv4/route.c
2722     +++ b/net/ipv4/route.c
2723     @@ -3454,7 +3454,7 @@ int __init ip_rt_init(void)
2724     xfrm_init();
2725     xfrm4_init(ip_rt_max_size);
2726     #endif
2727     - rtnl_register(PF_INET, RTM_GETROUTE, inet_rtm_getroute, NULL);
2728     + rtnl_register(PF_INET, RTM_GETROUTE, inet_rtm_getroute, NULL, NULL);
2729    
2730     #ifdef CONFIG_SYSCTL
2731     register_pernet_subsys(&sysctl_route_ops);
2732     diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
2733     index 70d6a7f..e845c0c 100644
2734     --- a/net/ipv6/addrconf.c
2735     +++ b/net/ipv6/addrconf.c
2736     @@ -4694,16 +4694,20 @@ int __init addrconf_init(void)
2737     if (err < 0)
2738     goto errout_af;
2739    
2740     - err = __rtnl_register(PF_INET6, RTM_GETLINK, NULL, inet6_dump_ifinfo);
2741     + err = __rtnl_register(PF_INET6, RTM_GETLINK, NULL, inet6_dump_ifinfo,
2742     + NULL);
2743     if (err < 0)
2744     goto errout;
2745    
2746     /* Only the first call to __rtnl_register can fail */
2747     - __rtnl_register(PF_INET6, RTM_NEWADDR, inet6_rtm_newaddr, NULL);
2748     - __rtnl_register(PF_INET6, RTM_DELADDR, inet6_rtm_deladdr, NULL);
2749     - __rtnl_register(PF_INET6, RTM_GETADDR, inet6_rtm_getaddr, inet6_dump_ifaddr);
2750     - __rtnl_register(PF_INET6, RTM_GETMULTICAST, NULL, inet6_dump_ifmcaddr);
2751     - __rtnl_register(PF_INET6, RTM_GETANYCAST, NULL, inet6_dump_ifacaddr);
2752     + __rtnl_register(PF_INET6, RTM_NEWADDR, inet6_rtm_newaddr, NULL, NULL);
2753     + __rtnl_register(PF_INET6, RTM_DELADDR, inet6_rtm_deladdr, NULL, NULL);
2754     + __rtnl_register(PF_INET6, RTM_GETADDR, inet6_rtm_getaddr,
2755     + inet6_dump_ifaddr, NULL);
2756     + __rtnl_register(PF_INET6, RTM_GETMULTICAST, NULL,
2757     + inet6_dump_ifmcaddr, NULL);
2758     + __rtnl_register(PF_INET6, RTM_GETANYCAST, NULL,
2759     + inet6_dump_ifacaddr, NULL);
2760    
2761     ipv6_addr_label_rtnl_register();
2762    
2763     diff --git a/net/ipv6/addrlabel.c b/net/ipv6/addrlabel.c
2764     index c8993e5..2d8ddba 100644
2765     --- a/net/ipv6/addrlabel.c
2766     +++ b/net/ipv6/addrlabel.c
2767     @@ -592,8 +592,11 @@ out:
2768    
2769     void __init ipv6_addr_label_rtnl_register(void)
2770     {
2771     - __rtnl_register(PF_INET6, RTM_NEWADDRLABEL, ip6addrlbl_newdel, NULL);
2772     - __rtnl_register(PF_INET6, RTM_DELADDRLABEL, ip6addrlbl_newdel, NULL);
2773     - __rtnl_register(PF_INET6, RTM_GETADDRLABEL, ip6addrlbl_get, ip6addrlbl_dump);
2774     + __rtnl_register(PF_INET6, RTM_NEWADDRLABEL, ip6addrlbl_newdel,
2775     + NULL, NULL);
2776     + __rtnl_register(PF_INET6, RTM_DELADDRLABEL, ip6addrlbl_newdel,
2777     + NULL, NULL);
2778     + __rtnl_register(PF_INET6, RTM_GETADDRLABEL, ip6addrlbl_get,
2779     + ip6addrlbl_dump, NULL);
2780     }
2781    
2782     diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
2783     index 0f9b37a..320d91d 100644
2784     --- a/net/ipv6/ip6_fib.c
2785     +++ b/net/ipv6/ip6_fib.c
2786     @@ -1586,7 +1586,8 @@ int __init fib6_init(void)
2787     if (ret)
2788     goto out_kmem_cache_create;
2789    
2790     - ret = __rtnl_register(PF_INET6, RTM_GETROUTE, NULL, inet6_dump_fib);
2791     + ret = __rtnl_register(PF_INET6, RTM_GETROUTE, NULL, inet6_dump_fib,
2792     + NULL);
2793     if (ret)
2794     goto out_unregister_subsys;
2795     out:
2796     diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
2797     index 86e3cc1..def0538 100644
2798     --- a/net/ipv6/ip6mr.c
2799     +++ b/net/ipv6/ip6mr.c
2800     @@ -1356,7 +1356,8 @@ int __init ip6_mr_init(void)
2801     goto add_proto_fail;
2802     }
2803     #endif
2804     - rtnl_register(RTNL_FAMILY_IP6MR, RTM_GETROUTE, NULL, ip6mr_rtm_dumproute);
2805     + rtnl_register(RTNL_FAMILY_IP6MR, RTM_GETROUTE, NULL,
2806     + ip6mr_rtm_dumproute, NULL);
2807     return 0;
2808     #ifdef CONFIG_IPV6_PIMSM_V2
2809     add_proto_fail:
2810     diff --git a/net/ipv6/route.c b/net/ipv6/route.c
2811     index da056c8..550fec3 100644
2812     --- a/net/ipv6/route.c
2813     +++ b/net/ipv6/route.c
2814     @@ -2956,9 +2956,9 @@ int __init ip6_route_init(void)
2815     goto fib6_rules_init;
2816    
2817     ret = -ENOBUFS;
2818     - if (__rtnl_register(PF_INET6, RTM_NEWROUTE, inet6_rtm_newroute, NULL) ||
2819     - __rtnl_register(PF_INET6, RTM_DELROUTE, inet6_rtm_delroute, NULL) ||
2820     - __rtnl_register(PF_INET6, RTM_GETROUTE, inet6_rtm_getroute, NULL))
2821     + if (__rtnl_register(PF_INET6, RTM_NEWROUTE, inet6_rtm_newroute, NULL, NULL) ||
2822     + __rtnl_register(PF_INET6, RTM_DELROUTE, inet6_rtm_delroute, NULL, NULL) ||
2823     + __rtnl_register(PF_INET6, RTM_GETROUTE, inet6_rtm_getroute, NULL, NULL))
2824     goto out_register_late_subsys;
2825    
2826     ret = register_netdevice_notifier(&ip6_route_dev_notifier);
2827     diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
2828     index ca7bf10..4b40a3b 100644
2829     --- a/net/mac80211/sta_info.c
2830     +++ b/net/mac80211/sta_info.c
2831     @@ -793,7 +793,7 @@ void sta_info_init(struct ieee80211_local *local)
2832    
2833     void sta_info_stop(struct ieee80211_local *local)
2834     {
2835     - del_timer(&local->sta_cleanup);
2836     + del_timer_sync(&local->sta_cleanup);
2837     sta_info_flush(local, NULL);
2838     }
2839    
2840     diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c
2841     index 42aa64b..ee37ae5 100644
2842     --- a/net/netfilter/ipset/ip_set_core.c
2843     +++ b/net/netfilter/ipset/ip_set_core.c
2844     @@ -1120,7 +1120,7 @@ ip_set_dump(struct sock *ctnl, struct sk_buff *skb,
2845    
2846     return netlink_dump_start(ctnl, skb, nlh,
2847     ip_set_dump_start,
2848     - ip_set_dump_done);
2849     + ip_set_dump_done, 0);
2850     }
2851    
2852     /* Add, del and test */
2853     diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
2854     index 482e90c..7dec88a 100644
2855     --- a/net/netfilter/nf_conntrack_netlink.c
2856     +++ b/net/netfilter/nf_conntrack_netlink.c
2857     @@ -970,7 +970,7 @@ ctnetlink_get_conntrack(struct sock *ctnl, struct sk_buff *skb,
2858    
2859     if (nlh->nlmsg_flags & NLM_F_DUMP)
2860     return netlink_dump_start(ctnl, skb, nlh, ctnetlink_dump_table,
2861     - ctnetlink_done);
2862     + ctnetlink_done, 0);
2863    
2864     err = ctnetlink_parse_zone(cda[CTA_ZONE], &zone);
2865     if (err < 0)
2866     @@ -1840,7 +1840,7 @@ ctnetlink_get_expect(struct sock *ctnl, struct sk_buff *skb,
2867     if (nlh->nlmsg_flags & NLM_F_DUMP) {
2868     return netlink_dump_start(ctnl, skb, nlh,
2869     ctnetlink_exp_dump_table,
2870     - ctnetlink_exp_done);
2871     + ctnetlink_exp_done, 0);
2872     }
2873    
2874     err = ctnetlink_parse_zone(cda[CTA_EXPECT_ZONE], &zone);
2875     diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
2876     index d29c222..10851ee 100644
2877     --- a/net/netlink/af_netlink.c
2878     +++ b/net/netlink/af_netlink.c
2879     @@ -1677,13 +1677,10 @@ static int netlink_dump(struct sock *sk)
2880     {
2881     struct netlink_sock *nlk = nlk_sk(sk);
2882     struct netlink_callback *cb;
2883     - struct sk_buff *skb;
2884     + struct sk_buff *skb = NULL;
2885     struct nlmsghdr *nlh;
2886     int len, err = -ENOBUFS;
2887     -
2888     - skb = sock_rmalloc(sk, NLMSG_GOODSIZE, 0, GFP_KERNEL);
2889     - if (!skb)
2890     - goto errout;
2891     + int alloc_size;
2892    
2893     mutex_lock(nlk->cb_mutex);
2894    
2895     @@ -1693,6 +1690,12 @@ static int netlink_dump(struct sock *sk)
2896     goto errout_skb;
2897     }
2898    
2899     + alloc_size = max_t(int, cb->min_dump_alloc, NLMSG_GOODSIZE);
2900     +
2901     + skb = sock_rmalloc(sk, alloc_size, 0, GFP_KERNEL);
2902     + if (!skb)
2903     + goto errout;
2904     +
2905     len = cb->dump(skb, cb);
2906    
2907     if (len > 0) {
2908     @@ -1735,7 +1738,8 @@ int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
2909     const struct nlmsghdr *nlh,
2910     int (*dump)(struct sk_buff *skb,
2911     struct netlink_callback *),
2912     - int (*done)(struct netlink_callback *))
2913     + int (*done)(struct netlink_callback *),
2914     + u16 min_dump_alloc)
2915     {
2916     struct netlink_callback *cb;
2917     struct sock *sk;
2918     @@ -1749,6 +1753,7 @@ int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
2919     cb->dump = dump;
2920     cb->done = done;
2921     cb->nlh = nlh;
2922     + cb->min_dump_alloc = min_dump_alloc;
2923     atomic_inc(&skb->users);
2924     cb->skb = skb;
2925    
2926     diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
2927     index 1781d99..482fa57 100644
2928     --- a/net/netlink/genetlink.c
2929     +++ b/net/netlink/genetlink.c
2930     @@ -525,7 +525,7 @@ static int genl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
2931    
2932     genl_unlock();
2933     err = netlink_dump_start(net->genl_sock, skb, nlh,
2934     - ops->dumpit, ops->done);
2935     + ops->dumpit, ops->done, 0);
2936     genl_lock();
2937     return err;
2938     }
2939     diff --git a/net/phonet/pn_netlink.c b/net/phonet/pn_netlink.c
2940     index 438accb..d61f676 100644
2941     --- a/net/phonet/pn_netlink.c
2942     +++ b/net/phonet/pn_netlink.c
2943     @@ -289,15 +289,16 @@ out:
2944    
2945     int __init phonet_netlink_register(void)
2946     {
2947     - int err = __rtnl_register(PF_PHONET, RTM_NEWADDR, addr_doit, NULL);
2948     + int err = __rtnl_register(PF_PHONET, RTM_NEWADDR, addr_doit,
2949     + NULL, NULL);
2950     if (err)
2951     return err;
2952    
2953     /* Further __rtnl_register() cannot fail */
2954     - __rtnl_register(PF_PHONET, RTM_DELADDR, addr_doit, NULL);
2955     - __rtnl_register(PF_PHONET, RTM_GETADDR, NULL, getaddr_dumpit);
2956     - __rtnl_register(PF_PHONET, RTM_NEWROUTE, route_doit, NULL);
2957     - __rtnl_register(PF_PHONET, RTM_DELROUTE, route_doit, NULL);
2958     - __rtnl_register(PF_PHONET, RTM_GETROUTE, NULL, route_dumpit);
2959     + __rtnl_register(PF_PHONET, RTM_DELADDR, addr_doit, NULL, NULL);
2960     + __rtnl_register(PF_PHONET, RTM_GETADDR, NULL, getaddr_dumpit, NULL);
2961     + __rtnl_register(PF_PHONET, RTM_NEWROUTE, route_doit, NULL, NULL);
2962     + __rtnl_register(PF_PHONET, RTM_DELROUTE, route_doit, NULL, NULL);
2963     + __rtnl_register(PF_PHONET, RTM_GETROUTE, NULL, route_dumpit, NULL);
2964     return 0;
2965     }
2966     diff --git a/net/sched/act_api.c b/net/sched/act_api.c
2967     index a606025..2f64262 100644
2968     --- a/net/sched/act_api.c
2969     +++ b/net/sched/act_api.c
2970     @@ -1115,9 +1115,10 @@ nlmsg_failure:
2971    
2972     static int __init tc_action_init(void)
2973     {
2974     - rtnl_register(PF_UNSPEC, RTM_NEWACTION, tc_ctl_action, NULL);
2975     - rtnl_register(PF_UNSPEC, RTM_DELACTION, tc_ctl_action, NULL);
2976     - rtnl_register(PF_UNSPEC, RTM_GETACTION, tc_ctl_action, tc_dump_action);
2977     + rtnl_register(PF_UNSPEC, RTM_NEWACTION, tc_ctl_action, NULL, NULL);
2978     + rtnl_register(PF_UNSPEC, RTM_DELACTION, tc_ctl_action, NULL, NULL);
2979     + rtnl_register(PF_UNSPEC, RTM_GETACTION, tc_ctl_action, tc_dump_action,
2980     + NULL);
2981    
2982     return 0;
2983     }
2984     diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
2985     index bb2c523..9563887 100644
2986     --- a/net/sched/cls_api.c
2987     +++ b/net/sched/cls_api.c
2988     @@ -610,10 +610,10 @@ EXPORT_SYMBOL(tcf_exts_dump_stats);
2989    
2990     static int __init tc_filter_init(void)
2991     {
2992     - rtnl_register(PF_UNSPEC, RTM_NEWTFILTER, tc_ctl_tfilter, NULL);
2993     - rtnl_register(PF_UNSPEC, RTM_DELTFILTER, tc_ctl_tfilter, NULL);
2994     + rtnl_register(PF_UNSPEC, RTM_NEWTFILTER, tc_ctl_tfilter, NULL, NULL);
2995     + rtnl_register(PF_UNSPEC, RTM_DELTFILTER, tc_ctl_tfilter, NULL, NULL);
2996     rtnl_register(PF_UNSPEC, RTM_GETTFILTER, tc_ctl_tfilter,
2997     - tc_dump_tfilter);
2998     + tc_dump_tfilter, NULL);
2999    
3000     return 0;
3001     }
3002     diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
3003     index 6b86276..8182aef 100644
3004     --- a/net/sched/sch_api.c
3005     +++ b/net/sched/sch_api.c
3006     @@ -1792,12 +1792,12 @@ static int __init pktsched_init(void)
3007     register_qdisc(&pfifo_head_drop_qdisc_ops);
3008     register_qdisc(&mq_qdisc_ops);
3009    
3010     - rtnl_register(PF_UNSPEC, RTM_NEWQDISC, tc_modify_qdisc, NULL);
3011     - rtnl_register(PF_UNSPEC, RTM_DELQDISC, tc_get_qdisc, NULL);
3012     - rtnl_register(PF_UNSPEC, RTM_GETQDISC, tc_get_qdisc, tc_dump_qdisc);
3013     - rtnl_register(PF_UNSPEC, RTM_NEWTCLASS, tc_ctl_tclass, NULL);
3014     - rtnl_register(PF_UNSPEC, RTM_DELTCLASS, tc_ctl_tclass, NULL);
3015     - rtnl_register(PF_UNSPEC, RTM_GETTCLASS, tc_ctl_tclass, tc_dump_tclass);
3016     + rtnl_register(PF_UNSPEC, RTM_NEWQDISC, tc_modify_qdisc, NULL, NULL);
3017     + rtnl_register(PF_UNSPEC, RTM_DELQDISC, tc_get_qdisc, NULL, NULL);
3018     + rtnl_register(PF_UNSPEC, RTM_GETQDISC, tc_get_qdisc, tc_dump_qdisc, NULL);
3019     + rtnl_register(PF_UNSPEC, RTM_NEWTCLASS, tc_ctl_tclass, NULL, NULL);
3020     + rtnl_register(PF_UNSPEC, RTM_DELTCLASS, tc_ctl_tclass, NULL, NULL);
3021     + rtnl_register(PF_UNSPEC, RTM_GETTCLASS, tc_ctl_tclass, tc_dump_tclass, NULL);
3022    
3023     return 0;
3024     }
3025     diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
3026     index c57f97f..d7824ec 100644
3027     --- a/net/sunrpc/sched.c
3028     +++ b/net/sunrpc/sched.c
3029     @@ -844,16 +844,35 @@ struct rpc_task *rpc_new_task(const struct rpc_task_setup *setup_data)
3030     return task;
3031     }
3032    
3033     +/*
3034     + * rpc_free_task - release rpc task and perform cleanups
3035     + *
3036     + * Note that we free up the rpc_task _after_ rpc_release_calldata()
3037     + * in order to work around a workqueue dependency issue.
3038     + *
3039     + * Tejun Heo states:
3040     + * "Workqueue currently considers two work items to be the same if they're
3041     + * on the same address and won't execute them concurrently - ie. it
3042     + * makes a work item which is queued again while being executed wait
3043     + * for the previous execution to complete.
3044     + *
3045     + * If a work function frees the work item, and then waits for an event
3046     + * which should be performed by another work item and *that* work item
3047     + * recycles the freed work item, it can create a false dependency loop.
3048     + * There really is no reliable way to detect this short of verifying
3049     + * every memory free."
3050     + *
3051     + */
3052     static void rpc_free_task(struct rpc_task *task)
3053     {
3054     - const struct rpc_call_ops *tk_ops = task->tk_ops;
3055     - void *calldata = task->tk_calldata;
3056     + unsigned short tk_flags = task->tk_flags;
3057     +
3058     + rpc_release_calldata(task->tk_ops, task->tk_calldata);
3059    
3060     - if (task->tk_flags & RPC_TASK_DYNAMIC) {
3061     + if (tk_flags & RPC_TASK_DYNAMIC) {
3062     dprintk("RPC: %5u freeing task\n", task->tk_pid);
3063     mempool_free(task, rpc_task_mempool);
3064     }
3065     - rpc_release_calldata(tk_ops, calldata);
3066     }
3067    
3068     static void rpc_async_release(struct work_struct *work)
3069     diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
3070     index 05f82e6..9bbe858 100644
3071     --- a/net/xfrm/xfrm_user.c
3072     +++ b/net/xfrm/xfrm_user.c
3073     @@ -2326,7 +2326,8 @@ static int xfrm_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
3074     if (link->dump == NULL)
3075     return -EINVAL;
3076    
3077     - return netlink_dump_start(net->xfrm.nlsk, skb, nlh, link->dump, link->done);
3078     + return netlink_dump_start(net->xfrm.nlsk, skb, nlh,
3079     + link->dump, link->done, 0);
3080     }
3081    
3082     err = nlmsg_parse(nlh, xfrm_msg_min[type], attrs, XFRMA_MAX,
3083     diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c
3084     index 88eec38..05bdcb2 100644
3085     --- a/sound/arm/pxa2xx-ac97-lib.c
3086     +++ b/sound/arm/pxa2xx-ac97-lib.c
3087     @@ -146,6 +146,8 @@ static inline void pxa_ac97_warm_pxa27x(void)
3088    
3089     static inline void pxa_ac97_cold_pxa27x(void)
3090     {
3091     + unsigned int timeout;
3092     +
3093     GCR &= GCR_COLD_RST; /* clear everything but nCRST */
3094     GCR &= ~GCR_COLD_RST; /* then assert nCRST */
3095    
3096     @@ -155,8 +157,10 @@ static inline void pxa_ac97_cold_pxa27x(void)
3097     clk_enable(ac97conf_clk);
3098     udelay(5);
3099     clk_disable(ac97conf_clk);
3100     - GCR = GCR_COLD_RST;
3101     - udelay(50);
3102     + GCR = GCR_COLD_RST | GCR_WARM_RST;
3103     + timeout = 100; /* wait for the codec-ready bit to be set */
3104     + while (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR)) && timeout--)
3105     + mdelay(1);
3106     }
3107     #endif
3108    
3109     diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c
3110     index a3b9cbb..ba03dc2 100644
3111     --- a/sound/soc/codecs/wm2000.c
3112     +++ b/sound/soc/codecs/wm2000.c
3113     @@ -224,9 +224,9 @@ static int wm2000_power_up(struct i2c_client *i2c, int analogue)
3114    
3115     ret = wm2000_read(i2c, WM2000_REG_SPEECH_CLARITY);
3116     if (wm2000->speech_clarity)
3117     - ret &= ~WM2000_SPEECH_CLARITY;
3118     - else
3119     ret |= WM2000_SPEECH_CLARITY;
3120     + else
3121     + ret &= ~WM2000_SPEECH_CLARITY;
3122     wm2000_write(i2c, WM2000_REG_SPEECH_CLARITY, ret);
3123    
3124     wm2000_write(i2c, WM2000_REG_SYS_START0, 0x33);

  ViewVC Help
Powered by ViewVC 1.1.20