/[linux-patches]/genpatches-2.6/tags/2.6.32-47/1041_linux-2.6.32.42.patch
Gentoo

Contents of /genpatches-2.6/tags/2.6.32-47/1041_linux-2.6.32.42.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2037 - (show annotations) (download)
Wed Dec 28 14:38:55 2011 UTC (6 years, 9 months ago) by psomas
File size: 87096 byte(s)
2.6.32-47 release
1 diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
2 index 499a133..9161338 100644
3 --- a/arch/powerpc/kernel/misc_64.S
4 +++ b/arch/powerpc/kernel/misc_64.S
5 @@ -463,7 +463,8 @@ _GLOBAL(disable_kernel_fp)
6 * wait for the flag to change, indicating this kernel is going away but
7 * the slave code for the next one is at addresses 0 to 100.
8 *
9 - * This is used by all slaves.
10 + * This is used by all slaves, even those that did not find a matching
11 + * paca in the secondary startup code.
12 *
13 * Physical (hardware) cpu id should be in r3.
14 */
15 @@ -472,10 +473,6 @@ _GLOBAL(kexec_wait)
16 1: mflr r5
17 addi r5,r5,kexec_flag-1b
18
19 - li r4,KEXEC_STATE_REAL_MODE
20 - stb r4,PACAKEXECSTATE(r13)
21 - SYNC
22 -
23 99: HMT_LOW
24 #ifdef CONFIG_KEXEC /* use no memory without kexec */
25 lwz r4,0(r5)
26 @@ -500,11 +497,17 @@ kexec_flag:
27 *
28 * get phys id from paca
29 * switch to real mode
30 + * mark the paca as no longer used
31 * join other cpus in kexec_wait(phys_id)
32 */
33 _GLOBAL(kexec_smp_wait)
34 lhz r3,PACAHWCPUID(r13)
35 bl real_mode
36 +
37 + li r4,KEXEC_STATE_REAL_MODE
38 + stb r4,PACAKEXECSTATE(r13)
39 + SYNC
40 +
41 b .kexec_wait
42
43 /*
44 diff --git a/arch/powerpc/oprofile/op_model_power4.c b/arch/powerpc/oprofile/op_model_power4.c
45 index 8077409..93636ca 100644
46 --- a/arch/powerpc/oprofile/op_model_power4.c
47 +++ b/arch/powerpc/oprofile/op_model_power4.c
48 @@ -261,6 +261,28 @@ static int get_kernel(unsigned long pc, unsigned long mmcra)
49 return is_kernel;
50 }
51
52 +static bool pmc_overflow(unsigned long val)
53 +{
54 + if ((int)val < 0)
55 + return true;
56 +
57 + /*
58 + * Events on POWER7 can roll back if a speculative event doesn't
59 + * eventually complete. Unfortunately in some rare cases they will
60 + * raise a performance monitor exception. We need to catch this to
61 + * ensure we reset the PMC. In all cases the PMC will be 256 or less
62 + * cycles from overflow.
63 + *
64 + * We only do this if the first pass fails to find any overflowing
65 + * PMCs because a user might set a period of less than 256 and we
66 + * don't want to mistakenly reset them.
67 + */
68 + if (__is_processor(PV_POWER7) && ((0x80000000 - val) <= 256))
69 + return true;
70 +
71 + return false;
72 +}
73 +
74 static void power4_handle_interrupt(struct pt_regs *regs,
75 struct op_counter_config *ctr)
76 {
77 @@ -281,7 +303,7 @@ static void power4_handle_interrupt(struct pt_regs *regs,
78
79 for (i = 0; i < cur_cpu_spec->num_pmcs; ++i) {
80 val = classic_ctr_read(i);
81 - if (val < 0) {
82 + if (pmc_overflow(val)) {
83 if (oprofile_running && ctr[i].enabled) {
84 oprofile_add_ext_sample(pc, regs, i, is_kernel);
85 classic_ctr_write(i, reset_value[i]);
86 diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
87 index d2c6c93..61c5874 100644
88 --- a/arch/x86/include/asm/uaccess.h
89 +++ b/arch/x86/include/asm/uaccess.h
90 @@ -42,7 +42,7 @@
91 * Returns 0 if the range is valid, nonzero otherwise.
92 *
93 * This is equivalent to the following test:
94 - * (u33)addr + (u33)size >= (u33)current->addr_limit.seg (u65 for x86_64)
95 + * (u33)addr + (u33)size > (u33)current->addr_limit.seg (u65 for x86_64)
96 *
97 * This needs 33-bit (65-bit for x86_64) arithmetic. We have a carry...
98 */
99 diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
100 index 400be99..fc5d470 100644
101 --- a/arch/x86/kernel/amd_iommu_init.c
102 +++ b/arch/x86/kernel/amd_iommu_init.c
103 @@ -640,8 +640,8 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu,
104 {
105 u8 *p = (u8 *)h;
106 u8 *end = p, flags = 0;
107 - u16 dev_i, devid = 0, devid_start = 0, devid_to = 0;
108 - u32 ext_flags = 0;
109 + u16 devid = 0, devid_start = 0, devid_to = 0;
110 + u32 dev_i, ext_flags = 0;
111 bool alias = false;
112 struct ivhd_entry *e;
113
114 @@ -796,7 +796,7 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu,
115 /* Initializes the device->iommu mapping for the driver */
116 static int __init init_iommu_devices(struct amd_iommu *iommu)
117 {
118 - u16 i;
119 + u32 i;
120
121 for (i = iommu->first_device; i <= iommu->last_device; ++i)
122 set_iommu_for_device(iommu, i);
123 @@ -1068,7 +1068,7 @@ static int __init init_memory_definitions(struct acpi_table_header *table)
124 */
125 static void init_device_table(void)
126 {
127 - u16 devid;
128 + u32 devid;
129
130 for (devid = 0; devid <= amd_iommu_last_bdf; ++devid) {
131 set_dev_entry_bit(devid, DEV_ENTRY_VALID);
132 diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
133 index 396c693..6e082dc 100644
134 --- a/arch/x86/kernel/cpu/amd.c
135 +++ b/arch/x86/kernel/cpu/amd.c
136 @@ -567,8 +567,11 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
137 }
138 #endif
139
140 - /* As a rule processors have APIC timer running in deep C states */
141 - if (c->x86 > 0xf && !cpu_has_amd_erratum(amd_erratum_400))
142 + /*
143 + * Family 0x12 and above processors have APIC timer
144 + * running in deep C states.
145 + */
146 + if (c->x86 > 0x11)
147 set_cpu_cap(c, X86_FEATURE_ARAT);
148
149 /*
150 @@ -584,10 +587,13 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
151 * Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=33012
152 */
153 u64 mask;
154 + int err;
155
156 - rdmsrl(MSR_AMD64_MCx_MASK(4), mask);
157 - mask |= (1 << 10);
158 - wrmsrl(MSR_AMD64_MCx_MASK(4), mask);
159 + err = rdmsrl_safe(MSR_AMD64_MCx_MASK(4), &mask);
160 + if (err == 0) {
161 + mask |= (1 << 10);
162 + checking_wrmsrl(MSR_AMD64_MCx_MASK(4), mask);
163 + }
164 }
165 }
166
167 diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
168 index 4cf7956..c40c432 100644
169 --- a/arch/x86/kernel/process_32.c
170 +++ b/arch/x86/kernel/process_32.c
171 @@ -298,7 +298,6 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
172 {
173 set_user_gs(regs, 0);
174 regs->fs = 0;
175 - set_fs(USER_DS);
176 regs->ds = __USER_DS;
177 regs->es = __USER_DS;
178 regs->ss = __USER_DS;
179 diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
180 index 868fdb4..39493bc 100644
181 --- a/arch/x86/kernel/process_64.c
182 +++ b/arch/x86/kernel/process_64.c
183 @@ -356,7 +356,6 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
184 regs->cs = __USER_CS;
185 regs->ss = __USER_DS;
186 regs->flags = 0x200;
187 - set_fs(USER_DS);
188 /*
189 * Free the old FP and other extended state
190 */
191 diff --git a/arch/x86/lib/copy_user_64.S b/arch/x86/lib/copy_user_64.S
192 index 6ba0f7b..af8debd 100644
193 --- a/arch/x86/lib/copy_user_64.S
194 +++ b/arch/x86/lib/copy_user_64.S
195 @@ -72,7 +72,7 @@ ENTRY(copy_to_user)
196 addq %rdx,%rcx
197 jc bad_to_user
198 cmpq TI_addr_limit(%rax),%rcx
199 - jae bad_to_user
200 + ja bad_to_user
201 ALTERNATIVE_JUMP X86_FEATURE_REP_GOOD,copy_user_generic_unrolled,copy_user_generic_string
202 CFI_ENDPROC
203 ENDPROC(copy_to_user)
204 @@ -85,7 +85,7 @@ ENTRY(copy_from_user)
205 addq %rdx,%rcx
206 jc bad_from_user
207 cmpq TI_addr_limit(%rax),%rcx
208 - jae bad_from_user
209 + ja bad_from_user
210 ALTERNATIVE_JUMP X86_FEATURE_REP_GOOD,copy_user_generic_unrolled,copy_user_generic_string
211 CFI_ENDPROC
212 ENDPROC(copy_from_user)
213 diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
214 index 6ec047d..356a799 100644
215 --- a/arch/x86/xen/mmu.c
216 +++ b/arch/x86/xen/mmu.c
217 @@ -1141,7 +1141,7 @@ static void drop_other_mm_ref(void *info)
218
219 active_mm = percpu_read(cpu_tlbstate.active_mm);
220
221 - if (active_mm == mm)
222 + if (active_mm == mm && percpu_read(cpu_tlbstate.state) != TLBSTATE_OK)
223 leave_mm(smp_processor_id());
224
225 /* If this cpu still has a stale cr3 reference, then make sure
226 diff --git a/arch/x86/xen/multicalls.c b/arch/x86/xen/multicalls.c
227 index 8bff7e7..1b2b73f 100644
228 --- a/arch/x86/xen/multicalls.c
229 +++ b/arch/x86/xen/multicalls.c
230 @@ -189,10 +189,10 @@ struct multicall_space __xen_mc_entry(size_t args)
231 unsigned argidx = roundup(b->argidx, sizeof(u64));
232
233 BUG_ON(preemptible());
234 - BUG_ON(b->argidx > MC_ARGS);
235 + BUG_ON(b->argidx >= MC_ARGS);
236
237 if (b->mcidx == MC_BATCH ||
238 - (argidx + args) > MC_ARGS) {
239 + (argidx + args) >= MC_ARGS) {
240 mc_stats_flush(b->mcidx == MC_BATCH ? FL_SLOTS : FL_ARGS);
241 xen_mc_flush();
242 argidx = roundup(b->argidx, sizeof(u64));
243 @@ -206,7 +206,7 @@ struct multicall_space __xen_mc_entry(size_t args)
244 ret.args = &b->args[argidx];
245 b->argidx = argidx + args;
246
247 - BUG_ON(b->argidx > MC_ARGS);
248 + BUG_ON(b->argidx >= MC_ARGS);
249 return ret;
250 }
251
252 @@ -216,7 +216,7 @@ struct multicall_space xen_mc_extend_args(unsigned long op, size_t size)
253 struct multicall_space ret = { NULL, NULL };
254
255 BUG_ON(preemptible());
256 - BUG_ON(b->argidx > MC_ARGS);
257 + BUG_ON(b->argidx >= MC_ARGS);
258
259 if (b->mcidx == 0)
260 return ret;
261 @@ -224,14 +224,14 @@ struct multicall_space xen_mc_extend_args(unsigned long op, size_t size)
262 if (b->entries[b->mcidx - 1].op != op)
263 return ret;
264
265 - if ((b->argidx + size) > MC_ARGS)
266 + if ((b->argidx + size) >= MC_ARGS)
267 return ret;
268
269 ret.mc = &b->entries[b->mcidx - 1];
270 ret.args = &b->args[b->argidx];
271 b->argidx += size;
272
273 - BUG_ON(b->argidx > MC_ARGS);
274 + BUG_ON(b->argidx >= MC_ARGS);
275 return ret;
276 }
277
278 diff --git a/block/blk-core.c b/block/blk-core.c
279 index 71da511..cffd737 100644
280 --- a/block/blk-core.c
281 +++ b/block/blk-core.c
282 @@ -310,6 +310,7 @@ void blk_unplug_timeout(unsigned long data)
283 trace_block_unplug_timer(q);
284 kblockd_schedule_work(q, &q->unplug_work);
285 }
286 +EXPORT_SYMBOL(blk_put_queue);
287
288 void blk_unplug(struct request_queue *q)
289 {
290 @@ -612,6 +613,7 @@ int blk_get_queue(struct request_queue *q)
291
292 return 1;
293 }
294 +EXPORT_SYMBOL(blk_get_queue);
295
296 static inline void blk_free_request(struct request_queue *q, struct request *rq)
297 {
298 diff --git a/block/blk.h b/block/blk.h
299 index 5ee3d7e..1414836 100644
300 --- a/block/blk.h
301 +++ b/block/blk.h
302 @@ -62,7 +62,8 @@ static inline struct request *__elv_next_request(struct request_queue *q)
303 return rq;
304 }
305
306 - if (!q->elevator->ops->elevator_dispatch_fn(q, 0))
307 + if (test_bit(QUEUE_FLAG_DEAD, &q->queue_flags) ||
308 + !q->elevator->ops->elevator_dispatch_fn(q, 0))
309 return NULL;
310 }
311 }
312 diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
313 index 0b09703..d71d2c0 100644
314 --- a/drivers/acpi/scan.c
315 +++ b/drivers/acpi/scan.c
316 @@ -1026,12 +1026,6 @@ static void acpi_device_set_id(struct acpi_device *device)
317 if (ACPI_IS_ROOT_DEVICE(device)) {
318 acpi_add_id(device, ACPI_SYSTEM_HID);
319 break;
320 - } else if (ACPI_IS_ROOT_DEVICE(device->parent)) {
321 - /* \_SB_, the only root-level namespace device */
322 - acpi_add_id(device, ACPI_BUS_HID);
323 - strcpy(device->pnp.device_name, ACPI_BUS_DEVICE_NAME);
324 - strcpy(device->pnp.device_class, ACPI_BUS_CLASS);
325 - break;
326 }
327
328 status = acpi_get_object_info(device->handle, &info);
329 @@ -1064,6 +1058,12 @@ static void acpi_device_set_id(struct acpi_device *device)
330 acpi_add_id(device, ACPI_BAY_HID);
331 else if (ACPI_SUCCESS(acpi_dock_match(device)))
332 acpi_add_id(device, ACPI_DOCK_HID);
333 + else if (!acpi_device_hid(device) &&
334 + ACPI_IS_ROOT_DEVICE(device->parent)) {
335 + acpi_add_id(device, ACPI_BUS_HID); /* \_SB, LNXSYBUS */
336 + strcpy(device->pnp.device_name, ACPI_BUS_DEVICE_NAME);
337 + strcpy(device->pnp.device_class, ACPI_BUS_CLASS);
338 + }
339
340 break;
341 case ACPI_BUS_TYPE_POWER:
342 diff --git a/drivers/ata/pata_cmd64x.c b/drivers/ata/pata_cmd64x.c
343 index f0bad9b..ccd2694 100644
344 --- a/drivers/ata/pata_cmd64x.c
345 +++ b/drivers/ata/pata_cmd64x.c
346 @@ -2,6 +2,7 @@
347 * pata_cmd64x.c - CMD64x PATA for new ATA layer
348 * (C) 2005 Red Hat Inc
349 * Alan Cox <alan@lxorguk.ukuu.org.uk>
350 + * (C) 2009-2010 Bartlomiej Zolnierkiewicz
351 *
352 * Based upon
353 * linux/drivers/ide/pci/cmd64x.c Version 1.30 Sept 10, 2002
354 @@ -39,11 +40,10 @@
355
356 enum {
357 CFR = 0x50,
358 - CFR_INTR_CH0 = 0x02,
359 - CNTRL = 0x51,
360 - CNTRL_DIS_RA0 = 0x40,
361 - CNTRL_DIS_RA1 = 0x80,
362 - CNTRL_ENA_2ND = 0x08,
363 + CFR_INTR_CH0 = 0x04,
364 + CNTRL = 0x51,
365 + CNTRL_CH0 = 0x04,
366 + CNTRL_CH1 = 0x08,
367 CMDTIM = 0x52,
368 ARTTIM0 = 0x53,
369 DRWTIM0 = 0x54,
370 @@ -53,9 +53,6 @@ enum {
371 ARTTIM23_DIS_RA2 = 0x04,
372 ARTTIM23_DIS_RA3 = 0x08,
373 ARTTIM23_INTR_CH1 = 0x10,
374 - ARTTIM2 = 0x57,
375 - ARTTIM3 = 0x57,
376 - DRWTIM23 = 0x58,
377 DRWTIM2 = 0x58,
378 BRST = 0x59,
379 DRWTIM3 = 0x5b,
380 @@ -63,14 +60,11 @@ enum {
381 MRDMODE = 0x71,
382 MRDMODE_INTR_CH0 = 0x04,
383 MRDMODE_INTR_CH1 = 0x08,
384 - MRDMODE_BLK_CH0 = 0x10,
385 - MRDMODE_BLK_CH1 = 0x20,
386 BMIDESR0 = 0x72,
387 UDIDETCR0 = 0x73,
388 DTPR0 = 0x74,
389 BMIDECR1 = 0x78,
390 BMIDECSR = 0x79,
391 - BMIDESR1 = 0x7A,
392 UDIDETCR1 = 0x7B,
393 DTPR1 = 0x7C
394 };
395 @@ -147,7 +141,9 @@ static void cmd64x_set_timing(struct ata_port *ap, struct ata_device *adev, u8 m
396 /* Now convert the clocks into values we can actually stuff into
397 the chip */
398
399 - if (t.recover > 1)
400 + if (t.recover == 16)
401 + t.recover = 0;
402 + else if (t.recover > 1)
403 t.recover--;
404 else
405 t.recover = 15;
406 @@ -245,7 +241,7 @@ static void cmd648_bmdma_stop(struct ata_queued_cmd *qc)
407 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
408 u8 dma_intr;
409 int dma_mask = ap->port_no ? ARTTIM23_INTR_CH1 : CFR_INTR_CH0;
410 - int dma_reg = ap->port_no ? ARTTIM2 : CFR;
411 + int dma_reg = ap->port_no ? ARTTIM23 : CFR;
412
413 ata_bmdma_stop(qc);
414
415 @@ -294,8 +290,6 @@ static struct ata_port_operations cmd648_port_ops = {
416
417 static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
418 {
419 - u32 class_rev;
420 -
421 static const struct ata_port_info cmd_info[6] = {
422 { /* CMD 643 - no UDMA */
423 .flags = ATA_FLAG_SLAVE_POSS,
424 @@ -337,27 +331,41 @@ static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
425 .port_ops = &cmd648_port_ops
426 }
427 };
428 - const struct ata_port_info *ppi[] = { &cmd_info[id->driver_data], NULL };
429 - u8 mrdmode;
430 + const struct ata_port_info *ppi[] = {
431 + &cmd_info[id->driver_data],
432 + &cmd_info[id->driver_data],
433 + NULL
434 + };
435 + u8 mrdmode, reg;
436 int rc;
437 + struct pci_dev *bridge = pdev->bus->self;
438 + /* mobility split bridges don't report enabled ports correctly */
439 + int port_ok = !(bridge && bridge->vendor ==
440 + PCI_VENDOR_ID_MOBILITY_ELECTRONICS);
441 + /* all (with exceptions below) apart from 643 have CNTRL_CH0 bit */
442 + int cntrl_ch0_ok = (id->driver_data != 0);
443
444 rc = pcim_enable_device(pdev);
445 if (rc)
446 return rc;
447
448 - pci_read_config_dword(pdev, PCI_CLASS_REVISION, &class_rev);
449 - class_rev &= 0xFF;
450 -
451 if (id->driver_data == 0) /* 643 */
452 ata_pci_bmdma_clear_simplex(pdev);
453
454 if (pdev->device == PCI_DEVICE_ID_CMD_646) {
455 /* Does UDMA work ? */
456 - if (class_rev > 4)
457 + if (pdev->revision > 4) {
458 ppi[0] = &cmd_info[2];
459 + ppi[1] = &cmd_info[2];
460 + }
461 /* Early rev with other problems ? */
462 - else if (class_rev == 1)
463 + else if (pdev->revision == 1) {
464 ppi[0] = &cmd_info[3];
465 + ppi[1] = &cmd_info[3];
466 + }
467 + /* revs 1,2 have no CNTRL_CH0 */
468 + if (pdev->revision < 3)
469 + cntrl_ch0_ok = 0;
470 }
471
472 pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 64);
473 @@ -366,6 +374,20 @@ static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
474 mrdmode |= 0x02; /* Memory read line enable */
475 pci_write_config_byte(pdev, MRDMODE, mrdmode);
476
477 + /* check for enabled ports */
478 + pci_read_config_byte(pdev, CNTRL, &reg);
479 + if (!port_ok)
480 + dev_printk(KERN_NOTICE, &pdev->dev, "Mobility Bridge detected, ignoring CNTRL port enable/disable\n");
481 + if (port_ok && cntrl_ch0_ok && !(reg & CNTRL_CH0)) {
482 + dev_printk(KERN_NOTICE, &pdev->dev, "Primary port is disabled\n");
483 + ppi[0] = &ata_dummy_port_info;
484 +
485 + }
486 + if (port_ok && !(reg & CNTRL_CH1)) {
487 + dev_printk(KERN_NOTICE, &pdev->dev, "Secondary port is disabled\n");
488 + ppi[1] = &ata_dummy_port_info;
489 + }
490 +
491 /* Force PIO 0 here.. */
492
493 /* PPC specific fixup copied from old driver */
494 diff --git a/drivers/ata/pata_hpt366.c b/drivers/ata/pata_hpt366.c
495 index d7f2da1..b9d8836 100644
496 --- a/drivers/ata/pata_hpt366.c
497 +++ b/drivers/ata/pata_hpt366.c
498 @@ -344,7 +344,6 @@ static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
499 const struct ata_port_info *ppi[] = { &info_hpt366, NULL };
500
501 void *hpriv = NULL;
502 - u32 class_rev;
503 u32 reg1;
504 int rc;
505
506 @@ -352,13 +351,10 @@ static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
507 if (rc)
508 return rc;
509
510 - pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
511 - class_rev &= 0xFF;
512 -
513 /* May be a later chip in disguise. Check */
514 /* Newer chips are not in the HPT36x driver. Ignore them */
515 - if (class_rev > 2)
516 - return -ENODEV;
517 + if (dev->revision > 2)
518 + return -ENODEV;
519
520 hpt36x_init_chipset(dev);
521
522 diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c
523 index ec07c53..5af7f19 100644
524 --- a/drivers/ata/pata_hpt37x.c
525 +++ b/drivers/ata/pata_hpt37x.c
526 @@ -789,9 +789,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
527 static const int MHz[4] = { 33, 40, 50, 66 };
528 void *private_data = NULL;
529 const struct ata_port_info *ppi[] = { NULL, NULL };
530 -
531 + u8 rev = dev->revision;
532 u8 irqmask;
533 - u32 class_rev;
534 u8 mcr1;
535 u32 freq;
536 int prefer_dpll = 1;
537 @@ -806,19 +805,16 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
538 if (rc)
539 return rc;
540
541 - pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
542 - class_rev &= 0xFF;
543 -
544 if (dev->device == PCI_DEVICE_ID_TTI_HPT366) {
545 /* May be a later chip in disguise. Check */
546 /* Older chips are in the HPT366 driver. Ignore them */
547 - if (class_rev < 3)
548 + if (rev < 3)
549 return -ENODEV;
550 /* N series chips have their own driver. Ignore */
551 - if (class_rev == 6)
552 + if (rev == 6)
553 return -ENODEV;
554
555 - switch(class_rev) {
556 + switch(rev) {
557 case 3:
558 ppi[0] = &info_hpt370;
559 chip_table = &hpt370;
560 @@ -834,28 +830,29 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
561 chip_table = &hpt372;
562 break;
563 default:
564 - printk(KERN_ERR "pata_hpt37x: Unknown HPT366 subtype please report (%d).\n", class_rev);
565 + printk(KERN_ERR "pata_hpt37x: Unknown HPT366 "
566 + "subtype, please report (%d).\n", rev);
567 return -ENODEV;
568 }
569 } else {
570 switch(dev->device) {
571 case PCI_DEVICE_ID_TTI_HPT372:
572 /* 372N if rev >= 2*/
573 - if (class_rev >= 2)
574 + if (rev >= 2)
575 return -ENODEV;
576 ppi[0] = &info_hpt372;
577 chip_table = &hpt372a;
578 break;
579 case PCI_DEVICE_ID_TTI_HPT302:
580 /* 302N if rev > 1 */
581 - if (class_rev > 1)
582 + if (rev > 1)
583 return -ENODEV;
584 ppi[0] = &info_hpt372;
585 /* Check this */
586 chip_table = &hpt302;
587 break;
588 case PCI_DEVICE_ID_TTI_HPT371:
589 - if (class_rev > 1)
590 + if (rev > 1)
591 return -ENODEV;
592 ppi[0] = &info_hpt372;
593 chip_table = &hpt371;
594 diff --git a/drivers/ata/pata_hpt3x2n.c b/drivers/ata/pata_hpt3x2n.c
595 index d9f2913..100f227 100644
596 --- a/drivers/ata/pata_hpt3x2n.c
597 +++ b/drivers/ata/pata_hpt3x2n.c
598 @@ -452,10 +452,8 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
599 .port_ops = &hpt3x2n_port_ops
600 };
601 const struct ata_port_info *ppi[] = { &info, NULL };
602 -
603 + u8 rev = dev->revision;
604 u8 irqmask;
605 - u32 class_rev;
606 -
607 unsigned int pci_mhz;
608 unsigned int f_low, f_high;
609 int adjust;
610 @@ -467,26 +465,23 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
611 if (rc)
612 return rc;
613
614 - pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
615 - class_rev &= 0xFF;
616 -
617 switch(dev->device) {
618 case PCI_DEVICE_ID_TTI_HPT366:
619 - if (class_rev < 6)
620 + if (rev < 6)
621 return -ENODEV;
622 break;
623 case PCI_DEVICE_ID_TTI_HPT371:
624 - if (class_rev < 2)
625 + if (rev < 2)
626 return -ENODEV;
627 /* 371N if rev > 1 */
628 break;
629 case PCI_DEVICE_ID_TTI_HPT372:
630 /* 372N if rev >= 2*/
631 - if (class_rev < 2)
632 + if (rev < 2)
633 return -ENODEV;
634 break;
635 case PCI_DEVICE_ID_TTI_HPT302:
636 - if (class_rev < 2)
637 + if (rev < 2)
638 return -ENODEV;
639 break;
640 case PCI_DEVICE_ID_TTI_HPT372N:
641 diff --git a/drivers/ata/pata_sil680.c b/drivers/ata/pata_sil680.c
642 index 4cb649d..a2ace48 100644
643 --- a/drivers/ata/pata_sil680.c
644 +++ b/drivers/ata/pata_sil680.c
645 @@ -212,13 +212,11 @@ static struct ata_port_operations sil680_port_ops = {
646
647 static u8 sil680_init_chip(struct pci_dev *pdev, int *try_mmio)
648 {
649 - u32 class_rev = 0;
650 u8 tmpbyte = 0;
651
652 - pci_read_config_dword(pdev, PCI_CLASS_REVISION, &class_rev);
653 - class_rev &= 0xff;
654 /* FIXME: double check */
655 - pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, (class_rev) ? 1 : 255);
656 + pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE,
657 + pdev->revision ? 1 : 255);
658
659 pci_write_config_byte(pdev, 0x80, 0x00);
660 pci_write_config_byte(pdev, 0x84, 0x00);
661 diff --git a/drivers/block/brd.c b/drivers/block/brd.c
662 index 4f68843..2ef55c4 100644
663 --- a/drivers/block/brd.c
664 +++ b/drivers/block/brd.c
665 @@ -498,7 +498,7 @@ static struct kobject *brd_probe(dev_t dev, int *part, void *data)
666 struct kobject *kobj;
667
668 mutex_lock(&brd_devices_mutex);
669 - brd = brd_init_one(dev & MINORMASK);
670 + brd = brd_init_one(MINOR(dev) >> part_shift);
671 kobj = brd ? get_disk(brd->brd_disk) : ERR_PTR(-ENOMEM);
672 mutex_unlock(&brd_devices_mutex);
673
674 @@ -531,15 +531,18 @@ static int __init brd_init(void)
675 if (max_part > 0)
676 part_shift = fls(max_part);
677
678 + if ((1UL << part_shift) > DISK_MAX_PARTS)
679 + return -EINVAL;
680 +
681 if (rd_nr > 1UL << (MINORBITS - part_shift))
682 return -EINVAL;
683
684 if (rd_nr) {
685 nr = rd_nr;
686 - range = rd_nr;
687 + range = rd_nr << part_shift;
688 } else {
689 nr = CONFIG_BLK_DEV_RAM_COUNT;
690 - range = 1UL << (MINORBITS - part_shift);
691 + range = 1UL << MINORBITS;
692 }
693
694 if (register_blkdev(RAMDISK_MAJOR, "ramdisk"))
695 @@ -578,7 +581,7 @@ static void __exit brd_exit(void)
696 unsigned long range;
697 struct brd_device *brd, *next;
698
699 - range = rd_nr ? rd_nr : 1UL << (MINORBITS - part_shift);
700 + range = rd_nr ? rd_nr << part_shift : 1UL << MINORBITS;
701
702 list_for_each_entry_safe(brd, next, &brd_devices, brd_list)
703 brd_del_one(brd);
704 diff --git a/drivers/block/loop.c b/drivers/block/loop.c
705 index 1c21a3f..8ec2d70 100644
706 --- a/drivers/block/loop.c
707 +++ b/drivers/block/loop.c
708 @@ -1572,7 +1572,7 @@ static struct kobject *loop_probe(dev_t dev, int *part, void *data)
709 struct kobject *kobj;
710
711 mutex_lock(&loop_devices_mutex);
712 - lo = loop_init_one(dev & MINORMASK);
713 + lo = loop_init_one(MINOR(dev) >> part_shift);
714 kobj = lo ? get_disk(lo->lo_disk) : ERR_PTR(-ENOMEM);
715 mutex_unlock(&loop_devices_mutex);
716
717 @@ -1605,15 +1605,18 @@ static int __init loop_init(void)
718 if (max_part > 0)
719 part_shift = fls(max_part);
720
721 + if ((1UL << part_shift) > DISK_MAX_PARTS)
722 + return -EINVAL;
723 +
724 if (max_loop > 1UL << (MINORBITS - part_shift))
725 return -EINVAL;
726
727 if (max_loop) {
728 nr = max_loop;
729 - range = max_loop;
730 + range = max_loop << part_shift;
731 } else {
732 nr = 8;
733 - range = 1UL << (MINORBITS - part_shift);
734 + range = 1UL << MINORBITS;
735 }
736
737 if (register_blkdev(LOOP_MAJOR, "loop"))
738 @@ -1652,7 +1655,7 @@ static void __exit loop_exit(void)
739 unsigned long range;
740 struct loop_device *lo, *next;
741
742 - range = max_loop ? max_loop : 1UL << (MINORBITS - part_shift);
743 + range = max_loop ? max_loop << part_shift : 1UL << MINORBITS;
744
745 list_for_each_entry_safe(lo, next, &loop_devices, lo_list)
746 loop_del_one(lo);
747 diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
748 index cc923a5..26ada47 100644
749 --- a/drivers/block/nbd.c
750 +++ b/drivers/block/nbd.c
751 @@ -754,6 +754,12 @@ static int __init nbd_init(void)
752 if (max_part > 0)
753 part_shift = fls(max_part);
754
755 + if ((1UL << part_shift) > DISK_MAX_PARTS)
756 + return -EINVAL;
757 +
758 + if (nbds_max > 1UL << (MINORBITS - part_shift))
759 + return -EINVAL;
760 +
761 for (i = 0; i < nbds_max; i++) {
762 struct gendisk *disk = alloc_disk(1 << part_shift);
763 if (!disk)
764 diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c
765 index 4365717..1e116ac 100644
766 --- a/drivers/char/i8k.c
767 +++ b/drivers/char/i8k.c
768 @@ -138,8 +138,8 @@ static int i8k_smm(struct smm_regs *regs)
769 "movl %%edi,20(%%rax)\n\t"
770 "popq %%rdx\n\t"
771 "movl %%edx,0(%%rax)\n\t"
772 - "lahf\n\t"
773 - "shrl $8,%%eax\n\t"
774 + "pushfq\n\t"
775 + "popq %%rax\n\t"
776 "andl $1,%%eax\n"
777 :"=a"(rc)
778 : "a"(regs)
779 diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
780 index c18e65e..c7ae026 100644
781 --- a/drivers/cpufreq/cpufreq.c
782 +++ b/drivers/cpufreq/cpufreq.c
783 @@ -1183,12 +1183,28 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev)
784
785 unlock_policy_rwsem_write(cpu);
786
787 + cpufreq_debug_enable_ratelimit();
788 +
789 +#ifdef CONFIG_HOTPLUG_CPU
790 + /* when the CPU which is the parent of the kobj is hotplugged
791 + * offline, check for siblings, and create cpufreq sysfs interface
792 + * and symlinks
793 + */
794 + if (unlikely(cpumask_weight(data->cpus) > 1)) {
795 + /* first sibling now owns the new sysfs dir */
796 + cpumask_clear_cpu(cpu, data->cpus);
797 + cpufreq_add_dev(get_cpu_sysdev(cpumask_first(data->cpus)));
798 +
799 + /* finally remove our own symlink */
800 + lock_policy_rwsem_write(cpu);
801 + __cpufreq_remove_dev(sys_dev);
802 + }
803 +#endif
804 +
805 free_cpumask_var(data->related_cpus);
806 free_cpumask_var(data->cpus);
807 kfree(data);
808 - per_cpu(cpufreq_cpu_data, cpu) = NULL;
809
810 - cpufreq_debug_enable_ratelimit();
811 return 0;
812 }
813
814 diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
815 index 5a62d67..6bbc164 100644
816 --- a/drivers/cpufreq/cpufreq_stats.c
817 +++ b/drivers/cpufreq/cpufreq_stats.c
818 @@ -164,17 +164,27 @@ static int freq_table_get_index(struct cpufreq_stats *stat, unsigned int freq)
819 return -1;
820 }
821
822 +/* should be called late in the CPU removal sequence so that the stats
823 + * memory is still available in case someone tries to use it.
824 + */
825 static void cpufreq_stats_free_table(unsigned int cpu)
826 {
827 struct cpufreq_stats *stat = per_cpu(cpufreq_stats_table, cpu);
828 - struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
829 - if (policy && policy->cpu == cpu)
830 - sysfs_remove_group(&policy->kobj, &stats_attr_group);
831 if (stat) {
832 kfree(stat->time_in_state);
833 kfree(stat);
834 }
835 per_cpu(cpufreq_stats_table, cpu) = NULL;
836 +}
837 +
838 +/* must be called early in the CPU removal sequence (before
839 + * cpufreq_remove_dev) so that policy is still valid.
840 + */
841 +static void cpufreq_stats_free_sysfs(unsigned int cpu)
842 +{
843 + struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
844 + if (policy && policy->cpu == cpu)
845 + sysfs_remove_group(&policy->kobj, &stats_attr_group);
846 if (policy)
847 cpufreq_cpu_put(policy);
848 }
849 @@ -315,6 +325,9 @@ static int __cpuinit cpufreq_stat_cpu_callback(struct notifier_block *nfb,
850 case CPU_ONLINE_FROZEN:
851 cpufreq_update_policy(cpu);
852 break;
853 + case CPU_DOWN_PREPARE:
854 + cpufreq_stats_free_sysfs(cpu);
855 + break;
856 case CPU_DEAD:
857 case CPU_DEAD_FROZEN:
858 cpufreq_stats_free_table(cpu);
859 @@ -323,9 +336,11 @@ static int __cpuinit cpufreq_stat_cpu_callback(struct notifier_block *nfb,
860 return NOTIFY_OK;
861 }
862
863 +/* priority=1 so this will get called before cpufreq_remove_dev */
864 static struct notifier_block cpufreq_stat_cpu_notifier __refdata =
865 {
866 .notifier_call = cpufreq_stat_cpu_callback,
867 + .priority = 1,
868 };
869
870 static struct notifier_block notifier_policy_block = {
871 @@ -372,6 +387,7 @@ static void __exit cpufreq_stats_exit(void)
872 unregister_hotcpu_notifier(&cpufreq_stat_cpu_notifier);
873 for_each_online_cpu(cpu) {
874 cpufreq_stats_free_table(cpu);
875 + cpufreq_stats_free_sysfs(cpu);
876 }
877 }
878
879 diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
880 index f8e57c6..0537437 100644
881 --- a/drivers/cpuidle/governors/menu.c
882 +++ b/drivers/cpuidle/governors/menu.c
883 @@ -185,6 +185,7 @@ static int menu_select(struct cpuidle_device *dev)
884 int latency_req = pm_qos_requirement(PM_QOS_CPU_DMA_LATENCY);
885 int i;
886 int multiplier;
887 + struct timespec t;
888
889 if (data->needs_update) {
890 menu_update(dev);
891 @@ -199,8 +200,9 @@ static int menu_select(struct cpuidle_device *dev)
892 return 0;
893
894 /* determine the expected residency time, round up */
895 + t = ktime_to_timespec(tick_nohz_get_sleep_length());
896 data->expected_us =
897 - DIV_ROUND_UP((u32)ktime_to_ns(tick_nohz_get_sleep_length()), 1000);
898 + t.tv_sec * USEC_PER_SEC + t.tv_nsec / NSEC_PER_USEC;
899
900
901 data->bucket = which_bucket(data->expected_us);
902 diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
903 index 44626bc..96b39fc 100644
904 --- a/drivers/gpu/drm/i915/intel_lvds.c
905 +++ b/drivers/gpu/drm/i915/intel_lvds.c
906 @@ -905,6 +905,14 @@ static const struct dmi_system_id intel_no_lvds[] = {
907 DMI_MATCH(DMI_PRODUCT_NAME, "U800"),
908 },
909 },
910 + {
911 + .callback = intel_no_lvds_dmi_callback,
912 + .ident = "Asus EeeBox PC EB1007",
913 + .matches = {
914 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer INC."),
915 + DMI_MATCH(DMI_PRODUCT_NAME, "EB1007"),
916 + },
917 + },
918
919 { } /* terminating entry */
920 };
921 diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
922 index 41bb76f..3db54e9 100644
923 --- a/drivers/gpu/drm/radeon/radeon_device.c
924 +++ b/drivers/gpu/drm/radeon/radeon_device.c
925 @@ -572,6 +572,7 @@ int radeon_device_init(struct radeon_device *rdev,
926 dma_bits = rdev->need_dma32 ? 32 : 40;
927 r = pci_set_dma_mask(rdev->pdev, DMA_BIT_MASK(dma_bits));
928 if (r) {
929 + rdev->need_dma32 = true;
930 printk(KERN_WARNING "radeon: No suitable DMA available.\n");
931 }
932
933 diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
934 index 57f32f0..03345bb 100644
935 --- a/drivers/md/dm-table.c
936 +++ b/drivers/md/dm-table.c
937 @@ -348,6 +348,7 @@ static void close_dev(struct dm_dev_internal *d, struct mapped_device *md)
938 static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev,
939 sector_t start, sector_t len, void *data)
940 {
941 + struct request_queue *q;
942 struct queue_limits *limits = data;
943 struct block_device *bdev = dev->bdev;
944 sector_t dev_size =
945 @@ -356,6 +357,22 @@ static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev,
946 limits->logical_block_size >> SECTOR_SHIFT;
947 char b[BDEVNAME_SIZE];
948
949 + /*
950 + * Some devices exist without request functions,
951 + * such as loop devices not yet bound to backing files.
952 + * Forbid the use of such devices.
953 + */
954 + q = bdev_get_queue(bdev);
955 + if (!q || !q->make_request_fn) {
956 + DMWARN("%s: %s is not yet initialised: "
957 + "start=%llu, len=%llu, dev_size=%llu",
958 + dm_device_name(ti->table->md), bdevname(bdev, b),
959 + (unsigned long long)start,
960 + (unsigned long long)len,
961 + (unsigned long long)dev_size);
962 + return 1;
963 + }
964 +
965 if (!dev_size)
966 return 0;
967
968 diff --git a/drivers/md/md.c b/drivers/md/md.c
969 index 697a2c7..7c5129f 100644
970 --- a/drivers/md/md.c
971 +++ b/drivers/md/md.c
972 @@ -2262,7 +2262,7 @@ slot_store(mdk_rdev_t *rdev, const char *buf, size_t len)
973 if (rdev->raid_disk == -1)
974 return -EEXIST;
975 /* personality does all needed checks */
976 - if (rdev->mddev->pers->hot_add_disk == NULL)
977 + if (rdev->mddev->pers->hot_remove_disk == NULL)
978 return -EINVAL;
979 err = rdev->mddev->pers->
980 hot_remove_disk(rdev->mddev, rdev->raid_disk);
981 diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
982 index 2394973..cf59d64 100644
983 --- a/drivers/md/raid5.c
984 +++ b/drivers/md/raid5.c
985 @@ -127,7 +127,7 @@ static inline int raid5_dec_bi_hw_segments(struct bio *bio)
986
987 static inline void raid5_set_bi_hw_segments(struct bio *bio, unsigned int cnt)
988 {
989 - bio->bi_phys_segments = raid5_bi_phys_segments(bio) || (cnt << 16);
990 + bio->bi_phys_segments = raid5_bi_phys_segments(bio) | (cnt << 16);
991 }
992
993 /* Find first data disk in a raid6 stripe */
994 @@ -446,7 +446,7 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s)
995 bi = &sh->dev[i].req;
996
997 bi->bi_rw = rw;
998 - if (rw == WRITE)
999 + if (rw & WRITE)
1000 bi->bi_end_io = raid5_end_write_request;
1001 else
1002 bi->bi_end_io = raid5_end_read_request;
1003 @@ -480,13 +480,13 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s)
1004 bi->bi_io_vec[0].bv_offset = 0;
1005 bi->bi_size = STRIPE_SIZE;
1006 bi->bi_next = NULL;
1007 - if (rw == WRITE &&
1008 + if ((rw & WRITE) &&
1009 test_bit(R5_ReWrite, &sh->dev[i].flags))
1010 atomic_add(STRIPE_SECTORS,
1011 &rdev->corrected_errors);
1012 generic_make_request(bi);
1013 } else {
1014 - if (rw == WRITE)
1015 + if (rw & WRITE)
1016 set_bit(STRIPE_DEGRADED, &sh->state);
1017 pr_debug("skip op %ld on disc %d for sector %llu\n",
1018 bi->bi_rw, i, (unsigned long long)sh->sector);
1019 diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c
1020 index db6de74..b140257 100644
1021 --- a/drivers/mtd/mtdconcat.c
1022 +++ b/drivers/mtd/mtdconcat.c
1023 @@ -306,7 +306,7 @@ concat_write_oob(struct mtd_info *mtd, loff_t to, struct mtd_oob_ops *ops)
1024 if (!(mtd->flags & MTD_WRITEABLE))
1025 return -EROFS;
1026
1027 - ops->retlen = 0;
1028 + ops->retlen = ops->oobretlen = 0;
1029
1030 for (i = 0; i < concat->num_subdev; i++) {
1031 struct mtd_info *subdev = concat->subdev[i];
1032 @@ -321,7 +321,7 @@ concat_write_oob(struct mtd_info *mtd, loff_t to, struct mtd_oob_ops *ops)
1033 devops.len = subdev->size - to;
1034
1035 err = subdev->write_oob(subdev, to, &devops);
1036 - ops->retlen += devops.retlen;
1037 + ops->retlen += devops.oobretlen;
1038 if (err)
1039 return err;
1040
1041 diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
1042 index dbceac7..1f423f2 100644
1043 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c
1044 +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
1045 @@ -47,7 +47,7 @@
1046 #include "iwl-6000-hw.h"
1047
1048 /* Highest firmware API version supported */
1049 -#define IWL5000_UCODE_API_MAX 5
1050 +#define IWL5000_UCODE_API_MAX 2
1051 #define IWL5150_UCODE_API_MAX 2
1052
1053 /* Lowest firmware API version supported */
1054 diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
1055 index 54c3a9d..cb74ac6 100644
1056 --- a/drivers/net/wireless/p54/p54usb.c
1057 +++ b/drivers/net/wireless/p54/p54usb.c
1058 @@ -80,6 +80,7 @@ static struct usb_device_id p54u_table[] __devinitdata = {
1059 {USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */
1060 {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */
1061 {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */
1062 + {USB_DEVICE(0x083a, 0xc501)}, /* Zoom Wireless-G 4410 */
1063 {USB_DEVICE(0x083a, 0xf503)}, /* Accton FD7050E ver 1010ec */
1064 {USB_DEVICE(0x0846, 0x4240)}, /* Netgear WG111 (v2) */
1065 {USB_DEVICE(0x0915, 0x2000)}, /* Cohiba Proto board */
1066 diff --git a/drivers/pci/hotplug/pcihp_slot.c b/drivers/pci/hotplug/pcihp_slot.c
1067 index cc8ec3a..1fd6c5f 100644
1068 --- a/drivers/pci/hotplug/pcihp_slot.c
1069 +++ b/drivers/pci/hotplug/pcihp_slot.c
1070 @@ -158,6 +158,47 @@ static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp)
1071 */
1072 }
1073
1074 +/* Program PCIE MaxPayload setting on device: ensure parent maxpayload <= device */
1075 +static int pci_set_payload(struct pci_dev *dev)
1076 +{
1077 + int pos, ppos;
1078 + u16 pctl, psz;
1079 + u16 dctl, dsz, dcap, dmax;
1080 + struct pci_dev *parent;
1081 +
1082 + parent = dev->bus->self;
1083 + pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
1084 + if (!pos)
1085 + return 0;
1086 +
1087 + /* Read Device MaxPayload capability and setting */
1088 + pci_read_config_word(dev, pos + PCI_EXP_DEVCTL, &dctl);
1089 + pci_read_config_word(dev, pos + PCI_EXP_DEVCAP, &dcap);
1090 + dsz = (dctl & PCI_EXP_DEVCTL_PAYLOAD) >> 5;
1091 + dmax = (dcap & PCI_EXP_DEVCAP_PAYLOAD);
1092 +
1093 + /* Read Parent MaxPayload setting */
1094 + ppos = pci_find_capability(parent, PCI_CAP_ID_EXP);
1095 + if (!ppos)
1096 + return 0;
1097 + pci_read_config_word(parent, ppos + PCI_EXP_DEVCTL, &pctl);
1098 + psz = (pctl & PCI_EXP_DEVCTL_PAYLOAD) >> 5;
1099 +
1100 + /* If parent payload > device max payload -> error
1101 + * If parent payload > device payload -> set speed
1102 + * If parent payload <= device payload -> do nothing
1103 + */
1104 + if (psz > dmax)
1105 + return -1;
1106 + else if (psz > dsz) {
1107 + dev_info(&dev->dev, "Setting MaxPayload to %d\n", 128 << psz);
1108 + pci_write_config_word(dev, pos + PCI_EXP_DEVCTL,
1109 + (dctl & ~PCI_EXP_DEVCTL_PAYLOAD) +
1110 + (psz << 5));
1111 + }
1112 + return 0;
1113 +}
1114 +
1115 void pci_configure_slot(struct pci_dev *dev)
1116 {
1117 struct pci_dev *cdev;
1118 @@ -169,6 +210,10 @@ void pci_configure_slot(struct pci_dev *dev)
1119 (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI)))
1120 return;
1121
1122 + ret = pci_set_payload(dev);
1123 + if (ret)
1124 + dev_warn(&dev->dev, "could not set device max payload\n");
1125 +
1126 memset(&hpp, 0, sizeof(hpp));
1127 ret = pci_get_hp_params(dev, &hpp);
1128 if (ret)
1129 diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
1130 index 812d4ac..0d3326d 100644
1131 --- a/drivers/pci/pci.c
1132 +++ b/drivers/pci/pci.c
1133 @@ -373,8 +373,12 @@ pci_find_parent_resource(const struct pci_dev *dev, struct resource *res)
1134 continue; /* Wrong type */
1135 if (!((res->flags ^ r->flags) & IORESOURCE_PREFETCH))
1136 return r; /* Exact match */
1137 - if ((res->flags & IORESOURCE_PREFETCH) && !(r->flags & IORESOURCE_PREFETCH))
1138 - best = r; /* Approximating prefetchable by non-prefetchable */
1139 + /* We can't insert a non-prefetch resource inside a prefetchable parent .. */
1140 + if (r->flags & IORESOURCE_PREFETCH)
1141 + continue;
1142 + /* .. but we can put a prefetchable resource inside a non-prefetchable one */
1143 + if (!best)
1144 + best = r;
1145 }
1146 return best;
1147 }
1148 diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
1149 index c8ece44..1e42381 100644
1150 --- a/drivers/pci/quirks.c
1151 +++ b/drivers/pci/quirks.c
1152 @@ -2540,6 +2540,16 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4375,
1153
1154 #endif /* CONFIG_PCI_MSI */
1155
1156 +static void __devinit fixup_ti816x_class(struct pci_dev* dev)
1157 +{
1158 + /* TI 816x devices do not have class code set when in PCIe boot mode */
1159 + if (dev->class == PCI_CLASS_NOT_DEFINED) {
1160 + dev_info(&dev->dev, "Setting PCI class for 816x PCIe device\n");
1161 + dev->class = PCI_CLASS_MULTIMEDIA_VIDEO;
1162 + }
1163 +}
1164 +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_TI, 0xb800, fixup_ti816x_class);
1165 +
1166 static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f,
1167 struct pci_fixup *end)
1168 {
1169 diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
1170 index 47291bc..04830e8 100644
1171 --- a/drivers/scsi/scsi_scan.c
1172 +++ b/drivers/scsi/scsi_scan.c
1173 @@ -293,7 +293,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
1174 kfree(sdev);
1175 goto out;
1176 }
1177 -
1178 + blk_get_queue(sdev->request_queue);
1179 sdev->request_queue->queuedata = sdev;
1180 scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun);
1181
1182 @@ -1336,8 +1336,10 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags,
1183 sdev = scsi_alloc_sdev(starget, 0, NULL);
1184 if (!sdev)
1185 return 0;
1186 - if (scsi_device_get(sdev))
1187 + if (scsi_device_get(sdev)) {
1188 + __scsi_remove_device(sdev);
1189 return 0;
1190 + }
1191 }
1192
1193 sprintf(devname, "host %d channel %d id %d",
1194 @@ -1904,10 +1906,9 @@ struct scsi_device *scsi_get_host_dev(struct Scsi_Host *shost)
1195 goto out;
1196
1197 sdev = scsi_alloc_sdev(starget, 0, NULL);
1198 - if (sdev) {
1199 - sdev->sdev_gendev.parent = get_device(&starget->dev);
1200 + if (sdev)
1201 sdev->borken = 0;
1202 - } else
1203 + else
1204 scsi_target_reap(starget);
1205 put_device(&starget->dev);
1206 out:
1207 diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
1208 index ab6ac95..91a93e0 100644
1209 --- a/drivers/scsi/scsi_sysfs.c
1210 +++ b/drivers/scsi/scsi_sysfs.c
1211 @@ -318,6 +318,7 @@ static void scsi_device_dev_release_usercontext(struct work_struct *work)
1212 kfree(evt);
1213 }
1214
1215 + blk_put_queue(sdev->request_queue);
1216 /* NULL queue means the device can't be used */
1217 sdev->request_queue = NULL;
1218
1219 @@ -838,7 +839,8 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
1220 struct request_queue *rq = sdev->request_queue;
1221 struct scsi_target *starget = sdev->sdev_target;
1222
1223 - if ((error = scsi_device_set_state(sdev, SDEV_RUNNING)) != 0)
1224 + error = scsi_device_set_state(sdev, SDEV_RUNNING);
1225 + if (error)
1226 return error;
1227
1228 error = scsi_target_add(starget);
1229 @@ -849,13 +851,13 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
1230 error = device_add(&sdev->sdev_gendev);
1231 if (error) {
1232 printk(KERN_INFO "error 1\n");
1233 - goto out_remove;
1234 + return error;
1235 }
1236 error = device_add(&sdev->sdev_dev);
1237 if (error) {
1238 printk(KERN_INFO "error 2\n");
1239 device_del(&sdev->sdev_gendev);
1240 - goto out_remove;
1241 + return error;
1242 }
1243 transport_add_device(&sdev->sdev_gendev);
1244 sdev->is_visible = 1;
1245 @@ -866,14 +868,14 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
1246 else
1247 error = device_create_file(&sdev->sdev_gendev, &dev_attr_queue_depth);
1248 if (error)
1249 - goto out_remove;
1250 + return error;
1251
1252 if (sdev->host->hostt->change_queue_type)
1253 error = device_create_file(&sdev->sdev_gendev, &sdev_attr_queue_type_rw);
1254 else
1255 error = device_create_file(&sdev->sdev_gendev, &dev_attr_queue_type);
1256 if (error)
1257 - goto out_remove;
1258 + return error;
1259
1260 error = bsg_register_queue(rq, &sdev->sdev_gendev, NULL, NULL);
1261
1262 @@ -889,16 +891,11 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
1263 error = device_create_file(&sdev->sdev_gendev,
1264 sdev->host->hostt->sdev_attrs[i]);
1265 if (error)
1266 - goto out_remove;
1267 + return error;
1268 }
1269 }
1270
1271 - return 0;
1272 -
1273 - out_remove:
1274 - __scsi_remove_device(sdev);
1275 return error;
1276 -
1277 }
1278
1279 void __scsi_remove_device(struct scsi_device *sdev)
1280 diff --git a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c
1281 index 27aa40f..7f0eda2 100644
1282 --- a/drivers/scsi/ultrastor.c
1283 +++ b/drivers/scsi/ultrastor.c
1284 @@ -306,7 +306,7 @@ static inline int find_and_clear_bit_16(unsigned long *field)
1285 "0: bsfw %1,%w0\n\t"
1286 "btr %0,%1\n\t"
1287 "jnc 0b"
1288 - : "=&r" (rv), "=m" (*field) :);
1289 + : "=&r" (rv), "+m" (*field) :);
1290
1291 return rv;
1292 }
1293 diff --git a/drivers/staging/usbip/usbip_common.c b/drivers/staging/usbip/usbip_common.c
1294 index 719e0c1..3c5c62de 100644
1295 --- a/drivers/staging/usbip/usbip_common.c
1296 +++ b/drivers/staging/usbip/usbip_common.c
1297 @@ -770,7 +770,7 @@ static void correct_endian_ret_submit(struct usbip_header_ret_submit *pdu,
1298 be32_to_cpus(&pdu->status);
1299 be32_to_cpus(&pdu->actual_length);
1300 be32_to_cpus(&pdu->start_frame);
1301 - cpu_to_be32s(&pdu->number_of_packets);
1302 + be32_to_cpus(&pdu->number_of_packets);
1303 be32_to_cpus(&pdu->error_count);
1304 }
1305 }
1306 diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
1307 index 4e32da6..2fc5dd3 100644
1308 --- a/drivers/usb/class/cdc-acm.c
1309 +++ b/drivers/usb/class/cdc-acm.c
1310 @@ -1602,6 +1602,8 @@ static struct usb_device_id acm_ids[] = {
1311 { NOKIA_PCSUITE_ACM_INFO(0x04ce), }, /* Nokia E90 */
1312 { NOKIA_PCSUITE_ACM_INFO(0x01d4), }, /* Nokia E55 */
1313 { NOKIA_PCSUITE_ACM_INFO(0x0302), }, /* Nokia N8 */
1314 + { NOKIA_PCSUITE_ACM_INFO(0x0335), }, /* Nokia E7 */
1315 + { NOKIA_PCSUITE_ACM_INFO(0x03cd), }, /* Nokia C7 */
1316 { SAMSUNG_PCSUITE_ACM_INFO(0x6651), }, /* Samsung GTi8510 (INNOV8) */
1317
1318 /* NOTE: non-Nokia COMM/ACM/0xff is likely MSFT RNDIS... NOT a modem! */
1319 diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
1320 index 283f019..03eed28 100644
1321 --- a/drivers/usb/core/hub.c
1322 +++ b/drivers/usb/core/hub.c
1323 @@ -326,7 +326,8 @@ static int get_hub_status(struct usb_device *hdev,
1324 {
1325 int i, status = -ETIMEDOUT;
1326
1327 - for (i = 0; i < USB_STS_RETRIES && status == -ETIMEDOUT; i++) {
1328 + for (i = 0; i < USB_STS_RETRIES &&
1329 + (status == -ETIMEDOUT || status == -EPIPE); i++) {
1330 status = usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0),
1331 USB_REQ_GET_STATUS, USB_DIR_IN | USB_RT_HUB, 0, 0,
1332 data, sizeof(*data), USB_STS_TIMEOUT);
1333 @@ -342,7 +343,8 @@ static int get_port_status(struct usb_device *hdev, int port1,
1334 {
1335 int i, status = -ETIMEDOUT;
1336
1337 - for (i = 0; i < USB_STS_RETRIES && status == -ETIMEDOUT; i++) {
1338 + for (i = 0; i < USB_STS_RETRIES &&
1339 + (status == -ETIMEDOUT || status == -EPIPE); i++) {
1340 status = usb_control_msg(hdev, usb_rcvctrlpipe(hdev, 0),
1341 USB_REQ_GET_STATUS, USB_DIR_IN | USB_RT_PORT, 0, port1,
1342 data, sizeof(*data), USB_STS_TIMEOUT);
1343 diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
1344 index 66450a1..e3170ca 100644
1345 --- a/drivers/usb/gadget/at91_udc.c
1346 +++ b/drivers/usb/gadget/at91_udc.c
1347 @@ -1687,7 +1687,7 @@ static int __init at91udc_probe(struct platform_device *pdev)
1348 }
1349
1350 /* newer chips have more FIFO memory than rm9200 */
1351 - if (cpu_is_at91sam9260()) {
1352 + if (cpu_is_at91sam9260() || cpu_is_at91sam9g20()) {
1353 udc->ep[0].maxpacket = 64;
1354 udc->ep[3].maxpacket = 64;
1355 udc->ep[4].maxpacket = 512;
1356 diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c
1357 index c9966cc..5201374 100644
1358 --- a/drivers/usb/gadget/f_rndis.c
1359 +++ b/drivers/usb/gadget/f_rndis.c
1360 @@ -400,8 +400,7 @@ rndis_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
1361 */
1362 case ((USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE) << 8)
1363 | USB_CDC_SEND_ENCAPSULATED_COMMAND:
1364 - if (w_length > req->length || w_value
1365 - || w_index != rndis->ctrl_id)
1366 + if (w_value || w_index != rndis->ctrl_id)
1367 goto invalid;
1368 /* read the request; process it later */
1369 value = w_length;
1370 diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c
1371 index 948a353..67f83e5 100644
1372 --- a/drivers/usb/host/ohci-pci.c
1373 +++ b/drivers/usb/host/ohci-pci.c
1374 @@ -207,10 +207,18 @@ static int ohci_quirk_amd700(struct usb_hcd *hcd)
1375 */
1376 static int ohci_quirk_nvidia_shutdown(struct usb_hcd *hcd)
1377 {
1378 + struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
1379 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
1380
1381 - ohci->flags |= OHCI_QUIRK_SHUTDOWN;
1382 - ohci_dbg(ohci, "enabled nVidia shutdown quirk\n");
1383 + /* Evidently nVidia fixed their later hardware; this is a guess at
1384 + * the changeover point.
1385 + */
1386 +#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_USB 0x026d
1387 +
1388 + if (pdev->device < PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_USB) {
1389 + ohci->flags |= OHCI_QUIRK_SHUTDOWN;
1390 + ohci_dbg(ohci, "enabled nVidia shutdown quirk\n");
1391 + }
1392
1393 return 0;
1394 }
1395 diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
1396 index 64cb409..fce7b5e 100644
1397 --- a/drivers/usb/host/xhci-mem.c
1398 +++ b/drivers/usb/host/xhci-mem.c
1399 @@ -452,9 +452,19 @@ static unsigned int xhci_parse_exponent_interval(struct usb_device *udev,
1400 interval = clamp_val(ep->desc.bInterval, 1, 16) - 1;
1401 if (interval != ep->desc.bInterval - 1)
1402 dev_warn(&udev->dev,
1403 - "ep %#x - rounding interval to %d microframes\n",
1404 + "ep %#x - rounding interval to %d %sframes\n",
1405 ep->desc.bEndpointAddress,
1406 - 1 << interval);
1407 + 1 << interval,
1408 + udev->speed == USB_SPEED_FULL ? "" : "micro");
1409 +
1410 + if (udev->speed == USB_SPEED_FULL) {
1411 + /*
1412 + * Full speed isoc endpoints specify interval in frames,
1413 + * not microframes. We are using microframes everywhere,
1414 + * so adjust accordingly.
1415 + */
1416 + interval += 3; /* 1 frame = 2^3 uframes */
1417 + }
1418
1419 return interval;
1420 }
1421 @@ -511,12 +521,12 @@ static inline unsigned int xhci_get_endpoint_interval(struct usb_device *udev,
1422 break;
1423
1424 case USB_SPEED_FULL:
1425 - if (usb_endpoint_xfer_int(&ep->desc)) {
1426 + if (usb_endpoint_xfer_isoc(&ep->desc)) {
1427 interval = xhci_parse_exponent_interval(udev, ep);
1428 break;
1429 }
1430 /*
1431 - * Fall through for isochronous endpoint interval decoding
1432 + * Fall through for interrupt endpoint interval decoding
1433 * since it uses the same rules as low speed interrupt
1434 * endpoints.
1435 */
1436 diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
1437 index 05afb5c..f77908b 100644
1438 --- a/drivers/usb/serial/cp210x.c
1439 +++ b/drivers/usb/serial/cp210x.c
1440 @@ -114,6 +114,10 @@ static struct usb_device_id id_table [] = {
1441 { USB_DEVICE(0x10C4, 0x8418) }, /* IRZ Automation Teleport SG-10 GSM/GPRS Modem */
1442 { USB_DEVICE(0x10C4, 0x846E) }, /* BEI USB Sensor Interface (VCP) */
1443 { USB_DEVICE(0x10C4, 0x8477) }, /* Balluff RFID */
1444 + { USB_DEVICE(0x10C4, 0x85EA) }, /* AC-Services IBUS-IF */
1445 + { USB_DEVICE(0x10C4, 0x85EB) }, /* AC-Services CIS-IBUS */
1446 + { USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */
1447 + { USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */
1448 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
1449 { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */
1450 { USB_DEVICE(0x10C4, 0xEA71) }, /* Infinity GPS-MIC-1 Radio Monophone */
1451 diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
1452 index 5171f22..afc4bd3 100644
1453 --- a/drivers/usb/serial/ftdi_sio.c
1454 +++ b/drivers/usb/serial/ftdi_sio.c
1455 @@ -570,6 +570,7 @@ static struct usb_device_id id_table_combined [] = {
1456 { USB_DEVICE(FTDI_VID, FTDI_IBS_APP70_PID) },
1457 { USB_DEVICE(FTDI_VID, FTDI_IBS_PEDO_PID) },
1458 { USB_DEVICE(FTDI_VID, FTDI_IBS_PROD_PID) },
1459 + { USB_DEVICE(FTDI_VID, FTDI_TAVIR_STK500_PID) },
1460 /*
1461 * ELV devices:
1462 */
1463 @@ -650,6 +651,7 @@ static struct usb_device_id id_table_combined [] = {
1464 { USB_DEVICE(FTDI_VID, EVER_ECO_PRO_CDS) },
1465 { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_1_PID) },
1466 { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_2_PID) },
1467 + { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_3_PID) },
1468 { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_0_PID) },
1469 { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_1_PID) },
1470 { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_2_PID) },
1471 diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
1472 index eca754b..40ac7c7 100644
1473 --- a/drivers/usb/serial/ftdi_sio_ids.h
1474 +++ b/drivers/usb/serial/ftdi_sio_ids.h
1475 @@ -351,6 +351,7 @@
1476 */
1477 #define FTDI_4N_GALAXY_DE_1_PID 0xF3C0
1478 #define FTDI_4N_GALAXY_DE_2_PID 0xF3C1
1479 +#define FTDI_4N_GALAXY_DE_3_PID 0xF3C2
1480
1481 /*
1482 * Linx Technologies product ids
1483 @@ -491,6 +492,11 @@
1484 /* www.canusb.com Lawicel CANUSB device (FTDI_VID) */
1485 #define FTDI_CANUSB_PID 0xFFA8 /* Product Id */
1486
1487 +/*
1488 + * TavIR AVR product ids (FTDI_VID)
1489 + */
1490 +#define FTDI_TAVIR_STK500_PID 0xFA33 /* STK500 AVR programmer */
1491 +
1492
1493
1494 /********************************/
1495 diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c
1496 index 5ac900e..867d97b 100644
1497 --- a/drivers/usb/serial/garmin_gps.c
1498 +++ b/drivers/usb/serial/garmin_gps.c
1499 @@ -1,7 +1,7 @@
1500 /*
1501 * Garmin GPS driver
1502 *
1503 - * Copyright (C) 2006-2009 Hermann Kneissel herkne@users.sourceforge.net
1504 + * Copyright (C) 2006-2011 Hermann Kneissel herkne@gmx.de
1505 *
1506 * The latest version of the driver can be found at
1507 * http://sourceforge.net/projects/garmin-gps/
1508 @@ -51,7 +51,7 @@ static int debug;
1509 */
1510
1511 #define VERSION_MAJOR 0
1512 -#define VERSION_MINOR 33
1513 +#define VERSION_MINOR 36
1514
1515 #define _STR(s) #s
1516 #define _DRIVER_VERSION(a, b) "v" _STR(a) "." _STR(b)
1517 @@ -411,6 +411,7 @@ static int gsp_send_ack(struct garmin_data *garmin_data_p, __u8 pkt_id)
1518 */
1519 static int gsp_rec_packet(struct garmin_data *garmin_data_p, int count)
1520 {
1521 + unsigned long flags;
1522 const __u8 *recpkt = garmin_data_p->inbuffer+GSP_INITIAL_OFFSET;
1523 __le32 *usbdata = (__le32 *) garmin_data_p->inbuffer;
1524
1525 @@ -459,7 +460,9 @@ static int gsp_rec_packet(struct garmin_data *garmin_data_p, int count)
1526 /* if this was an abort-transfer command, flush all
1527 queued data. */
1528 if (isAbortTrfCmnd(garmin_data_p->inbuffer)) {
1529 + spin_lock_irqsave(&garmin_data_p->lock, flags);
1530 garmin_data_p->flags |= FLAGS_DROP_DATA;
1531 + spin_unlock_irqrestore(&garmin_data_p->lock, flags);
1532 pkt_clear(garmin_data_p);
1533 }
1534
1535 @@ -944,7 +947,7 @@ static int garmin_open(struct tty_struct *tty, struct usb_serial_port *port)
1536 spin_lock_irqsave(&garmin_data_p->lock, flags);
1537 garmin_data_p->mode = initial_mode;
1538 garmin_data_p->count = 0;
1539 - garmin_data_p->flags = 0;
1540 + garmin_data_p->flags &= FLAGS_SESSION_REPLY1_SEEN;
1541 spin_unlock_irqrestore(&garmin_data_p->lock, flags);
1542
1543 /* shutdown any bulk reads that might be going on */
1544 @@ -1179,7 +1182,8 @@ static int garmin_write_room(struct tty_struct *tty)
1545
1546
1547 static void garmin_read_process(struct garmin_data *garmin_data_p,
1548 - unsigned char *data, unsigned data_length)
1549 + unsigned char *data, unsigned data_length,
1550 + int bulk_data)
1551 {
1552 unsigned long flags;
1553
1554 @@ -1194,7 +1198,8 @@ static void garmin_read_process(struct garmin_data *garmin_data_p,
1555 send it directly to the tty port */
1556 if (garmin_data_p->flags & FLAGS_QUEUING) {
1557 pkt_add(garmin_data_p, data, data_length);
1558 - } else if (getLayerId(data) == GARMIN_LAYERID_APPL) {
1559 + } else if (bulk_data ||
1560 + getLayerId(data) == GARMIN_LAYERID_APPL) {
1561
1562 spin_lock_irqsave(&garmin_data_p->lock, flags);
1563 garmin_data_p->flags |= APP_RESP_SEEN;
1564 @@ -1238,7 +1243,7 @@ static void garmin_read_bulk_callback(struct urb *urb)
1565 usb_serial_debug_data(debug, &port->dev,
1566 __func__, urb->actual_length, data);
1567
1568 - garmin_read_process(garmin_data_p, data, urb->actual_length);
1569 + garmin_read_process(garmin_data_p, data, urb->actual_length, 1);
1570
1571 if (urb->actual_length == 0 &&
1572 0 != (garmin_data_p->flags & FLAGS_BULK_IN_RESTART)) {
1573 @@ -1348,7 +1353,7 @@ static void garmin_read_int_callback(struct urb *urb)
1574 __func__, garmin_data_p->serial_num);
1575 }
1576
1577 - garmin_read_process(garmin_data_p, data, urb->actual_length);
1578 + garmin_read_process(garmin_data_p, data, urb->actual_length, 0);
1579
1580 port->interrupt_in_urb->dev = port->serial->dev;
1581 retval = usb_submit_urb(urb, GFP_ATOMIC);
1582 @@ -1463,6 +1468,7 @@ static int garmin_attach(struct usb_serial *serial)
1583 garmin_data_p->timer.function = timeout_handler;
1584 garmin_data_p->port = port;
1585 garmin_data_p->state = 0;
1586 + garmin_data_p->flags = 0;
1587 garmin_data_p->count = 0;
1588 usb_set_serial_port_data(port, garmin_data_p);
1589
1590 diff --git a/drivers/usb/serial/moto_modem.c b/drivers/usb/serial/moto_modem.c
1591 index 99bd00f5..c53a8a5 100644
1592 --- a/drivers/usb/serial/moto_modem.c
1593 +++ b/drivers/usb/serial/moto_modem.c
1594 @@ -25,6 +25,7 @@ static struct usb_device_id id_table [] = {
1595 { USB_DEVICE(0x05c6, 0x3197) }, /* unknown Motorola phone */
1596 { USB_DEVICE(0x0c44, 0x0022) }, /* unknown Mororola phone */
1597 { USB_DEVICE(0x22b8, 0x2a64) }, /* Motorola KRZR K1m */
1598 + { USB_DEVICE(0x22b8, 0x2c84) }, /* Motorola VE240 phone */
1599 { USB_DEVICE(0x22b8, 0x2c64) }, /* Motorola V950 phone */
1600 { },
1601 };
1602 diff --git a/drivers/xen/events.c b/drivers/xen/events.c
1603 index 1417015..009ca4e 100644
1604 --- a/drivers/xen/events.c
1605 +++ b/drivers/xen/events.c
1606 @@ -536,7 +536,7 @@ int bind_ipi_to_irqhandler(enum ipi_vector ipi,
1607 if (irq < 0)
1608 return irq;
1609
1610 - irqflags |= IRQF_NO_SUSPEND;
1611 + irqflags |= IRQF_NO_SUSPEND | IRQF_FORCE_RESUME;
1612 retval = request_irq(irq, handler, irqflags, devname, dev_id);
1613 if (retval != 0) {
1614 unbind_from_irq(irq);
1615 @@ -814,9 +814,6 @@ static void restore_cpu_virqs(unsigned int cpu)
1616 evtchn_to_irq[evtchn] = irq;
1617 irq_info[irq] = mk_virq_info(evtchn, virq);
1618 bind_evtchn_to_cpu(evtchn, cpu);
1619 -
1620 - /* Ready for use. */
1621 - unmask_evtchn(evtchn);
1622 }
1623 }
1624
1625 @@ -842,10 +839,6 @@ static void restore_cpu_ipis(unsigned int cpu)
1626 evtchn_to_irq[evtchn] = irq;
1627 irq_info[irq] = mk_ipi_info(evtchn, ipi);
1628 bind_evtchn_to_cpu(evtchn, cpu);
1629 -
1630 - /* Ready for use. */
1631 - unmask_evtchn(evtchn);
1632 -
1633 }
1634 }
1635
1636 diff --git a/fs/block_dev.c b/fs/block_dev.c
1637 index e65efa2..16cea86 100644
1638 --- a/fs/block_dev.c
1639 +++ b/fs/block_dev.c
1640 @@ -1203,6 +1203,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
1641 if (!bdev->bd_part)
1642 goto out_clear;
1643
1644 + ret = 0;
1645 if (disk->fops->open) {
1646 ret = disk->fops->open(bdev, mode);
1647 if (ret == -ERESTARTSYS) {
1648 @@ -1218,9 +1219,18 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
1649 mutex_unlock(&bdev->bd_mutex);
1650 goto restart;
1651 }
1652 - if (ret)
1653 - goto out_clear;
1654 }
1655 + /*
1656 + * If the device is invalidated, rescan partition
1657 + * if open succeeded or failed with -ENOMEDIUM.
1658 + * The latter is necessary to prevent ghost
1659 + * partitions on a removed medium.
1660 + */
1661 + if (bdev->bd_invalidated && (!ret || ret == -ENOMEDIUM))
1662 + rescan_partitions(disk, bdev);
1663 + if (ret)
1664 + goto out_clear;
1665 +
1666 if (!bdev->bd_openers) {
1667 bd_set_size(bdev,(loff_t)get_capacity(disk)<<9);
1668 bdi = blk_get_backing_dev_info(bdev);
1669 @@ -1228,8 +1238,6 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
1670 bdi = &default_backing_dev_info;
1671 bdev->bd_inode->i_data.backing_dev_info = bdi;
1672 }
1673 - if (bdev->bd_invalidated)
1674 - rescan_partitions(disk, bdev);
1675 } else {
1676 struct block_device *whole;
1677 whole = bdget_disk(disk, 0);
1678 @@ -1256,13 +1264,14 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
1679 put_disk(disk);
1680 disk = NULL;
1681 if (bdev->bd_contains == bdev) {
1682 - if (bdev->bd_disk->fops->open) {
1683 + ret = 0;
1684 + if (bdev->bd_disk->fops->open)
1685 ret = bdev->bd_disk->fops->open(bdev, mode);
1686 - if (ret)
1687 - goto out_unlock_bdev;
1688 - }
1689 - if (bdev->bd_invalidated)
1690 + /* the same as first opener case, read comment there */
1691 + if (bdev->bd_invalidated && (!ret || ret == -ENOMEDIUM))
1692 rescan_partitions(bdev->bd_disk, bdev);
1693 + if (ret)
1694 + goto out_unlock_bdev;
1695 }
1696 }
1697 bdev->bd_openers++;
1698 diff --git a/fs/dcookies.c b/fs/dcookies.c
1699 index a21cabd..dda0dc7 100644
1700 --- a/fs/dcookies.c
1701 +++ b/fs/dcookies.c
1702 @@ -178,6 +178,8 @@ SYSCALL_DEFINE(lookup_dcookie)(u64 cookie64, char __user * buf, size_t len)
1703 /* FIXME: (deleted) ? */
1704 path = d_path(&dcs->path, kbuf, PAGE_SIZE);
1705
1706 + mutex_unlock(&dcookie_mutex);
1707 +
1708 if (IS_ERR(path)) {
1709 err = PTR_ERR(path);
1710 goto out_free;
1711 @@ -194,6 +196,7 @@ SYSCALL_DEFINE(lookup_dcookie)(u64 cookie64, char __user * buf, size_t len)
1712
1713 out_free:
1714 kfree(kbuf);
1715 + return err;
1716 out:
1717 mutex_unlock(&dcookie_mutex);
1718 return err;
1719 diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
1720 index aa2480a..8f1a525 100644
1721 --- a/fs/ecryptfs/keystore.c
1722 +++ b/fs/ecryptfs/keystore.c
1723 @@ -481,8 +481,8 @@ struct ecryptfs_write_tag_70_packet_silly_stack {
1724 struct mutex *tfm_mutex;
1725 char *block_aligned_filename;
1726 struct ecryptfs_auth_tok *auth_tok;
1727 - struct scatterlist src_sg;
1728 - struct scatterlist dst_sg;
1729 + struct scatterlist src_sg[2];
1730 + struct scatterlist dst_sg[2];
1731 struct blkcipher_desc desc;
1732 char iv[ECRYPTFS_MAX_IV_BYTES];
1733 char hash[ECRYPTFS_TAG_70_DIGEST_SIZE];
1734 @@ -695,23 +695,21 @@ ecryptfs_write_tag_70_packet(char *dest, size_t *remaining_bytes,
1735 memcpy(&s->block_aligned_filename[s->num_rand_bytes], filename,
1736 filename_size);
1737 rc = virt_to_scatterlist(s->block_aligned_filename,
1738 - s->block_aligned_filename_size, &s->src_sg, 1);
1739 - if (rc != 1) {
1740 + s->block_aligned_filename_size, s->src_sg, 2);
1741 + if (rc < 1) {
1742 printk(KERN_ERR "%s: Internal error whilst attempting to "
1743 - "convert filename memory to scatterlist; "
1744 - "expected rc = 1; got rc = [%d]. "
1745 + "convert filename memory to scatterlist; rc = [%d]. "
1746 "block_aligned_filename_size = [%zd]\n", __func__, rc,
1747 s->block_aligned_filename_size);
1748 goto out_release_free_unlock;
1749 }
1750 rc = virt_to_scatterlist(&dest[s->i], s->block_aligned_filename_size,
1751 - &s->dst_sg, 1);
1752 - if (rc != 1) {
1753 + s->dst_sg, 2);
1754 + if (rc < 1) {
1755 printk(KERN_ERR "%s: Internal error whilst attempting to "
1756 "convert encrypted filename memory to scatterlist; "
1757 - "expected rc = 1; got rc = [%d]. "
1758 - "block_aligned_filename_size = [%zd]\n", __func__, rc,
1759 - s->block_aligned_filename_size);
1760 + "rc = [%d]. block_aligned_filename_size = [%zd]\n",
1761 + __func__, rc, s->block_aligned_filename_size);
1762 goto out_release_free_unlock;
1763 }
1764 /* The characters in the first block effectively do the job
1765 @@ -734,7 +732,7 @@ ecryptfs_write_tag_70_packet(char *dest, size_t *remaining_bytes,
1766 mount_crypt_stat->global_default_fn_cipher_key_bytes);
1767 goto out_release_free_unlock;
1768 }
1769 - rc = crypto_blkcipher_encrypt_iv(&s->desc, &s->dst_sg, &s->src_sg,
1770 + rc = crypto_blkcipher_encrypt_iv(&s->desc, s->dst_sg, s->src_sg,
1771 s->block_aligned_filename_size);
1772 if (rc) {
1773 printk(KERN_ERR "%s: Error attempting to encrypt filename; "
1774 @@ -766,8 +764,8 @@ struct ecryptfs_parse_tag_70_packet_silly_stack {
1775 struct mutex *tfm_mutex;
1776 char *decrypted_filename;
1777 struct ecryptfs_auth_tok *auth_tok;
1778 - struct scatterlist src_sg;
1779 - struct scatterlist dst_sg;
1780 + struct scatterlist src_sg[2];
1781 + struct scatterlist dst_sg[2];
1782 struct blkcipher_desc desc;
1783 char fnek_sig_hex[ECRYPTFS_SIG_SIZE_HEX + 1];
1784 char iv[ECRYPTFS_MAX_IV_BYTES];
1785 @@ -872,13 +870,12 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size,
1786 }
1787 mutex_lock(s->tfm_mutex);
1788 rc = virt_to_scatterlist(&data[(*packet_size)],
1789 - s->block_aligned_filename_size, &s->src_sg, 1);
1790 - if (rc != 1) {
1791 + s->block_aligned_filename_size, s->src_sg, 2);
1792 + if (rc < 1) {
1793 printk(KERN_ERR "%s: Internal error whilst attempting to "
1794 "convert encrypted filename memory to scatterlist; "
1795 - "expected rc = 1; got rc = [%d]. "
1796 - "block_aligned_filename_size = [%zd]\n", __func__, rc,
1797 - s->block_aligned_filename_size);
1798 + "rc = [%d]. block_aligned_filename_size = [%zd]\n",
1799 + __func__, rc, s->block_aligned_filename_size);
1800 goto out_unlock;
1801 }
1802 (*packet_size) += s->block_aligned_filename_size;
1803 @@ -892,13 +889,12 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size,
1804 goto out_unlock;
1805 }
1806 rc = virt_to_scatterlist(s->decrypted_filename,
1807 - s->block_aligned_filename_size, &s->dst_sg, 1);
1808 - if (rc != 1) {
1809 + s->block_aligned_filename_size, s->dst_sg, 2);
1810 + if (rc < 1) {
1811 printk(KERN_ERR "%s: Internal error whilst attempting to "
1812 "convert decrypted filename memory to scatterlist; "
1813 - "expected rc = 1; got rc = [%d]. "
1814 - "block_aligned_filename_size = [%zd]\n", __func__, rc,
1815 - s->block_aligned_filename_size);
1816 + "rc = [%d]. block_aligned_filename_size = [%zd]\n",
1817 + __func__, rc, s->block_aligned_filename_size);
1818 goto out_free_unlock;
1819 }
1820 /* The characters in the first block effectively do the job of
1821 @@ -937,7 +933,7 @@ ecryptfs_parse_tag_70_packet(char **filename, size_t *filename_size,
1822 mount_crypt_stat->global_default_fn_cipher_key_bytes);
1823 goto out_free_unlock;
1824 }
1825 - rc = crypto_blkcipher_decrypt_iv(&s->desc, &s->dst_sg, &s->src_sg,
1826 + rc = crypto_blkcipher_decrypt_iv(&s->desc, s->dst_sg, s->src_sg,
1827 s->block_aligned_filename_size);
1828 if (rc) {
1829 printk(KERN_ERR "%s: Error attempting to decrypt filename; "
1830 diff --git a/fs/exec.c b/fs/exec.c
1831 index 0cf881d..86fafc6 100644
1832 --- a/fs/exec.c
1833 +++ b/fs/exec.c
1834 @@ -1009,6 +1009,7 @@ int flush_old_exec(struct linux_binprm * bprm)
1835
1836 bprm->mm = NULL; /* We're using it now */
1837
1838 + set_fs(USER_DS);
1839 current->flags &= ~PF_RANDOMIZE;
1840 flush_thread();
1841 current->personality &= ~bprm->per_clear;
1842 @@ -1276,10 +1277,6 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
1843 if (retval)
1844 return retval;
1845
1846 - /* kernel module loader fixup */
1847 - /* so we don't try to load run modprobe in kernel space. */
1848 - set_fs(USER_DS);
1849 -
1850 retval = audit_bprm(bprm);
1851 if (retval)
1852 return retval;
1853 diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c
1854 index a168780..6397b52 100644
1855 --- a/fs/ext3/namei.c
1856 +++ b/fs/ext3/namei.c
1857 @@ -1425,10 +1425,19 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
1858 frame->at = entries;
1859 frame->bh = bh;
1860 bh = bh2;
1861 + /*
1862 + * Mark buffers dirty here so that if do_split() fails we write a
1863 + * consistent set of buffers to disk.
1864 + */
1865 + ext3_journal_dirty_metadata(handle, frame->bh);
1866 + ext3_journal_dirty_metadata(handle, bh);
1867 de = do_split(handle,dir, &bh, frame, &hinfo, &retval);
1868 - dx_release (frames);
1869 - if (!(de))
1870 + if (!de) {
1871 + ext3_mark_inode_dirty(handle, dir);
1872 + dx_release(frames);
1873 return retval;
1874 + }
1875 + dx_release(frames);
1876
1877 return add_dirent_to_buf(handle, dentry, inode, de, bh);
1878 }
1879 diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
1880 index 04e07e2..42bac1b 100644
1881 --- a/fs/ext4/mballoc.c
1882 +++ b/fs/ext4/mballoc.c
1883 @@ -1173,6 +1173,8 @@ repeat_load_buddy:
1884 return 0;
1885
1886 err:
1887 + if (page)
1888 + page_cache_release(page);
1889 if (e4b->bd_bitmap_page)
1890 page_cache_release(e4b->bd_bitmap_page);
1891 if (e4b->bd_buddy_page)
1892 diff --git a/fs/fat/file.c b/fs/fat/file.c
1893 index e8c159d..279937b 100644
1894 --- a/fs/fat/file.c
1895 +++ b/fs/fat/file.c
1896 @@ -101,7 +101,7 @@ static int fat_ioctl_set_attributes(struct file *file, u32 __user *user_attr)
1897 if (attr & ATTR_SYS)
1898 inode->i_flags |= S_IMMUTABLE;
1899 else
1900 - inode->i_flags &= S_IMMUTABLE;
1901 + inode->i_flags &= ~S_IMMUTABLE;
1902 }
1903
1904 fat_save_attrs(inode, attr);
1905 diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c
1906 index 4bd8825..17d29a8 100644
1907 --- a/fs/jbd/commit.c
1908 +++ b/fs/jbd/commit.c
1909 @@ -746,8 +746,13 @@ wait_for_iobuf:
1910 required. */
1911 JBUFFER_TRACE(jh, "file as BJ_Forget");
1912 journal_file_buffer(jh, commit_transaction, BJ_Forget);
1913 - /* Wake up any transactions which were waiting for this
1914 - IO to complete */
1915 + /*
1916 + * Wake up any transactions which were waiting for this
1917 + * IO to complete. The barrier must be here so that changes
1918 + * by journal_file_buffer() take effect before wake_up_bit()
1919 + * does the waitqueue check.
1920 + */
1921 + smp_mb();
1922 wake_up_bit(&bh->b_state, BH_Unshadow);
1923 JBUFFER_TRACE(jh, "brelse shadowed buffer");
1924 __brelse(bh);
1925 diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
1926 index bd224ee..45905ff 100644
1927 --- a/fs/jbd/journal.c
1928 +++ b/fs/jbd/journal.c
1929 @@ -435,9 +435,12 @@ int __log_space_left(journal_t *journal)
1930 int __log_start_commit(journal_t *journal, tid_t target)
1931 {
1932 /*
1933 - * Are we already doing a recent enough commit?
1934 + * The only transaction we can possibly wait upon is the
1935 + * currently running transaction (if it exists). Otherwise,
1936 + * the target tid must be an old one.
1937 */
1938 - if (!tid_geq(journal->j_commit_request, target)) {
1939 + if (journal->j_running_transaction &&
1940 + journal->j_running_transaction->t_tid == target) {
1941 /*
1942 * We want a new commit: OK, mark the request and wakup the
1943 * commit thread. We do _not_ do the commit ourselves.
1944 @@ -449,7 +452,14 @@ int __log_start_commit(journal_t *journal, tid_t target)
1945 journal->j_commit_sequence);
1946 wake_up(&journal->j_wait_commit);
1947 return 1;
1948 - }
1949 + } else if (!tid_geq(journal->j_commit_request, target))
1950 + /* This should never happen, but if it does, preserve
1951 + the evidence before kjournald goes into a loop and
1952 + increments j_commit_sequence beyond all recognition. */
1953 + WARN_ONCE(1, "jbd: bad log_start_commit: %u %u %u %u\n",
1954 + journal->j_commit_request, journal->j_commit_sequence,
1955 + target, journal->j_running_transaction ?
1956 + journal->j_running_transaction->t_tid : 0);
1957 return 0;
1958 }
1959
1960 diff --git a/fs/partitions/ldm.c b/fs/partitions/ldm.c
1961 index a2a14cd..dd6efdb 100644
1962 --- a/fs/partitions/ldm.c
1963 +++ b/fs/partitions/ldm.c
1964 @@ -1335,6 +1335,11 @@ static bool ldm_frag_add (const u8 *data, int size, struct list_head *frags)
1965
1966 list_add_tail (&f->list, frags);
1967 found:
1968 + if (rec >= f->num) {
1969 + ldm_error("REC value (%d) exceeds NUM value (%d)", rec, f->num);
1970 + return false;
1971 + }
1972 +
1973 if (f->map & (1 << rec)) {
1974 ldm_error ("Duplicate VBLK, part %d.", rec);
1975 f->map &= 0x7F; /* Mark the group as broken */
1976 diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c
1977 index d321bae..841f77c 100644
1978 --- a/fs/ubifs/journal.c
1979 +++ b/fs/ubifs/journal.c
1980 @@ -665,6 +665,7 @@ out_free:
1981
1982 out_release:
1983 release_head(c, BASEHD);
1984 + kfree(dent);
1985 out_ro:
1986 ubifs_ro_mode(c, err);
1987 if (last_reference)
1988 diff --git a/fs/ubifs/sb.c b/fs/ubifs/sb.c
1989 index 57085e4..238ad15 100644
1990 --- a/fs/ubifs/sb.c
1991 +++ b/fs/ubifs/sb.c
1992 @@ -474,7 +474,8 @@ failed:
1993 * @c: UBIFS file-system description object
1994 *
1995 * This function returns a pointer to the superblock node or a negative error
1996 - * code.
1997 + * code. Note, the user of this function is responsible of kfree()'ing the
1998 + * returned superblock buffer.
1999 */
2000 struct ubifs_sb_node *ubifs_read_sb_node(struct ubifs_info *c)
2001 {
2002 diff --git a/fs/ubifs/shrinker.c b/fs/ubifs/shrinker.c
2003 index 02feb59..aec6689 100644
2004 --- a/fs/ubifs/shrinker.c
2005 +++ b/fs/ubifs/shrinker.c
2006 @@ -283,7 +283,11 @@ int ubifs_shrinker(int nr, gfp_t gfp_mask)
2007 long clean_zn_cnt = atomic_long_read(&ubifs_clean_zn_cnt);
2008
2009 if (nr == 0)
2010 - return clean_zn_cnt;
2011 + /*
2012 + * Due to the way UBIFS updates the clean znode counter it may
2013 + * temporarily be negative.
2014 + */
2015 + return clean_zn_cnt >= 0 ? clean_zn_cnt : 1;
2016
2017 if (!clean_zn_cnt) {
2018 /*
2019 diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
2020 index 333e181..8440ba8 100644
2021 --- a/fs/ubifs/super.c
2022 +++ b/fs/ubifs/super.c
2023 @@ -1550,6 +1550,7 @@ static int ubifs_remount_rw(struct ubifs_info *c)
2024 }
2025 sup->leb_cnt = cpu_to_le32(c->leb_cnt);
2026 err = ubifs_write_sb_node(c, sup);
2027 + kfree(sup);
2028 if (err)
2029 goto out;
2030 }
2031 diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c
2032 index c82683a..71c14dd 100644
2033 --- a/fs/xfs/linux-2.6/xfs_sync.c
2034 +++ b/fs/xfs/linux-2.6/xfs_sync.c
2035 @@ -711,16 +711,24 @@ xfs_inode_set_reclaim_tag(
2036 }
2037
2038 void
2039 -__xfs_inode_clear_reclaim_tag(
2040 - xfs_mount_t *mp,
2041 +__xfs_inode_clear_reclaim(
2042 xfs_perag_t *pag,
2043 xfs_inode_t *ip)
2044 {
2045 - radix_tree_tag_clear(&pag->pag_ici_root,
2046 - XFS_INO_TO_AGINO(mp, ip->i_ino), XFS_ICI_RECLAIM_TAG);
2047 pag->pag_ici_reclaimable--;
2048 }
2049
2050 +void
2051 +__xfs_inode_clear_reclaim_tag(
2052 + xfs_mount_t *mp,
2053 + xfs_perag_t *pag,
2054 + xfs_inode_t *ip)
2055 +{
2056 + radix_tree_tag_clear(&pag->pag_ici_root,
2057 + XFS_INO_TO_AGINO(mp, ip->i_ino), XFS_ICI_RECLAIM_TAG);
2058 + __xfs_inode_clear_reclaim(pag, ip);
2059 +}
2060 +
2061 STATIC int
2062 xfs_reclaim_inode(
2063 struct xfs_inode *ip,
2064 diff --git a/fs/xfs/linux-2.6/xfs_sync.h b/fs/xfs/linux-2.6/xfs_sync.h
2065 index 0b28c13..81dd3bc 100644
2066 --- a/fs/xfs/linux-2.6/xfs_sync.h
2067 +++ b/fs/xfs/linux-2.6/xfs_sync.h
2068 @@ -48,6 +48,7 @@ int xfs_reclaim_inodes(struct xfs_mount *mp, int mode);
2069
2070 void xfs_inode_set_reclaim_tag(struct xfs_inode *ip);
2071 void __xfs_inode_set_reclaim_tag(struct xfs_perag *pag, struct xfs_inode *ip);
2072 +void __xfs_inode_clear_reclaim(struct xfs_perag *pag, struct xfs_inode *ip);
2073 void __xfs_inode_clear_reclaim_tag(struct xfs_mount *mp, struct xfs_perag *pag,
2074 struct xfs_inode *ip);
2075
2076 diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c
2077 index 16b6a33..320b79d 100644
2078 --- a/fs/xfs/xfs_iget.c
2079 +++ b/fs/xfs/xfs_iget.c
2080 @@ -529,6 +529,7 @@ xfs_ireclaim(
2081 write_lock(&pag->pag_ici_lock);
2082 if (!radix_tree_delete(&pag->pag_ici_root, agino))
2083 ASSERT(0);
2084 + __xfs_inode_clear_reclaim(pag, ip);
2085 write_unlock(&pag->pag_ici_lock);
2086 xfs_put_perag(mp, pag);
2087
2088 diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
2089 index c49d6f5..4528f29 100644
2090 --- a/include/linux/interrupt.h
2091 +++ b/include/linux/interrupt.h
2092 @@ -53,7 +53,7 @@
2093 * Used by threaded interrupts which need to keep the
2094 * irq line disabled until the threaded handler has been run.
2095 * IRQF_NO_SUSPEND - Do not disable this IRQ during suspend
2096 - *
2097 + * IRQF_FORCE_RESUME - Force enable it on resume even if IRQF_NO_SUSPEND is set
2098 */
2099 #define IRQF_DISABLED 0x00000020
2100 #define IRQF_SAMPLE_RANDOM 0x00000040
2101 @@ -65,6 +65,7 @@
2102 #define IRQF_IRQPOLL 0x00001000
2103 #define IRQF_ONESHOT 0x00002000
2104 #define IRQF_NO_SUSPEND 0x00004000
2105 +#define IRQF_FORCE_RESUME 0x00008000
2106
2107 #define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND)
2108
2109 diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
2110 index fe2f4ee..a339386 100644
2111 --- a/include/linux/pci_ids.h
2112 +++ b/include/linux/pci_ids.h
2113 @@ -605,6 +605,8 @@
2114 #define PCI_DEVICE_ID_MATROX_G550 0x2527
2115 #define PCI_DEVICE_ID_MATROX_VIA 0x4536
2116
2117 +#define PCI_VENDOR_ID_MOBILITY_ELECTRONICS 0x14f2
2118 +
2119 #define PCI_VENDOR_ID_CT 0x102c
2120 #define PCI_DEVICE_ID_CT_69000 0x00c0
2121 #define PCI_DEVICE_ID_CT_65545 0x00d8
2122 diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
2123 index 632205c..4c3257d 100644
2124 --- a/include/linux/seqlock.h
2125 +++ b/include/linux/seqlock.h
2126 @@ -88,12 +88,12 @@ static __always_inline unsigned read_seqbegin(const seqlock_t *sl)
2127 unsigned ret;
2128
2129 repeat:
2130 - ret = sl->sequence;
2131 - smp_rmb();
2132 + ret = ACCESS_ONCE(sl->sequence);
2133 if (unlikely(ret & 1)) {
2134 cpu_relax();
2135 goto repeat;
2136 }
2137 + smp_rmb();
2138
2139 return ret;
2140 }
2141 diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
2142 index 5fad88b..d40ecd5 100644
2143 --- a/kernel/irq/manage.c
2144 +++ b/kernel/irq/manage.c
2145 @@ -265,8 +265,17 @@ EXPORT_SYMBOL(disable_irq);
2146
2147 void __enable_irq(struct irq_desc *desc, unsigned int irq, bool resume)
2148 {
2149 - if (resume)
2150 + if (resume) {
2151 + if (!(desc->status & IRQ_SUSPENDED)) {
2152 + if (!desc->action)
2153 + return;
2154 + if (!(desc->action->flags & IRQF_FORCE_RESUME))
2155 + return;
2156 + /* Pretend that it got disabled ! */
2157 + desc->depth++;
2158 + }
2159 desc->status &= ~IRQ_SUSPENDED;
2160 + }
2161
2162 switch (desc->depth) {
2163 case 0:
2164 diff --git a/kernel/irq/pm.c b/kernel/irq/pm.c
2165 index a0bb09e..0067abb 100644
2166 --- a/kernel/irq/pm.c
2167 +++ b/kernel/irq/pm.c
2168 @@ -53,9 +53,6 @@ void resume_device_irqs(void)
2169 for_each_irq_desc(irq, desc) {
2170 unsigned long flags;
2171
2172 - if (!(desc->status & IRQ_SUSPENDED))
2173 - continue;
2174 -
2175 spin_lock_irqsave(&desc->lock, flags);
2176 __enable_irq(desc, irq, true);
2177 spin_unlock_irqrestore(&desc->lock, flags);
2178 diff --git a/kernel/lockdep.c b/kernel/lockdep.c
2179 index 9af5672..d86fe89 100644
2180 --- a/kernel/lockdep.c
2181 +++ b/kernel/lockdep.c
2182 @@ -3243,7 +3243,7 @@ int lock_is_held(struct lockdep_map *lock)
2183 int ret = 0;
2184
2185 if (unlikely(current->lockdep_recursion))
2186 - return ret;
2187 + return 1; /* avoid false negative lockdep_assert_held() */
2188
2189 raw_local_irq_save(flags);
2190 check_flags(flags);
2191 diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
2192 index f5e362f..1d1206a 100644
2193 --- a/kernel/time/timekeeping.c
2194 +++ b/kernel/time/timekeeping.c
2195 @@ -32,6 +32,8 @@ struct timekeeper {
2196 cycle_t cycle_interval;
2197 /* Number of clock shifted nano seconds in one NTP interval. */
2198 u64 xtime_interval;
2199 + /* shifted nano seconds left over when rounding cycle_interval */
2200 + s64 xtime_remainder;
2201 /* Raw nano seconds accumulated per NTP interval. */
2202 u32 raw_interval;
2203
2204 @@ -62,7 +64,7 @@ struct timekeeper timekeeper;
2205 static void timekeeper_setup_internals(struct clocksource *clock)
2206 {
2207 cycle_t interval;
2208 - u64 tmp;
2209 + u64 tmp, ntpinterval;
2210
2211 timekeeper.clock = clock;
2212 clock->cycle_last = clock->read(clock);
2213 @@ -70,6 +72,7 @@ static void timekeeper_setup_internals(struct clocksource *clock)
2214 /* Do the ns -> cycle conversion first, using original mult */
2215 tmp = NTP_INTERVAL_LENGTH;
2216 tmp <<= clock->shift;
2217 + ntpinterval = tmp;
2218 tmp += clock->mult/2;
2219 do_div(tmp, clock->mult);
2220 if (tmp == 0)
2221 @@ -80,6 +83,7 @@ static void timekeeper_setup_internals(struct clocksource *clock)
2222
2223 /* Go back from cycles -> shifted ns */
2224 timekeeper.xtime_interval = (u64) interval * clock->mult;
2225 + timekeeper.xtime_remainder = ntpinterval - timekeeper.xtime_interval;
2226 timekeeper.raw_interval =
2227 ((u64) interval * clock->mult) >> clock->shift;
2228
2229 @@ -788,7 +792,8 @@ void update_wall_time(void)
2230
2231 /* accumulate error between NTP and clock interval */
2232 timekeeper.ntp_error += tick_length;
2233 - timekeeper.ntp_error -= timekeeper.xtime_interval <<
2234 + timekeeper.ntp_error -=
2235 + (timekeeper.xtime_interval + timekeeper.xtime_remainder) <<
2236 timekeeper.ntp_error_shift;
2237 }
2238
2239 diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
2240 index 0afddc2..4872937 100644
2241 --- a/kernel/trace/ftrace.c
2242 +++ b/kernel/trace/ftrace.c
2243 @@ -2360,14 +2360,16 @@ ftrace_regex_release(struct inode *inode, struct file *file, int enable)
2244 ftrace_match_records(parser->buffer, parser->idx, enable);
2245 }
2246
2247 - mutex_lock(&ftrace_lock);
2248 - if (ftrace_start_up && ftrace_enabled)
2249 - ftrace_run_update_code(FTRACE_ENABLE_CALLS);
2250 - mutex_unlock(&ftrace_lock);
2251 -
2252 trace_parser_put(parser);
2253 kfree(iter);
2254
2255 + if (file->f_mode & FMODE_WRITE) {
2256 + mutex_lock(&ftrace_lock);
2257 + if (ftrace_start_up && ftrace_enabled)
2258 + ftrace_run_update_code(FTRACE_ENABLE_CALLS);
2259 + mutex_unlock(&ftrace_lock);
2260 + }
2261 +
2262 mutex_unlock(&ftrace_regex_lock);
2263 return 0;
2264 }
2265 diff --git a/lib/locking-selftest.c b/lib/locking-selftest.c
2266 index 619313e..507a22f 100644
2267 --- a/lib/locking-selftest.c
2268 +++ b/lib/locking-selftest.c
2269 @@ -144,7 +144,7 @@ static void init_shared_classes(void)
2270
2271 #define HARDIRQ_ENTER() \
2272 local_irq_disable(); \
2273 - irq_enter(); \
2274 + __irq_enter(); \
2275 WARN_ON(!in_irq());
2276
2277 #define HARDIRQ_EXIT() \
2278 diff --git a/mm/hugetlb.c b/mm/hugetlb.c
2279 index f5a106e..0cf9863 100644
2280 --- a/mm/hugetlb.c
2281 +++ b/mm/hugetlb.c
2282 @@ -995,10 +995,10 @@ static struct page *alloc_huge_page(struct vm_area_struct *vma,
2283 */
2284 chg = vma_needs_reservation(h, vma, addr);
2285 if (chg < 0)
2286 - return ERR_PTR(chg);
2287 + return ERR_PTR(-VM_FAULT_OOM);
2288 if (chg)
2289 if (hugetlb_get_quota(inode->i_mapping, chg))
2290 - return ERR_PTR(-ENOSPC);
2291 + return ERR_PTR(-VM_FAULT_SIGBUS);
2292
2293 spin_lock(&hugetlb_lock);
2294 page = dequeue_huge_page_vma(h, vma, addr, avoid_reserve);
2295 diff --git a/mm/kmemleak.c b/mm/kmemleak.c
2296 index 8bf765c..c346660 100644
2297 --- a/mm/kmemleak.c
2298 +++ b/mm/kmemleak.c
2299 @@ -1354,9 +1354,12 @@ static void *kmemleak_seq_next(struct seq_file *seq, void *v, loff_t *pos)
2300 ++(*pos);
2301
2302 list_for_each_continue_rcu(n, &object_list) {
2303 - next_obj = list_entry(n, struct kmemleak_object, object_list);
2304 - if (get_object(next_obj))
2305 + struct kmemleak_object *obj =
2306 + list_entry(n, struct kmemleak_object, object_list);
2307 + if (get_object(obj)) {
2308 + next_obj = obj;
2309 break;
2310 + }
2311 }
2312
2313 put_object(prev_obj);
2314 diff --git a/mm/page_alloc.c b/mm/page_alloc.c
2315 index 902e5fc..3ecab7e 100644
2316 --- a/mm/page_alloc.c
2317 +++ b/mm/page_alloc.c
2318 @@ -1841,6 +1841,7 @@ restart:
2319 */
2320 alloc_flags = gfp_to_alloc_flags(gfp_mask);
2321
2322 +rebalance:
2323 /* This is the last chance, in general, before the goto nopage. */
2324 page = get_page_from_freelist(gfp_mask, nodemask, order, zonelist,
2325 high_zoneidx, alloc_flags & ~ALLOC_NO_WATERMARKS,
2326 @@ -1848,7 +1849,6 @@ restart:
2327 if (page)
2328 goto got_pg;
2329
2330 -rebalance:
2331 /* Allocate without watermarks if the context allows */
2332 if (alloc_flags & ALLOC_NO_WATERMARKS) {
2333 page = __alloc_pages_high_priority(gfp_mask, order,
2334 diff --git a/net/atm/atm_sysfs.c b/net/atm/atm_sysfs.c
2335 index b5674dc..7bbe81e 100644
2336 --- a/net/atm/atm_sysfs.c
2337 +++ b/net/atm/atm_sysfs.c
2338 @@ -57,6 +57,14 @@ static ssize_t show_atmaddress(struct device *cdev,
2339 return pos - buf;
2340 }
2341
2342 +static ssize_t show_atmindex(struct device *cdev,
2343 + struct device_attribute *attr, char *buf)
2344 +{
2345 + struct atm_dev *adev = to_atm_dev(cdev);
2346 +
2347 + return sprintf(buf, "%d\n", adev->number);
2348 +}
2349 +
2350 static ssize_t show_carrier(struct device *cdev,
2351 struct device_attribute *attr, char *buf)
2352 {
2353 @@ -97,6 +105,7 @@ static ssize_t show_link_rate(struct device *cdev,
2354
2355 static DEVICE_ATTR(address, S_IRUGO, show_address, NULL);
2356 static DEVICE_ATTR(atmaddress, S_IRUGO, show_atmaddress, NULL);
2357 +static DEVICE_ATTR(atmindex, S_IRUGO, show_atmindex, NULL);
2358 static DEVICE_ATTR(carrier, S_IRUGO, show_carrier, NULL);
2359 static DEVICE_ATTR(type, S_IRUGO, show_type, NULL);
2360 static DEVICE_ATTR(link_rate, S_IRUGO, show_link_rate, NULL);
2361 @@ -104,6 +113,7 @@ static DEVICE_ATTR(link_rate, S_IRUGO, show_link_rate, NULL);
2362 static struct device_attribute *atm_attrs[] = {
2363 &dev_attr_atmaddress,
2364 &dev_attr_address,
2365 + &dev_attr_atmindex,
2366 &dev_attr_carrier,
2367 &dev_attr_type,
2368 &dev_attr_link_rate,
2369 diff --git a/net/ipv6/netfilter/ip6t_REJECT.c b/net/ipv6/netfilter/ip6t_REJECT.c
2370 index 1264ad0..58679f8 100644
2371 --- a/net/ipv6/netfilter/ip6t_REJECT.c
2372 +++ b/net/ipv6/netfilter/ip6t_REJECT.c
2373 @@ -43,6 +43,8 @@ static void send_reset(struct net *net, struct sk_buff *oldskb)
2374 int tcphoff, needs_ack;
2375 const struct ipv6hdr *oip6h = ipv6_hdr(oldskb);
2376 struct ipv6hdr *ip6h;
2377 +#define DEFAULT_TOS_VALUE 0x0U
2378 + const __u8 tclass = DEFAULT_TOS_VALUE;
2379 struct dst_entry *dst = NULL;
2380 u8 proto;
2381 struct flowi fl;
2382 @@ -121,7 +123,7 @@ static void send_reset(struct net *net, struct sk_buff *oldskb)
2383 skb_put(nskb, sizeof(struct ipv6hdr));
2384 skb_reset_network_header(nskb);
2385 ip6h = ipv6_hdr(nskb);
2386 - ip6h->version = 6;
2387 + *(__be32 *)ip6h = htonl(0x60000000 | (tclass << 20));
2388 ip6h->hop_limit = dst_metric(dst, RTAX_HOPLIMIT);
2389 ip6h->nexthdr = IPPROTO_TCP;
2390 ipv6_addr_copy(&ip6h->saddr, &oip6h->daddr);
2391 diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
2392 index bfc8737..e5590a9 100644
2393 --- a/net/ipv6/netfilter/nf_conntrack_reasm.c
2394 +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
2395 @@ -474,7 +474,7 @@ nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev)
2396
2397 /* all original skbs are linked into the NFCT_FRAG6_CB(head).orig */
2398 fp = skb_shinfo(head)->frag_list;
2399 - if (NFCT_FRAG6_CB(fp)->orig == NULL)
2400 + if (fp && NFCT_FRAG6_CB(fp)->orig == NULL)
2401 /* at above code, head skb is divided into two skbs. */
2402 fp = fp->next;
2403
2404 @@ -600,12 +600,6 @@ struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb, u32 user)
2405 hdr = ipv6_hdr(clone);
2406 fhdr = (struct frag_hdr *)skb_transport_header(clone);
2407
2408 - if (!(fhdr->frag_off & htons(0xFFF9))) {
2409 - pr_debug("Invalid fragment offset\n");
2410 - /* It is not a fragmented frame */
2411 - goto ret_orig;
2412 - }
2413 -
2414 if (atomic_read(&nf_init_frags.mem) > nf_init_frags.high_thresh)
2415 nf_ct_frag6_evictor();
2416
2417 diff --git a/net/netfilter/xt_DSCP.c b/net/netfilter/xt_DSCP.c
2418 index 74ce892..5ec6374 100644
2419 --- a/net/netfilter/xt_DSCP.c
2420 +++ b/net/netfilter/xt_DSCP.c
2421 @@ -99,7 +99,7 @@ tos_tg6(struct sk_buff *skb, const struct xt_target_param *par)
2422 u_int8_t orig, nv;
2423
2424 orig = ipv6_get_dsfield(iph);
2425 - nv = (orig & info->tos_mask) ^ info->tos_value;
2426 + nv = (orig & ~info->tos_mask) ^ info->tos_value;
2427
2428 if (orig != nv) {
2429 if (!skb_make_writable(skb, sizeof(struct iphdr)))
2430 diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
2431 index 1d61c33..79194ad 100644
2432 --- a/net/sunrpc/xprtsock.c
2433 +++ b/net/sunrpc/xprtsock.c
2434 @@ -1381,7 +1381,6 @@ static void xs_tcp_state_change(struct sock *sk)
2435 case TCP_CLOSE_WAIT:
2436 /* The server initiated a shutdown of the socket */
2437 xprt_force_disconnect(xprt);
2438 - case TCP_SYN_SENT:
2439 xprt->connect_cookie++;
2440 case TCP_CLOSING:
2441 /*
2442 @@ -1843,6 +1842,7 @@ static void xs_tcp_reuse_connection(struct rpc_xprt *xprt, struct sock_xprt *tra
2443 static int xs_tcp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock)
2444 {
2445 struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
2446 + int ret = -ENOTCONN;
2447
2448 if (!transport->inet) {
2449 struct sock *sk = sock->sk;
2450 @@ -1874,12 +1874,22 @@ static int xs_tcp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock)
2451 }
2452
2453 if (!xprt_bound(xprt))
2454 - return -ENOTCONN;
2455 + goto out;
2456
2457 /* Tell the socket layer to start connecting... */
2458 xprt->stat.connect_count++;
2459 xprt->stat.connect_start = jiffies;
2460 - return kernel_connect(sock, xs_addr(xprt), xprt->addrlen, O_NONBLOCK);
2461 + ret = kernel_connect(sock, xs_addr(xprt), xprt->addrlen, O_NONBLOCK);
2462 + switch (ret) {
2463 + case 0:
2464 + case -EINPROGRESS:
2465 + /* SYN_SENT! */
2466 + xprt->connect_cookie++;
2467 + if (xprt->reestablish_timeout < XS_TCP_INIT_REEST_TO)
2468 + xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO;
2469 + }
2470 +out:
2471 + return ret;
2472 }
2473
2474 /**
2475 diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
2476 index b75e718..f0341e4 100644
2477 --- a/net/wireless/nl80211.c
2478 +++ b/net/wireless/nl80211.c
2479 @@ -2995,12 +2995,12 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
2480 i = 0;
2481 if (info->attrs[NL80211_ATTR_SCAN_SSIDS]) {
2482 nla_for_each_nested(attr, info->attrs[NL80211_ATTR_SCAN_SSIDS], tmp) {
2483 + request->ssids[i].ssid_len = nla_len(attr);
2484 if (request->ssids[i].ssid_len > IEEE80211_MAX_SSID_LEN) {
2485 err = -EINVAL;
2486 goto out_free;
2487 }
2488 memcpy(request->ssids[i].ssid, nla_data(attr), nla_len(attr));
2489 - request->ssids[i].ssid_len = nla_len(attr);
2490 i++;
2491 }
2492 }
2493 diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
2494 index ed550e4..083b777 100644
2495 --- a/sound/pci/hda/patch_realtek.c
2496 +++ b/sound/pci/hda/patch_realtek.c
2497 @@ -12662,6 +12662,7 @@ static struct snd_pci_quirk alc268_cfg_tbl[] = {
2498 SND_PCI_QUIRK(0x1025, 0x015b, "Acer Aspire One",
2499 ALC268_ACER_ASPIRE_ONE),
2500 SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL),
2501 + SND_PCI_QUIRK(0x1028, 0x02b0, "Dell Inspiron 910", ALC268_AUTO),
2502 SND_PCI_QUIRK_MASK(0x1028, 0xfff0, 0x02b0,
2503 "Dell Inspiron Mini9/Vostro A90", ALC268_DELL),
2504 /* almost compatible with toshiba but with optional digital outs;
2505 diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
2506 index 7e59c34..01da10b 100644
2507 --- a/sound/pci/hda/patch_sigmatel.c
2508 +++ b/sound/pci/hda/patch_sigmatel.c
2509 @@ -1600,7 +1600,7 @@ static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = {
2510 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02fe,
2511 "Dell Studio XPS 1645", STAC_DELL_M6_BOTH),
2512 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0413,
2513 - "Dell Studio 1558", STAC_DELL_M6_BOTH),
2514 + "Dell Studio 1558", STAC_DELL_M6_DMIC),
2515 {} /* terminator */
2516 };
2517
2518 diff --git a/sound/soc/codecs/wm_hubs.c b/sound/soc/codecs/wm_hubs.c
2519 index a80f1ad..12506dc 100644
2520 --- a/sound/soc/codecs/wm_hubs.c
2521 +++ b/sound/soc/codecs/wm_hubs.c
2522 @@ -639,17 +639,17 @@ static const struct snd_soc_dapm_route analogue_routes[] = {
2523 static const struct snd_soc_dapm_route lineout1_diff_routes[] = {
2524 { "LINEOUT1 Mixer", "IN1L Switch", "IN1L PGA" },
2525 { "LINEOUT1 Mixer", "IN1R Switch", "IN1R PGA" },
2526 - { "LINEOUT1 Mixer", "Output Switch", "Left Output Mixer" },
2527 + { "LINEOUT1 Mixer", "Output Switch", "Left Output PGA" },
2528
2529 { "LINEOUT1N Driver", NULL, "LINEOUT1 Mixer" },
2530 { "LINEOUT1P Driver", NULL, "LINEOUT1 Mixer" },
2531 };
2532
2533 static const struct snd_soc_dapm_route lineout1_se_routes[] = {
2534 - { "LINEOUT1N Mixer", "Left Output Switch", "Left Output Mixer" },
2535 - { "LINEOUT1N Mixer", "Right Output Switch", "Left Output Mixer" },
2536 + { "LINEOUT1N Mixer", "Left Output Switch", "Left Output PGA" },
2537 + { "LINEOUT1N Mixer", "Right Output Switch", "Right Output PGA" },
2538
2539 - { "LINEOUT1P Mixer", "Left Output Switch", "Left Output Mixer" },
2540 + { "LINEOUT1P Mixer", "Left Output Switch", "Left Output PGA" },
2541
2542 { "LINEOUT1N Driver", NULL, "LINEOUT1N Mixer" },
2543 { "LINEOUT1P Driver", NULL, "LINEOUT1P Mixer" },
2544 @@ -658,17 +658,17 @@ static const struct snd_soc_dapm_route lineout1_se_routes[] = {
2545 static const struct snd_soc_dapm_route lineout2_diff_routes[] = {
2546 { "LINEOUT2 Mixer", "IN2L Switch", "IN2L PGA" },
2547 { "LINEOUT2 Mixer", "IN2R Switch", "IN2R PGA" },
2548 - { "LINEOUT2 Mixer", "Output Switch", "Right Output Mixer" },
2549 + { "LINEOUT2 Mixer", "Output Switch", "Right Output PGA" },
2550
2551 { "LINEOUT2N Driver", NULL, "LINEOUT2 Mixer" },
2552 { "LINEOUT2P Driver", NULL, "LINEOUT2 Mixer" },
2553 };
2554
2555 static const struct snd_soc_dapm_route lineout2_se_routes[] = {
2556 - { "LINEOUT2N Mixer", "Left Output Switch", "Left Output Mixer" },
2557 - { "LINEOUT2N Mixer", "Right Output Switch", "Left Output Mixer" },
2558 + { "LINEOUT2N Mixer", "Left Output Switch", "Left Output PGA" },
2559 + { "LINEOUT2N Mixer", "Right Output Switch", "Right Output PGA" },
2560
2561 - { "LINEOUT2P Mixer", "Right Output Switch", "Right Output Mixer" },
2562 + { "LINEOUT2P Mixer", "Right Output Switch", "Right Output PGA" },
2563
2564 { "LINEOUT2N Driver", NULL, "LINEOUT2N Mixer" },
2565 { "LINEOUT2P Driver", NULL, "LINEOUT2P Mixer" },
2566 @@ -686,17 +686,21 @@ int wm_hubs_add_analogue_controls(struct snd_soc_codec *codec)
2567 snd_soc_update_bits(codec, WM8993_RIGHT_LINE_INPUT_3_4_VOLUME,
2568 WM8993_IN2_VU, WM8993_IN2_VU);
2569
2570 + snd_soc_update_bits(codec, WM8993_SPEAKER_VOLUME_LEFT,
2571 + WM8993_SPKOUT_VU, WM8993_SPKOUT_VU);
2572 snd_soc_update_bits(codec, WM8993_SPEAKER_VOLUME_RIGHT,
2573 WM8993_SPKOUT_VU, WM8993_SPKOUT_VU);
2574
2575 snd_soc_update_bits(codec, WM8993_LEFT_OUTPUT_VOLUME,
2576 - WM8993_HPOUT1L_ZC, WM8993_HPOUT1L_ZC);
2577 + WM8993_HPOUT1_VU | WM8993_HPOUT1L_ZC,
2578 + WM8993_HPOUT1_VU | WM8993_HPOUT1L_ZC);
2579 snd_soc_update_bits(codec, WM8993_RIGHT_OUTPUT_VOLUME,
2580 WM8993_HPOUT1_VU | WM8993_HPOUT1R_ZC,
2581 WM8993_HPOUT1_VU | WM8993_HPOUT1R_ZC);
2582
2583 snd_soc_update_bits(codec, WM8993_LEFT_OPGA_VOLUME,
2584 - WM8993_MIXOUTL_ZC, WM8993_MIXOUTL_ZC);
2585 + WM8993_MIXOUTL_ZC | WM8993_MIXOUT_VU,
2586 + WM8993_MIXOUTL_ZC | WM8993_MIXOUT_VU);
2587 snd_soc_update_bits(codec, WM8993_RIGHT_OPGA_VOLUME,
2588 WM8993_MIXOUTR_ZC | WM8993_MIXOUT_VU,
2589 WM8993_MIXOUTR_ZC | WM8993_MIXOUT_VU);

  ViewVC Help
Powered by ViewVC 1.1.20