]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.kernel.org/patch-2.6.27.8-9
Fix oinkmaster patch.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.kernel.org / patch-2.6.27.8-9
CommitLineData
82094b55
AF
1From: Greg Kroah-Hartman <gregkh@suse.de>
2Subject: Linux 2.6.27.9
3
4Upstream 2.6.27.9 release from kernel.org
5
6Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
7
8diff --git a/Makefile b/Makefile
9index a629d7f..cb93e2b 100644
10--- a/Makefile
11+++ b/Makefile
12@@ -1,7 +1,7 @@
13 VERSION = 2
14 PATCHLEVEL = 6
15 SUBLEVEL = 27
16-EXTRAVERSION = .8
17+EXTRAVERSION = .9
18 NAME = Trembling Tortoise
19
20 # *DOCUMENTATION*
21diff --git a/arch/powerpc/kernel/cpu_setup_44x.S b/arch/powerpc/kernel/cpu_setup_44x.S
22index 80cac98..f812452 100644
23--- a/arch/powerpc/kernel/cpu_setup_44x.S
24+++ b/arch/powerpc/kernel/cpu_setup_44x.S
25@@ -35,6 +35,7 @@ _GLOBAL(__setup_cpu_440grx)
26 _GLOBAL(__setup_cpu_460ex)
27 _GLOBAL(__setup_cpu_460gt)
28 b __init_fpu_44x
29+_GLOBAL(__setup_cpu_440x5)
30 _GLOBAL(__setup_cpu_440gx)
31 _GLOBAL(__setup_cpu_440spe)
32 b __fixup_440A_mcheck
33diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
34index 25c273c..2b88cae 100644
35--- a/arch/powerpc/kernel/cputable.c
36+++ b/arch/powerpc/kernel/cputable.c
37@@ -39,6 +39,7 @@ extern void __setup_cpu_440epx(unsigned long offset, struct cpu_spec* spec);
38 extern void __setup_cpu_440gx(unsigned long offset, struct cpu_spec* spec);
39 extern void __setup_cpu_440grx(unsigned long offset, struct cpu_spec* spec);
40 extern void __setup_cpu_440spe(unsigned long offset, struct cpu_spec* spec);
41+extern void __setup_cpu_440x5(unsigned long offset, struct cpu_spec* spec);
42 extern void __setup_cpu_460ex(unsigned long offset, struct cpu_spec* spec);
43 extern void __setup_cpu_460gt(unsigned long offset, struct cpu_spec* spec);
44 extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec);
45@@ -1463,6 +1464,8 @@ static struct cpu_spec __initdata cpu_specs[] = {
46 .cpu_user_features = COMMON_USER_BOOKE,
47 .icache_bsize = 32,
48 .dcache_bsize = 32,
49+ .cpu_setup = __setup_cpu_440x5,
50+ .machine_check = machine_check_440A,
51 .platform = "ppc440",
52 },
53 { /* 460EX */
54diff --git a/arch/powerpc/platforms/cell/smp.c b/arch/powerpc/platforms/cell/smp.c
55index efb3964..c0d86e1 100644
56--- a/arch/powerpc/platforms/cell/smp.c
57+++ b/arch/powerpc/platforms/cell/smp.c
58@@ -54,8 +54,8 @@
59 #endif
60
61 /*
62- * The primary thread of each non-boot processor is recorded here before
63- * smp init.
64+ * The Primary thread of each non-boot processor was started from the OF client
65+ * interface by prom_hold_cpus and is spinning on secondary_hold_spinloop.
66 */
67 static cpumask_t of_spin_map;
68
69@@ -208,11 +208,7 @@ void __init smp_init_cell(void)
70 /* Mark threads which are still spinning in hold loops. */
71 if (cpu_has_feature(CPU_FTR_SMT)) {
72 for_each_present_cpu(i) {
73- if (i % 2 == 0)
74- /*
75- * Even-numbered logical cpus correspond to
76- * primary threads.
77- */
78+ if (cpu_thread_in_core(i) == 0)
79 cpu_set(i, of_spin_map);
80 }
81 } else {
82diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
83index 9d8f8c8..c9337c7 100644
84--- a/arch/powerpc/platforms/pseries/smp.c
85+++ b/arch/powerpc/platforms/pseries/smp.c
86@@ -52,8 +52,8 @@
87
88
89 /*
90- * The primary thread of each non-boot processor is recorded here before
91- * smp init.
92+ * The Primary thread of each non-boot processor was started from the OF client
93+ * interface by prom_hold_cpus and is spinning on secondary_hold_spinloop.
94 */
95 static cpumask_t of_spin_map;
96
97@@ -191,8 +191,7 @@ static void __devinit smp_pSeries_kick_cpu(int nr)
98 static int smp_pSeries_cpu_bootable(unsigned int nr)
99 {
100 /* Special case - we inhibit secondary thread startup
101- * during boot if the user requests it. Odd-numbered
102- * cpus are assumed to be secondary threads.
103+ * during boot if the user requests it.
104 */
105 if (system_state < SYSTEM_RUNNING &&
106 cpu_has_feature(CPU_FTR_SMT) &&
107@@ -229,11 +228,7 @@ static void __init smp_init_pseries(void)
108 /* Mark threads which are still spinning in hold loops. */
109 if (cpu_has_feature(CPU_FTR_SMT)) {
110 for_each_present_cpu(i) {
111- if (i % 2 == 0)
112- /*
113- * Even-numbered logical cpus correspond to
114- * primary threads.
115- */
116+ if (cpu_thread_in_core(i) == 0)
117 cpu_set(i, of_spin_map);
118 }
119 } else {
120diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
121index f6299cc..b24e1d0 100644
122--- a/arch/powerpc/sysdev/mpic.c
123+++ b/arch/powerpc/sysdev/mpic.c
124@@ -1271,6 +1271,7 @@ void __init mpic_set_default_senses(struct mpic *mpic, u8 *senses, int count)
125 void __init mpic_init(struct mpic *mpic)
126 {
127 int i;
128+ int cpu;
129
130 BUG_ON(mpic->num_sources == 0);
131
132@@ -1313,6 +1314,11 @@ void __init mpic_init(struct mpic *mpic)
133
134 mpic_pasemi_msi_init(mpic);
135
136+ if (mpic->flags & MPIC_PRIMARY)
137+ cpu = hard_smp_processor_id();
138+ else
139+ cpu = 0;
140+
141 for (i = 0; i < mpic->num_sources; i++) {
142 /* start with vector = source number, and masked */
143 u32 vecpri = MPIC_VECPRI_MASK | i |
144@@ -1323,8 +1329,7 @@ void __init mpic_init(struct mpic *mpic)
145 continue;
146 /* init hw */
147 mpic_irq_write(i, MPIC_INFO(IRQ_VECTOR_PRI), vecpri);
148- mpic_irq_write(i, MPIC_INFO(IRQ_DESTINATION),
149- 1 << hard_smp_processor_id());
150+ mpic_irq_write(i, MPIC_INFO(IRQ_DESTINATION), 1 << cpu);
151 }
152
153 /* Init spurious vector */
154diff --git a/arch/sparc/include/asm/uaccess_64.h b/arch/sparc/include/asm/uaccess_64.h
155index 296ef30..c64e767 100644
156--- a/arch/sparc/include/asm/uaccess_64.h
157+++ b/arch/sparc/include/asm/uaccess_64.h
158@@ -265,8 +265,8 @@ extern long __strnlen_user(const char __user *, long len);
159
160 #define strlen_user __strlen_user
161 #define strnlen_user __strnlen_user
162-#define __copy_to_user_inatomic __copy_to_user
163-#define __copy_from_user_inatomic __copy_from_user
164+#define __copy_to_user_inatomic ___copy_to_user
165+#define __copy_from_user_inatomic ___copy_from_user
166
167 #endif /* __ASSEMBLY__ */
168
169diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
170index 80dad76..83b4725 100644
171--- a/arch/sparc64/kernel/pci.c
172+++ b/arch/sparc64/kernel/pci.c
173@@ -1017,6 +1017,7 @@ static int __pci_mmap_make_offset(struct pci_dev *pdev,
174
175 for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
176 struct resource *rp = &pdev->resource[i];
177+ resource_size_t aligned_end;
178
179 /* Active? */
180 if (!rp->flags)
181@@ -1034,8 +1035,15 @@ static int __pci_mmap_make_offset(struct pci_dev *pdev,
182 continue;
183 }
184
185+ /* Align the resource end to the next page address.
186+ * PAGE_SIZE intentionally added instead of (PAGE_SIZE - 1),
187+ * because actually we need the address of the next byte
188+ * after rp->end.
189+ */
190+ aligned_end = (rp->end + PAGE_SIZE) & PAGE_MASK;
191+
192 if ((rp->start <= user_paddr) &&
193- (user_paddr + user_size) <= (rp->end + 1UL))
194+ (user_paddr + user_size) <= aligned_end)
195 break;
196 }
197
198diff --git a/arch/sparc64/kernel/ptrace.c b/arch/sparc64/kernel/ptrace.c
199index 10306e4..2df5b9b 100644
200--- a/arch/sparc64/kernel/ptrace.c
201+++ b/arch/sparc64/kernel/ptrace.c
202@@ -1014,7 +1014,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
203 break;
204
205 case PTRACE_SETFPREGS64:
206- ret = copy_regset_to_user(child, view, REGSET_FP,
207+ ret = copy_regset_from_user(child, view, REGSET_FP,
208 0 * sizeof(u64),
209 33 * sizeof(u64),
210 fps);
211diff --git a/arch/sparc64/kernel/visemul.c b/arch/sparc64/kernel/visemul.c
212index c3fd647..a4428fd 100644
213--- a/arch/sparc64/kernel/visemul.c
214+++ b/arch/sparc64/kernel/visemul.c
215@@ -131,7 +131,7 @@
216 #define VIS_OPF_SHIFT 5
217 #define VIS_OPF_MASK (0x1ff << VIS_OPF_SHIFT)
218
219-#define RS1(INSN) (((INSN) >> 24) & 0x1f)
220+#define RS1(INSN) (((INSN) >> 14) & 0x1f)
221 #define RS2(INSN) (((INSN) >> 0) & 0x1f)
222 #define RD(INSN) (((INSN) >> 25) & 0x1f)
223
224@@ -445,7 +445,7 @@ static void pdist(struct pt_regs *regs, unsigned int insn)
225 unsigned long i;
226
227 rs1 = fpd_regval(f, RS1(insn));
228- rs2 = fpd_regval(f, RS1(insn));
229+ rs2 = fpd_regval(f, RS2(insn));
230 rd = fpd_regaddr(f, RD(insn));
231
232 rd_val = *rd;
233@@ -807,6 +807,8 @@ int vis_emul(struct pt_regs *regs, unsigned int insn)
234 if (get_user(insn, (u32 __user *) pc))
235 return -EFAULT;
236
237+ save_and_clear_fpu();
238+
239 opf = (insn & VIS_OPF_MASK) >> VIS_OPF_SHIFT;
240 switch (opf) {
241 default:
242diff --git a/arch/sparc64/lib/user_fixup.c b/arch/sparc64/lib/user_fixup.c
243index 19d1fdb..05a361b 100644
244--- a/arch/sparc64/lib/user_fixup.c
245+++ b/arch/sparc64/lib/user_fixup.c
246@@ -24,7 +24,7 @@ static unsigned long compute_size(unsigned long start, unsigned long size, unsig
247 if (fault_addr < start || fault_addr >= end) {
248 *offset = 0;
249 } else {
250- *offset = start - fault_addr;
251+ *offset = fault_addr - start;
252 size = end - fault_addr;
253 }
254 return size;
255diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c
256index 19d579d..8f44ebb 100644
257--- a/arch/um/drivers/mconsole_kern.c
258+++ b/arch/um/drivers/mconsole_kern.c
259@@ -16,6 +16,8 @@
260 #include <linux/slab.h>
261 #include <linux/syscalls.h>
262 #include <linux/utsname.h>
263+#include <linux/socket.h>
264+#include <linux/un.h>
265 #include <linux/workqueue.h>
266 #include <linux/mutex.h>
267 #include <asm/uaccess.h>
268@@ -785,7 +787,7 @@ static int __init mconsole_init(void)
269 /* long to avoid size mismatch warnings from gcc */
270 long sock;
271 int err;
272- char file[256];
273+ char file[UNIX_PATH_MAX];
274
275 if (umid_file_name("mconsole", file, sizeof(file)))
276 return -1;
277diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
278index 73deaff..759e8da 100644
279--- a/arch/x86/kernel/hpet.c
280+++ b/arch/x86/kernel/hpet.c
281@@ -283,7 +283,7 @@ static int hpet_legacy_next_event(unsigned long delta,
282 * what we wrote hit the chip before we compare it to the
283 * counter.
284 */
285- WARN_ON((u32)hpet_readl(HPET_T0_CMP) != cnt);
286+ WARN_ON_ONCE((u32)hpet_readl(HPET_T0_CMP) != cnt);
287
288 return (s32)((u32)hpet_readl(HPET_COUNTER) - cnt) >= 0 ? -ETIME : 0;
289 }
290diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
291index d3746ef..1adbb3e 100644
292--- a/arch/x86/mm/init_64.c
293+++ b/arch/x86/mm/init_64.c
294@@ -721,12 +721,12 @@ int arch_add_memory(int nid, u64 start, u64 size)
295 unsigned long nr_pages = size >> PAGE_SHIFT;
296 int ret;
297
298- last_mapped_pfn = init_memory_mapping(start, start + size-1);
299+ last_mapped_pfn = init_memory_mapping(start, start + size);
300 if (last_mapped_pfn > max_pfn_mapped)
301 max_pfn_mapped = last_mapped_pfn;
302
303 ret = __add_pages(zone, start_pfn, nr_pages);
304- WARN_ON(1);
305+ WARN_ON_ONCE(ret);
306
307 return ret;
308 }
309diff --git a/block/bsg.c b/block/bsg.c
310index 0aae8d7..9cfbea8 100644
311--- a/block/bsg.c
312+++ b/block/bsg.c
313@@ -202,6 +202,8 @@ static int blk_fill_sgv4_hdr_rq(struct request_queue *q, struct request *rq,
314 rq->timeout = q->sg_timeout;
315 if (!rq->timeout)
316 rq->timeout = BLK_DEFAULT_SG_TIMEOUT;
317+ if (rq->timeout < BLK_MIN_SG_TIMEOUT)
318+ rq->timeout = BLK_MIN_SG_TIMEOUT;
319
320 return 0;
321 }
322diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
323index ec4b7f2..dd3281a 100644
324--- a/block/scsi_ioctl.c
325+++ b/block/scsi_ioctl.c
326@@ -208,6 +208,8 @@ static int blk_fill_sghdr_rq(struct request_queue *q, struct request *rq,
327 rq->timeout = q->sg_timeout;
328 if (!rq->timeout)
329 rq->timeout = BLK_DEFAULT_SG_TIMEOUT;
330+ if (rq->timeout < BLK_MIN_SG_TIMEOUT)
331+ rq->timeout = BLK_MIN_SG_TIMEOUT;
332
333 return 0;
334 }
335diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
336index 235a138..b0d40aa 100644
337--- a/drivers/acpi/osl.c
338+++ b/drivers/acpi/osl.c
339@@ -1261,34 +1261,6 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object)
340 return (AE_OK);
341 }
342
343-/**
344- * acpi_dmi_dump - dump DMI slots needed for blacklist entry
345- *
346- * Returns 0 on success
347- */
348-static int acpi_dmi_dump(void)
349-{
350-
351- if (!dmi_available)
352- return -1;
353-
354- printk(KERN_NOTICE PREFIX "DMI System Vendor: %s\n",
355- dmi_get_system_info(DMI_SYS_VENDOR));
356- printk(KERN_NOTICE PREFIX "DMI Product Name: %s\n",
357- dmi_get_system_info(DMI_PRODUCT_NAME));
358- printk(KERN_NOTICE PREFIX "DMI Product Version: %s\n",
359- dmi_get_system_info(DMI_PRODUCT_VERSION));
360- printk(KERN_NOTICE PREFIX "DMI Board Name: %s\n",
361- dmi_get_system_info(DMI_BOARD_NAME));
362- printk(KERN_NOTICE PREFIX "DMI BIOS Vendor: %s\n",
363- dmi_get_system_info(DMI_BIOS_VENDOR));
364- printk(KERN_NOTICE PREFIX "DMI BIOS Date: %s\n",
365- dmi_get_system_info(DMI_BIOS_DATE));
366-
367- return 0;
368-}
369-
370-
371 /******************************************************************************
372 *
373 * FUNCTION: acpi_os_validate_interface
374@@ -1315,14 +1287,6 @@ acpi_os_validate_interface (char *interface)
375 osi_linux.cmdline ? " via cmdline" :
376 osi_linux.dmi ? " via DMI" : "");
377
378- if (!osi_linux.dmi) {
379- if (acpi_dmi_dump())
380- printk(KERN_NOTICE PREFIX
381- "[please extract dmidecode output]\n");
382- printk(KERN_NOTICE PREFIX
383- "Please send DMI info above to "
384- "linux-acpi@vger.kernel.org\n");
385- }
386 if (!osi_linux.known && !osi_linux.cmdline) {
387 printk(KERN_NOTICE PREFIX
388 "If \"acpi_osi=%sLinux\" works better, "
389diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c
390index 4751909..3706469 100644
391--- a/drivers/acpi/sleep/main.c
392+++ b/drivers/acpi/sleep/main.c
393@@ -60,6 +60,18 @@ void __init acpi_old_suspend_ordering(void)
394 old_suspend_ordering = true;
395 }
396
397+/*
398+ * According to the ACPI specification the BIOS should make sure that ACPI is
399+ * enabled and SCI_EN bit is set on wake-up from S1 - S3 sleep states. Still,
400+ * some BIOSes don't do that and therefore we use acpi_enable() to enable ACPI
401+ * on such systems during resume. Unfortunately that doesn't help in
402+ * particularly pathological cases in which SCI_EN has to be set directly on
403+ * resume, although the specification states very clearly that this flag is
404+ * owned by the hardware. The set_sci_en_on_resume variable will be set in such
405+ * cases.
406+ */
407+static bool set_sci_en_on_resume;
408+
409 /**
410 * acpi_pm_disable_gpes - Disable the GPEs.
411 */
412@@ -201,7 +213,11 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
413 }
414
415 /* If ACPI is not enabled by the BIOS, we need to enable it here. */
416- acpi_enable();
417+ if (set_sci_en_on_resume)
418+ acpi_set_register(ACPI_BITREG_SCI_ENABLE, 1);
419+ else
420+ acpi_enable();
421+
422 /* Reprogram control registers and execute _BFS */
423 acpi_leave_sleep_state_prep(acpi_state);
424
425@@ -289,6 +305,12 @@ static int __init init_old_suspend_ordering(const struct dmi_system_id *d)
426 return 0;
427 }
428
429+static int __init init_set_sci_en_on_resume(const struct dmi_system_id *d)
430+{
431+ set_sci_en_on_resume = true;
432+ return 0;
433+}
434+
435 static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
436 {
437 .callback = init_old_suspend_ordering,
438@@ -306,6 +328,22 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
439 DMI_MATCH(DMI_PRODUCT_NAME, "HP xw4600 Workstation"),
440 },
441 },
442+ {
443+ .callback = init_set_sci_en_on_resume,
444+ .ident = "Apple MacBook 1,1",
445+ .matches = {
446+ DMI_MATCH(DMI_SYS_VENDOR, "Apple Computer, Inc."),
447+ DMI_MATCH(DMI_PRODUCT_NAME, "MacBook1,1"),
448+ },
449+ },
450+ {
451+ .callback = init_set_sci_en_on_resume,
452+ .ident = "Apple MacMini 1,1",
453+ .matches = {
454+ DMI_MATCH(DMI_SYS_VENDOR, "Apple Computer, Inc."),
455+ DMI_MATCH(DMI_PRODUCT_NAME, "Macmini1,1"),
456+ },
457+ },
458 {},
459 };
460 #endif /* CONFIG_SUSPEND */
461diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
462index 2a4c516..bb26a26 100644
463--- a/drivers/ata/libata-sff.c
464+++ b/drivers/ata/libata-sff.c
465@@ -1227,10 +1227,19 @@ fsm_start:
466 /* ATA PIO protocol */
467 if (unlikely((status & ATA_DRQ) == 0)) {
468 /* handle BSY=0, DRQ=0 as error */
469- if (likely(status & (ATA_ERR | ATA_DF)))
470+ if (likely(status & (ATA_ERR | ATA_DF))) {
471 /* device stops HSM for abort/error */
472 qc->err_mask |= AC_ERR_DEV;
473- else {
474+
475+ /* If diagnostic failed and this is
476+ * IDENTIFY, it's likely a phantom
477+ * device. Mark hint.
478+ */
479+ if (qc->dev->horkage &
480+ ATA_HORKAGE_DIAGNOSTIC)
481+ qc->err_mask |=
482+ AC_ERR_NODEV_HINT;
483+ } else {
484 /* HSM violation. Let EH handle this.
485 * Phantom devices also trigger this
486 * condition. Mark hint.
487diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
488index 31d08b6..b899d91 100644
489--- a/drivers/char/applicom.c
490+++ b/drivers/char/applicom.c
491@@ -712,8 +712,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
492
493 IndexCard = adgl->num_card-1;
494
495- if(cmd != 0 && cmd != 6 &&
496- ((IndexCard >= MAX_BOARD) || !apbs[IndexCard].RamIO)) {
497+ if(cmd != 6 && ((IndexCard >= MAX_BOARD) || !apbs[IndexCard].RamIO)) {
498 static int warncount = 10;
499 if (warncount) {
500 printk( KERN_WARNING "APPLICOM driver IOCTL, bad board number %d\n",(int)IndexCard+1);
501@@ -832,8 +831,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
502 }
503 break;
504 default:
505- printk(KERN_INFO "APPLICOM driver ioctl, unknown function code %d\n",cmd) ;
506- ret = -EINVAL;
507+ ret = -ENOTTY;
508 break;
509 }
510 Dummy = readb(apbs[IndexCard].RamIO + VERS);
511diff --git a/drivers/edac/cell_edac.c b/drivers/edac/cell_edac.c
512index 887072f..cd2e3b8 100644
513--- a/drivers/edac/cell_edac.c
514+++ b/drivers/edac/cell_edac.c
515@@ -9,6 +9,7 @@
516 */
517 #undef DEBUG
518
519+#include <linux/edac.h>
520 #include <linux/module.h>
521 #include <linux/init.h>
522 #include <linux/platform_device.h>
523@@ -164,6 +165,8 @@ static int __devinit cell_edac_probe(struct platform_device *pdev)
524 if (regs == NULL)
525 return -ENODEV;
526
527+ edac_op_state = EDAC_OPSTATE_POLL;
528+
529 /* Get channel population */
530 reg = in_be64(&regs->mic_mnt_cfg);
531 dev_dbg(&pdev->dev, "MIC_MNT_CFG = 0x%016lx\n", reg);
532diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
533index 49144cb..e87956a 100644
534--- a/drivers/hid/usbhid/hid-quirks.c
535+++ b/drivers/hid/usbhid/hid-quirks.c
536@@ -83,6 +83,7 @@
537 #define USB_DEVICE_ID_APPLE_WELLSPRING2_JIS 0x0232
538 #define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a
539 #define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b
540+#define USB_DEVICE_ID_APPLE_ATV_IRCONTROL 0x8241
541 #define USB_DEVICE_ID_APPLE_IRCONTROL4 0x8242
542
543 #define USB_VENDOR_ID_ASUS 0x0b05
544@@ -458,6 +459,7 @@ static const struct hid_blacklist {
545 { USB_VENDOR_ID_AFATECH, USB_DEVICE_ID_AFATECH_AF9016, HID_QUIRK_FULLSPEED_INTERVAL },
546
547 { USB_VENDOR_ID_BELKIN, USB_DEVICE_ID_FLIP_KVM, HID_QUIRK_HIDDEV },
548+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ATV_IRCONTROL, HID_QUIRK_HIDDEV | HID_QUIRK_IGNORE_HIDINPUT },
549 { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL4, HID_QUIRK_HIDDEV | HID_QUIRK_IGNORE_HIDINPUT },
550 { USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE, HID_QUIRK_HIDDEV | HID_QUIRK_IGNORE_HIDINPUT },
551 { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_SIDEWINDER_GV, HID_QUIRK_HIDINPUT },
552diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
553index 5aafe24..29e6863 100644
554--- a/drivers/input/serio/i8042-x86ia64io.h
555+++ b/drivers/input/serio/i8042-x86ia64io.h
556@@ -135,6 +135,14 @@ static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = {
557 DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
558 },
559 },
560+ {
561+ .ident = "Blue FB5601",
562+ .matches = {
563+ DMI_MATCH(DMI_SYS_VENDOR, "blue"),
564+ DMI_MATCH(DMI_PRODUCT_NAME, "FB5601"),
565+ DMI_MATCH(DMI_PRODUCT_VERSION, "M606"),
566+ },
567+ },
568 { }
569 };
570
571@@ -322,6 +330,27 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = {
572 DMI_MATCH(DMI_PRODUCT_NAME, "N34AS6"),
573 },
574 },
575+ {
576+ .ident = "IBM 2656",
577+ .matches = {
578+ DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
579+ DMI_MATCH(DMI_PRODUCT_NAME, "2656"),
580+ },
581+ },
582+ {
583+ .ident = "Dell XPS M1530",
584+ .matches = {
585+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
586+ DMI_MATCH(DMI_PRODUCT_NAME, "XPS M1530"),
587+ },
588+ },
589+ {
590+ .ident = "Compal HEL80I",
591+ .matches = {
592+ DMI_MATCH(DMI_SYS_VENDOR, "COMPAL"),
593+ DMI_MATCH(DMI_PRODUCT_NAME, "HEL80I"),
594+ },
595+ },
596 { }
597 };
598
599diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h
600index 2711404..b1a694b 100644
601--- a/drivers/net/cxgb3/adapter.h
602+++ b/drivers/net/cxgb3/adapter.h
603@@ -285,6 +285,7 @@ void t3_os_link_changed(struct adapter *adapter, int port_id, int link_status,
604
605 void t3_sge_start(struct adapter *adap);
606 void t3_sge_stop(struct adapter *adap);
607+void t3_stop_sge_timers(struct adapter *adap);
608 void t3_free_sge_resources(struct adapter *adap);
609 void t3_sge_err_intr_handler(struct adapter *adapter);
610 irq_handler_t t3_intr_handler(struct adapter *adap, int polling);
611diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
612index 5447f3e..d355c82 100644
613--- a/drivers/net/cxgb3/cxgb3_main.c
614+++ b/drivers/net/cxgb3/cxgb3_main.c
615@@ -479,6 +479,7 @@ static int setup_sge_qsets(struct adapter *adap)
616 irq_idx,
617 &adap->params.sge.qset[qset_idx], ntxq, dev);
618 if (err) {
619+ t3_stop_sge_timers(adap);
620 t3_free_sge_resources(adap);
621 return err;
622 }
623@@ -2449,6 +2450,9 @@ static pci_ers_result_t t3_io_error_detected(struct pci_dev *pdev,
624 test_bit(OFFLOAD_DEVMAP_BIT, &adapter->open_device_map))
625 offload_close(&adapter->tdev);
626
627+ /* Stop SGE timers */
628+ t3_stop_sge_timers(adapter);
629+
630 adapter->flags &= ~FULL_INIT_DONE;
631
632 pci_disable_device(pdev);
633@@ -2801,6 +2805,7 @@ static void __devexit remove_one(struct pci_dev *pdev)
634 if (test_bit(i, &adapter->registered_device_map))
635 unregister_netdev(adapter->port[i]);
636
637+ t3_stop_sge_timers(adapter);
638 t3_free_sge_resources(adapter);
639 cxgb_disable_msi(adapter);
640
641diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
642index 1b0861d..52f4138 100644
643--- a/drivers/net/cxgb3/sge.c
644+++ b/drivers/net/cxgb3/sge.c
645@@ -603,9 +603,6 @@ static void t3_free_qset(struct adapter *adapter, struct sge_qset *q)
646 int i;
647 struct pci_dev *pdev = adapter->pdev;
648
649- if (q->tx_reclaim_timer.function)
650- del_timer_sync(&q->tx_reclaim_timer);
651-
652 for (i = 0; i < SGE_RXQ_PER_SET; ++i)
653 if (q->fl[i].desc) {
654 spin_lock_irq(&adapter->sge.reg_lock);
655@@ -1937,38 +1934,6 @@ static inline int lro_frame_ok(const struct cpl_rx_pkt *p)
656 eh->h_proto == htons(ETH_P_IP) && ih->ihl == (sizeof(*ih) >> 2);
657 }
658
659-#define TCP_FLAG_MASK (TCP_FLAG_CWR | TCP_FLAG_ECE | TCP_FLAG_URG |\
660- TCP_FLAG_ACK | TCP_FLAG_PSH | TCP_FLAG_RST |\
661- TCP_FLAG_SYN | TCP_FLAG_FIN)
662-#define TSTAMP_WORD ((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) |\
663- (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP)
664-
665-/**
666- * lro_segment_ok - check if a TCP segment is eligible for LRO
667- * @tcph: the TCP header of the packet
668- *
669- * Returns true if a TCP packet is eligible for LRO. This requires that
670- * the packet have only the ACK flag set and no TCP options besides
671- * time stamps.
672- */
673-static inline int lro_segment_ok(const struct tcphdr *tcph)
674-{
675- int optlen;
676-
677- if (unlikely((tcp_flag_word(tcph) & TCP_FLAG_MASK) != TCP_FLAG_ACK))
678- return 0;
679-
680- optlen = (tcph->doff << 2) - sizeof(*tcph);
681- if (optlen) {
682- const u32 *opt = (const u32 *)(tcph + 1);
683-
684- if (optlen != TCPOLEN_TSTAMP_ALIGNED ||
685- *opt != htonl(TSTAMP_WORD) || !opt[2])
686- return 0;
687- }
688- return 1;
689-}
690-
691 static int t3_get_lro_header(void **eh, void **iph, void **tcph,
692 u64 *hdr_flags, void *priv)
693 {
694@@ -1981,9 +1946,6 @@ static int t3_get_lro_header(void **eh, void **iph, void **tcph,
695 *iph = (struct iphdr *)((struct ethhdr *)*eh + 1);
696 *tcph = (struct tcphdr *)((struct iphdr *)*iph + 1);
697
698- if (!lro_segment_ok(*tcph))
699- return -1;
700-
701 *hdr_flags = LRO_IPV4 | LRO_TCP;
702 return 0;
703 }
704@@ -3043,6 +3005,24 @@ err:
705 }
706
707 /**
708+ * t3_stop_sge_timers - stop SGE timer call backs
709+ * @adap: the adapter
710+ *
711+ * Stops each SGE queue set's timer call back
712+ */
713+void t3_stop_sge_timers(struct adapter *adap)
714+{
715+ int i;
716+
717+ for (i = 0; i < SGE_QSETS; ++i) {
718+ struct sge_qset *q = &adap->sge.qs[i];
719+
720+ if (q->tx_reclaim_timer.function)
721+ del_timer_sync(&q->tx_reclaim_timer);
722+ }
723+}
724+
725+/**
726 * t3_free_sge_resources - free SGE resources
727 * @adap: the adapter
728 *
729diff --git a/drivers/net/niu.c b/drivers/net/niu.c
730index e3be81e..6f9809e 100644
731--- a/drivers/net/niu.c
732+++ b/drivers/net/niu.c
733@@ -51,8 +51,7 @@ MODULE_VERSION(DRV_MODULE_VERSION);
734 #ifndef readq
735 static u64 readq(void __iomem *reg)
736 {
737- return (((u64)readl(reg + 0x4UL) << 32) |
738- (u64)readl(reg));
739+ return ((u64) readl(reg)) | (((u64) readl(reg + 4UL)) << 32);
740 }
741
742 static void writeq(u64 val, void __iomem *reg)
743diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c
744index ff175e8..de80ba4 100644
745--- a/drivers/net/pppol2tp.c
746+++ b/drivers/net/pppol2tp.c
747@@ -1353,6 +1353,7 @@ static int pppol2tp_release(struct socket *sock)
748 kfree_skb(skb);
749 sock_put(sk);
750 }
751+ sock_put(sk);
752 }
753
754 release_sock(sk);
755diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
756index 851f5b8..aa6fda1 100644
757--- a/drivers/pci/pcie/aspm.c
758+++ b/drivers/pci/pcie/aspm.c
759@@ -16,6 +16,7 @@
760 #include <linux/pm.h>
761 #include <linux/init.h>
762 #include <linux/slab.h>
763+#include <linux/jiffies.h>
764 #include <linux/pci-aspm.h>
765 #include "../pci.h"
766
767@@ -161,11 +162,12 @@ static void pcie_check_clock_pm(struct pci_dev *pdev)
768 */
769 static void pcie_aspm_configure_common_clock(struct pci_dev *pdev)
770 {
771- int pos, child_pos;
772+ int pos, child_pos, i = 0;
773 u16 reg16 = 0;
774 struct pci_dev *child_dev;
775 int same_clock = 1;
776-
777+ unsigned long start_jiffies;
778+ u16 child_regs[8], parent_reg;
779 /*
780 * all functions of a slot should have the same Slot Clock
781 * Configuration, so just check one function
782@@ -191,16 +193,19 @@ static void pcie_aspm_configure_common_clock(struct pci_dev *pdev)
783 child_pos = pci_find_capability(child_dev, PCI_CAP_ID_EXP);
784 pci_read_config_word(child_dev, child_pos + PCI_EXP_LNKCTL,
785 &reg16);
786+ child_regs[i] = reg16;
787 if (same_clock)
788 reg16 |= PCI_EXP_LNKCTL_CCC;
789 else
790 reg16 &= ~PCI_EXP_LNKCTL_CCC;
791 pci_write_config_word(child_dev, child_pos + PCI_EXP_LNKCTL,
792 reg16);
793+ i++;
794 }
795
796 /* Configure upstream component */
797 pci_read_config_word(pdev, pos + PCI_EXP_LNKCTL, &reg16);
798+ parent_reg = reg16;
799 if (same_clock)
800 reg16 |= PCI_EXP_LNKCTL_CCC;
801 else
802@@ -212,12 +217,30 @@ static void pcie_aspm_configure_common_clock(struct pci_dev *pdev)
803 pci_write_config_word(pdev, pos + PCI_EXP_LNKCTL, reg16);
804
805 /* Wait for link training end */
806- while (1) {
807+ /* break out after waiting for 1 second */
808+ start_jiffies = jiffies;
809+ while ((jiffies - start_jiffies) < HZ) {
810 pci_read_config_word(pdev, pos + PCI_EXP_LNKSTA, &reg16);
811 if (!(reg16 & PCI_EXP_LNKSTA_LT))
812 break;
813 cpu_relax();
814 }
815+ /* training failed -> recover */
816+ if ((jiffies - start_jiffies) >= HZ) {
817+ dev_printk (KERN_ERR, &pdev->dev, "ASPM: Could not configure"
818+ " common clock\n");
819+ i = 0;
820+ list_for_each_entry(child_dev, &pdev->subordinate->devices,
821+ bus_list) {
822+ child_pos = pci_find_capability(child_dev,
823+ PCI_CAP_ID_EXP);
824+ pci_write_config_word(child_dev,
825+ child_pos + PCI_EXP_LNKCTL,
826+ child_regs[i]);
827+ i++;
828+ }
829+ pci_write_config_word(pdev, pos + PCI_EXP_LNKCTL, parent_reg);
830+ }
831 }
832
833 /*
834diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c
835index b703b09..e423fd9 100644
836--- a/drivers/pci/slot.c
837+++ b/drivers/pci/slot.c
838@@ -243,6 +243,7 @@ placeholder:
839 __func__, pci_domain_nr(parent), parent->number, slot_nr);
840
841 out:
842+ kfree(slot_name);
843 up_write(&pci_bus_sem);
844 return slot;
845 err:
846diff --git a/drivers/pnp/base.h b/drivers/pnp/base.h
847index 9fd7bb9..7cc7bf5 100644
848--- a/drivers/pnp/base.h
849+++ b/drivers/pnp/base.h
850@@ -147,7 +147,7 @@ char *pnp_resource_type_name(struct resource *res);
851 void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc);
852
853 void pnp_free_resources(struct pnp_dev *dev);
854-int pnp_resource_type(struct resource *res);
855+unsigned long pnp_resource_type(struct resource *res);
856
857 struct pnp_resource {
858 struct list_head list;
859diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c
860index 0bdf9b8..d15e2b7 100644
861--- a/drivers/pnp/quirks.c
862+++ b/drivers/pnp/quirks.c
863@@ -245,7 +245,7 @@ static void quirk_system_pci_resources(struct pnp_dev *dev)
864 */
865 for_each_pci_dev(pdev) {
866 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
867- unsigned int type;
868+ unsigned long type;
869
870 type = pci_resource_flags(pdev, i) &
871 (IORESOURCE_IO | IORESOURCE_MEM);
872diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c
873index 4cfe3a1..dbae23a 100644
874--- a/drivers/pnp/resource.c
875+++ b/drivers/pnp/resource.c
876@@ -467,14 +467,14 @@ int pnp_check_dma(struct pnp_dev *dev, struct resource *res)
877 #endif
878 }
879
880-int pnp_resource_type(struct resource *res)
881+unsigned long pnp_resource_type(struct resource *res)
882 {
883 return res->flags & (IORESOURCE_IO | IORESOURCE_MEM |
884 IORESOURCE_IRQ | IORESOURCE_DMA);
885 }
886
887 struct resource *pnp_get_resource(struct pnp_dev *dev,
888- unsigned int type, unsigned int num)
889+ unsigned long type, unsigned int num)
890 {
891 struct pnp_resource *pnp_res;
892 struct resource *res;
893diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
894index e5e0cfe..bdc4d4e 100644
895--- a/drivers/spi/spidev.c
896+++ b/drivers/spi/spidev.c
897@@ -598,7 +598,9 @@ static int spidev_probe(struct spi_device *spi)
898 }
899 mutex_unlock(&device_list_lock);
900
901- if (status != 0)
902+ if (status == 0)
903+ spi_set_drvdata(spi, spidev);
904+ else
905 kfree(spidev);
906
907 return status;
908diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
909index 73f8277..b205311 100644
910--- a/drivers/usb/serial/option.c
911+++ b/drivers/usb/serial/option.c
912@@ -79,38 +79,36 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po
913 #define OPTION_PRODUCT_VIPER 0x6600
914 #define OPTION_PRODUCT_VIPER_BUS 0x6601
915 #define OPTION_PRODUCT_GT_MAX_READY 0x6701
916-#define OPTION_PRODUCT_GT_MAX 0x6711
917 #define OPTION_PRODUCT_FUJI_MODEM_LIGHT 0x6721
918 #define OPTION_PRODUCT_FUJI_MODEM_GT 0x6741
919 #define OPTION_PRODUCT_FUJI_MODEM_EX 0x6761
920-#define OPTION_PRODUCT_FUJI_NETWORK_LIGHT 0x6731
921-#define OPTION_PRODUCT_FUJI_NETWORK_GT 0x6751
922-#define OPTION_PRODUCT_FUJI_NETWORK_EX 0x6771
923 #define OPTION_PRODUCT_KOI_MODEM 0x6800
924-#define OPTION_PRODUCT_KOI_NETWORK 0x6811
925 #define OPTION_PRODUCT_SCORPION_MODEM 0x6901
926-#define OPTION_PRODUCT_SCORPION_NETWORK 0x6911
927 #define OPTION_PRODUCT_ETNA_MODEM 0x7001
928-#define OPTION_PRODUCT_ETNA_NETWORK 0x7011
929 #define OPTION_PRODUCT_ETNA_MODEM_LITE 0x7021
930 #define OPTION_PRODUCT_ETNA_MODEM_GT 0x7041
931 #define OPTION_PRODUCT_ETNA_MODEM_EX 0x7061
932-#define OPTION_PRODUCT_ETNA_NETWORK_LITE 0x7031
933-#define OPTION_PRODUCT_ETNA_NETWORK_GT 0x7051
934-#define OPTION_PRODUCT_ETNA_NETWORK_EX 0x7071
935 #define OPTION_PRODUCT_ETNA_KOI_MODEM 0x7100
936-#define OPTION_PRODUCT_ETNA_KOI_NETWORK 0x7111
937
938 #define HUAWEI_VENDOR_ID 0x12D1
939 #define HUAWEI_PRODUCT_E600 0x1001
940 #define HUAWEI_PRODUCT_E220 0x1003
941 #define HUAWEI_PRODUCT_E220BIS 0x1004
942 #define HUAWEI_PRODUCT_E1401 0x1401
943+#define HUAWEI_PRODUCT_E1402 0x1402
944 #define HUAWEI_PRODUCT_E1403 0x1403
945+#define HUAWEI_PRODUCT_E1404 0x1404
946 #define HUAWEI_PRODUCT_E1405 0x1405
947 #define HUAWEI_PRODUCT_E1406 0x1406
948+#define HUAWEI_PRODUCT_E1407 0x1407
949 #define HUAWEI_PRODUCT_E1408 0x1408
950 #define HUAWEI_PRODUCT_E1409 0x1409
951+#define HUAWEI_PRODUCT_E140A 0x140A
952+#define HUAWEI_PRODUCT_E140B 0x140B
953+#define HUAWEI_PRODUCT_E140C 0x140C
954+#define HUAWEI_PRODUCT_E140D 0x140D
955+#define HUAWEI_PRODUCT_E140E 0x140E
956+#define HUAWEI_PRODUCT_E140F 0x140F
957 #define HUAWEI_PRODUCT_E1410 0x1410
958 #define HUAWEI_PRODUCT_E1411 0x1411
959 #define HUAWEI_PRODUCT_E1412 0x1412
960@@ -121,9 +119,52 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po
961 #define HUAWEI_PRODUCT_E1417 0x1417
962 #define HUAWEI_PRODUCT_E1418 0x1418
963 #define HUAWEI_PRODUCT_E1419 0x1419
964+#define HUAWEI_PRODUCT_E141A 0x141A
965+#define HUAWEI_PRODUCT_E141B 0x141B
966+#define HUAWEI_PRODUCT_E141C 0x141C
967+#define HUAWEI_PRODUCT_E141D 0x141D
968+#define HUAWEI_PRODUCT_E141E 0x141E
969+#define HUAWEI_PRODUCT_E141F 0x141F
970+#define HUAWEI_PRODUCT_E1420 0x1420
971+#define HUAWEI_PRODUCT_E1421 0x1421
972+#define HUAWEI_PRODUCT_E1422 0x1422
973+#define HUAWEI_PRODUCT_E1423 0x1423
974+#define HUAWEI_PRODUCT_E1424 0x1424
975+#define HUAWEI_PRODUCT_E1425 0x1425
976+#define HUAWEI_PRODUCT_E1426 0x1426
977+#define HUAWEI_PRODUCT_E1427 0x1427
978+#define HUAWEI_PRODUCT_E1428 0x1428
979+#define HUAWEI_PRODUCT_E1429 0x1429
980+#define HUAWEI_PRODUCT_E142A 0x142A
981+#define HUAWEI_PRODUCT_E142B 0x142B
982+#define HUAWEI_PRODUCT_E142C 0x142C
983+#define HUAWEI_PRODUCT_E142D 0x142D
984+#define HUAWEI_PRODUCT_E142E 0x142E
985+#define HUAWEI_PRODUCT_E142F 0x142F
986+#define HUAWEI_PRODUCT_E1430 0x1430
987+#define HUAWEI_PRODUCT_E1431 0x1431
988+#define HUAWEI_PRODUCT_E1432 0x1432
989+#define HUAWEI_PRODUCT_E1433 0x1433
990+#define HUAWEI_PRODUCT_E1434 0x1434
991+#define HUAWEI_PRODUCT_E1435 0x1435
992+#define HUAWEI_PRODUCT_E1436 0x1436
993+#define HUAWEI_PRODUCT_E1437 0x1437
994+#define HUAWEI_PRODUCT_E1438 0x1438
995+#define HUAWEI_PRODUCT_E1439 0x1439
996+#define HUAWEI_PRODUCT_E143A 0x143A
997+#define HUAWEI_PRODUCT_E143B 0x143B
998+#define HUAWEI_PRODUCT_E143C 0x143C
999+#define HUAWEI_PRODUCT_E143D 0x143D
1000+#define HUAWEI_PRODUCT_E143E 0x143E
1001+#define HUAWEI_PRODUCT_E143F 0x143F
1002
1003 #define NOVATELWIRELESS_VENDOR_ID 0x1410
1004
1005+/* YISO PRODUCTS */
1006+
1007+#define YISO_VENDOR_ID 0x0EAB
1008+#define YISO_PRODUCT_U893 0xC893
1009+
1010 /* MERLIN EVDO PRODUCTS */
1011 #define NOVATELWIRELESS_PRODUCT_V640 0x1100
1012 #define NOVATELWIRELESS_PRODUCT_V620 0x1110
1013@@ -183,6 +224,7 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po
1014 #define ONDA_VENDOR_ID 0x19d2
1015 #define ONDA_PRODUCT_MSA501HS 0x0001
1016 #define ONDA_PRODUCT_ET502HS 0x0002
1017+#define ONDA_PRODUCT_MT503HS 0x0200
1018
1019 #define BANDRICH_VENDOR_ID 0x1A8D
1020 #define BANDRICH_PRODUCT_C100_1 0x1002
1021@@ -218,8 +260,19 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po
1022 /* ZTE PRODUCTS */
1023 #define ZTE_VENDOR_ID 0x19d2
1024 #define ZTE_PRODUCT_MF628 0x0015
1025+#define ZTE_PRODUCT_MF626 0x0031
1026 #define ZTE_PRODUCT_CDMA_TECH 0xfffe
1027
1028+/* Ericsson products */
1029+#define ERICSSON_VENDOR_ID 0x0bdb
1030+#define ERICSSON_PRODUCT_F3507G 0x1900
1031+
1032+/* Pantech products */
1033+#define PANTECH_VENDOR_ID 0x106c
1034+#define PANTECH_PRODUCT_PC5740 0x3701
1035+#define PANTECH_PRODUCT_PC5750 0x3702 /* PX-500 */
1036+#define PANTECH_PRODUCT_UM150 0x3711
1037+
1038 static struct usb_device_id option_ids[] = {
1039 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
1040 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
1041@@ -235,36 +288,34 @@ static struct usb_device_id option_ids[] = {
1042 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_VIPER) },
1043 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_VIPER_BUS) },
1044 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_GT_MAX_READY) },
1045- { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_GT_MAX) },
1046 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUJI_MODEM_LIGHT) },
1047 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUJI_MODEM_GT) },
1048 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUJI_MODEM_EX) },
1049- { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUJI_NETWORK_LIGHT) },
1050- { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUJI_NETWORK_GT) },
1051- { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUJI_NETWORK_EX) },
1052 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_KOI_MODEM) },
1053- { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_KOI_NETWORK) },
1054 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_SCORPION_MODEM) },
1055- { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_SCORPION_NETWORK) },
1056 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_MODEM) },
1057- { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_NETWORK) },
1058 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_MODEM_LITE) },
1059 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_MODEM_GT) },
1060 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_MODEM_EX) },
1061- { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_NETWORK_LITE) },
1062- { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_NETWORK_GT) },
1063- { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_NETWORK_EX) },
1064 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_MODEM) },
1065- { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_NETWORK) },
1066 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600, 0xff, 0xff, 0xff) },
1067 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220, 0xff, 0xff, 0xff) },
1068 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220BIS, 0xff, 0xff, 0xff) },
1069 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1401, 0xff, 0xff, 0xff) },
1070+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1402, 0xff, 0xff, 0xff) },
1071 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1403, 0xff, 0xff, 0xff) },
1072+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1404, 0xff, 0xff, 0xff) },
1073 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1405, 0xff, 0xff, 0xff) },
1074 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1406, 0xff, 0xff, 0xff) },
1075+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1407, 0xff, 0xff, 0xff) },
1076 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1408, 0xff, 0xff, 0xff) },
1077 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1409, 0xff, 0xff, 0xff) },
1078+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E140A, 0xff, 0xff, 0xff) },
1079+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E140B, 0xff, 0xff, 0xff) },
1080+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E140C, 0xff, 0xff, 0xff) },
1081+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E140D, 0xff, 0xff, 0xff) },
1082+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E140E, 0xff, 0xff, 0xff) },
1083+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E140F, 0xff, 0xff, 0xff) },
1084 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1410, 0xff, 0xff, 0xff) },
1085 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1411, 0xff, 0xff, 0xff) },
1086 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1412, 0xff, 0xff, 0xff) },
1087@@ -275,6 +326,44 @@ static struct usb_device_id option_ids[] = {
1088 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1417, 0xff, 0xff, 0xff) },
1089 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1418, 0xff, 0xff, 0xff) },
1090 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1419, 0xff, 0xff, 0xff) },
1091+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E141A, 0xff, 0xff, 0xff) },
1092+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E141B, 0xff, 0xff, 0xff) },
1093+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E141C, 0xff, 0xff, 0xff) },
1094+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E141D, 0xff, 0xff, 0xff) },
1095+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E141E, 0xff, 0xff, 0xff) },
1096+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E141F, 0xff, 0xff, 0xff) },
1097+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1420, 0xff, 0xff, 0xff) },
1098+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1421, 0xff, 0xff, 0xff) },
1099+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1422, 0xff, 0xff, 0xff) },
1100+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1423, 0xff, 0xff, 0xff) },
1101+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1424, 0xff, 0xff, 0xff) },
1102+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1425, 0xff, 0xff, 0xff) },
1103+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1426, 0xff, 0xff, 0xff) },
1104+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1427, 0xff, 0xff, 0xff) },
1105+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1428, 0xff, 0xff, 0xff) },
1106+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1429, 0xff, 0xff, 0xff) },
1107+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E142A, 0xff, 0xff, 0xff) },
1108+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E142B, 0xff, 0xff, 0xff) },
1109+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E142C, 0xff, 0xff, 0xff) },
1110+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E142D, 0xff, 0xff, 0xff) },
1111+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E142E, 0xff, 0xff, 0xff) },
1112+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E142F, 0xff, 0xff, 0xff) },
1113+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1430, 0xff, 0xff, 0xff) },
1114+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1431, 0xff, 0xff, 0xff) },
1115+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1432, 0xff, 0xff, 0xff) },
1116+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1433, 0xff, 0xff, 0xff) },
1117+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1434, 0xff, 0xff, 0xff) },
1118+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1435, 0xff, 0xff, 0xff) },
1119+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1436, 0xff, 0xff, 0xff) },
1120+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1437, 0xff, 0xff, 0xff) },
1121+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1438, 0xff, 0xff, 0xff) },
1122+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E1439, 0xff, 0xff, 0xff) },
1123+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143A, 0xff, 0xff, 0xff) },
1124+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143B, 0xff, 0xff, 0xff) },
1125+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143C, 0xff, 0xff, 0xff) },
1126+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143D, 0xff, 0xff, 0xff) },
1127+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143E, 0xff, 0xff, 0xff) },
1128+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143F, 0xff, 0xff, 0xff) },
1129 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_9508) },
1130 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) }, /* Novatel Merlin V640/XV620 */
1131 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V620) }, /* Novatel Merlin V620/S620 */
1132@@ -318,12 +407,48 @@ static struct usb_device_id option_ids[] = {
1133 { USB_DEVICE(DELL_VENDOR_ID, 0x8136) }, /* Dell Wireless HSDPA 5520 == Novatel Expedite EU860D */
1134 { USB_DEVICE(DELL_VENDOR_ID, 0x8137) }, /* Dell Wireless HSDPA 5520 */
1135 { USB_DEVICE(DELL_VENDOR_ID, 0x8138) }, /* Dell Wireless 5520 Voda I Mobile Broadband (3G HSDPA) Minicard */
1136- { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) },
1137+ { USB_DEVICE(DELL_VENDOR_ID, 0x8147) }, /* Dell Wireless 5530 Mobile Broadband (3G HSPA) Mini-Card */
1138+ { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, /* ADU-E100, ADU-310 */
1139 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) },
1140 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) },
1141 { USB_DEVICE(AXESSTEL_VENDOR_ID, AXESSTEL_PRODUCT_MV110H) },
1142 { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_MSA501HS) },
1143 { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_ET502HS) },
1144+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0003) },
1145+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0004) },
1146+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0005) },
1147+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0006) },
1148+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0007) },
1149+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0008) },
1150+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0009) },
1151+ { USB_DEVICE(ONDA_VENDOR_ID, 0x000a) },
1152+ { USB_DEVICE(ONDA_VENDOR_ID, 0x000b) },
1153+ { USB_DEVICE(ONDA_VENDOR_ID, 0x000c) },
1154+ { USB_DEVICE(ONDA_VENDOR_ID, 0x000d) },
1155+ { USB_DEVICE(ONDA_VENDOR_ID, 0x000e) },
1156+ { USB_DEVICE(ONDA_VENDOR_ID, 0x000f) },
1157+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0010) },
1158+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0011) },
1159+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0012) },
1160+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0013) },
1161+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0014) },
1162+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0015) },
1163+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0016) },
1164+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0017) },
1165+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0018) },
1166+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0019) },
1167+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0020) },
1168+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0021) },
1169+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0022) },
1170+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0023) },
1171+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0024) },
1172+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0025) },
1173+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0026) },
1174+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0027) },
1175+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0028) },
1176+ { USB_DEVICE(ONDA_VENDOR_ID, 0x0029) },
1177+ { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_MT503HS) },
1178+ { USB_DEVICE(YISO_VENDOR_ID, YISO_PRODUCT_U893) },
1179 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) },
1180 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) },
1181 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1004) },
1182@@ -347,8 +472,13 @@ static struct usb_device_id option_ids[] = {
1183 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */
1184 { USB_DEVICE(MAXON_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */
1185 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) },
1186+ { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF626) },
1187 { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628) },
1188 { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH) },
1189+ { USB_DEVICE(ERICSSON_VENDOR_ID, ERICSSON_PRODUCT_F3507G) },
1190+ { USB_DEVICE(PANTECH_VENDOR_ID, PANTECH_PRODUCT_PC5740) },
1191+ { USB_DEVICE(PANTECH_VENDOR_ID, PANTECH_PRODUCT_PC5750) },
1192+ { USB_DEVICE(PANTECH_VENDOR_ID, PANTECH_PRODUCT_UM150) },
1193 { } /* Terminating entry */
1194 };
1195 MODULE_DEVICE_TABLE(usb, option_ids);
1196diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
1197index ccebf89..e61f2bf 100644
1198--- a/drivers/usb/storage/unusual_devs.h
1199+++ b/drivers/usb/storage/unusual_devs.h
1200@@ -167,6 +167,13 @@ UNUSUAL_DEV( 0x0421, 0x005d, 0x0001, 0x0600,
1201 US_SC_DEVICE, US_PR_DEVICE, NULL,
1202 US_FL_FIX_CAPACITY ),
1203
1204+/* Patch for Nokia 5310 capacity */
1205+UNUSUAL_DEV( 0x0421, 0x006a, 0x0000, 0x0591,
1206+ "Nokia",
1207+ "5310",
1208+ US_SC_DEVICE, US_PR_DEVICE, NULL,
1209+ US_FL_FIX_CAPACITY ),
1210+
1211 /* Reported by Mario Rettig <mariorettig@web.de> */
1212 UNUSUAL_DEV( 0x0421, 0x042e, 0x0100, 0x0100,
1213 "Nokia",
1214@@ -233,14 +240,14 @@ UNUSUAL_DEV( 0x0421, 0x0495, 0x0370, 0x0370,
1215 US_FL_MAX_SECTORS_64 ),
1216
1217 /* Reported by Cedric Godin <cedric@belbone.be> */
1218-UNUSUAL_DEV( 0x0421, 0x04b9, 0x0551, 0x0551,
1219+UNUSUAL_DEV( 0x0421, 0x04b9, 0x0500, 0x0551,
1220 "Nokia",
1221 "5300",
1222 US_SC_DEVICE, US_PR_DEVICE, NULL,
1223 US_FL_FIX_CAPACITY ),
1224
1225 /* Reported by Richard Nauber <RichardNauber@web.de> */
1226-UNUSUAL_DEV( 0x0421, 0x04fa, 0x0601, 0x0601,
1227+UNUSUAL_DEV( 0x0421, 0x04fa, 0x0550, 0x0660,
1228 "Nokia",
1229 "6300",
1230 US_SC_DEVICE, US_PR_DEVICE, NULL,
1231@@ -253,6 +260,14 @@ UNUSUAL_DEV( 0x0421, 0x006a, 0x0000, 0x0591,
1232 US_SC_DEVICE, US_PR_DEVICE, NULL,
1233 US_FL_FIX_CAPACITY ),
1234
1235+/* Submitted by Ricky Wong Yung Fei <evilbladewarrior@gmail.com> */
1236+/* Nokia 7610 Supernova - Too many sectors reported in usb storage mode */
1237+UNUSUAL_DEV( 0x0421, 0x00f5, 0x0000, 0x0470,
1238+ "Nokia",
1239+ "7610 Supernova",
1240+ US_SC_DEVICE, US_PR_DEVICE, NULL,
1241+ US_FL_FIX_CAPACITY ),
1242+
1243 /* Reported by Olaf Hering <olh@suse.de> from novell bug #105878 */
1244 UNUSUAL_DEV( 0x0424, 0x0fdc, 0x0210, 0x0210,
1245 "SMSC",
1246@@ -303,6 +318,18 @@ UNUSUAL_DEV( 0x045a, 0x5210, 0x0101, 0x0101,
1247 US_SC_SCSI, US_PR_KARMA, rio_karma_init, 0),
1248 #endif
1249
1250+/* Reported by Tamas Kerecsen <kerecsen@bigfoot.com>
1251+ * Obviously the PROM has not been customized by the VAR;
1252+ * the Vendor and Product string descriptors are:
1253+ * Generic Mass Storage (PROTOTYPE--Remember to change idVendor)
1254+ * Generic Manufacturer (PROTOTYPE--Remember to change idVendor)
1255+ */
1256+UNUSUAL_DEV( 0x045e, 0xffff, 0x0000, 0x0000,
1257+ "Mitac",
1258+ "GPS",
1259+ US_SC_DEVICE, US_PR_DEVICE, NULL,
1260+ US_FL_MAX_SECTORS_64 ),
1261+
1262 /*
1263 * This virtual floppy is found in Sun equipment (x4600, x4200m2, etc.)
1264 * Reported by Pete Zaitcev <zaitcev@redhat.com>
1265@@ -333,6 +360,13 @@ UNUSUAL_DEV( 0x0482, 0x0103, 0x0100, 0x0100,
1266 "Finecam S5",
1267 US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_INQUIRY),
1268
1269+/* Patch submitted by Jens Taprogge <jens.taprogge@taprogge.org> */
1270+UNUSUAL_DEV( 0x0482, 0x0107, 0x0100, 0x0100,
1271+ "Kyocera",
1272+ "CONTAX SL300R T*",
1273+ US_SC_DEVICE, US_PR_DEVICE, NULL,
1274+ US_FL_FIX_CAPACITY | US_FL_NOT_LOCKABLE),
1275+
1276 /* Reported by Paul Stewart <stewart@wetlogic.net>
1277 * This entry is needed because the device reports Sub=ff */
1278 UNUSUAL_DEV( 0x04a4, 0x0004, 0x0001, 0x0001,
1279@@ -355,6 +389,13 @@ UNUSUAL_DEV( 0x04b0, 0x0401, 0x0200, 0x0200,
1280 US_SC_DEVICE, US_PR_DEVICE, NULL,
1281 US_FL_FIX_CAPACITY),
1282
1283+/* Reported by Tobias Kunze Briseno <t-linux@fictive.com> */
1284+UNUSUAL_DEV( 0x04b0, 0x0403, 0x0200, 0x0200,
1285+ "NIKON",
1286+ "NIKON DSC D2H",
1287+ US_SC_DEVICE, US_PR_DEVICE, NULL,
1288+ US_FL_FIX_CAPACITY),
1289+
1290 /* Reported by Milinevsky Dmitry <niam.niam@gmail.com> */
1291 UNUSUAL_DEV( 0x04b0, 0x0409, 0x0100, 0x0100,
1292 "NIKON",
1293@@ -411,6 +452,13 @@ UNUSUAL_DEV( 0x04b0, 0x0417, 0x0100, 0x0100,
1294 US_SC_DEVICE, US_PR_DEVICE, NULL,
1295 US_FL_FIX_CAPACITY),
1296
1297+/* Reported by paul ready <lxtwin@homecall.co.uk> */
1298+UNUSUAL_DEV( 0x04b0, 0x0419, 0x0100, 0x0200,
1299+ "NIKON",
1300+ "NIKON DSC D300",
1301+ US_SC_DEVICE, US_PR_DEVICE, NULL,
1302+ US_FL_FIX_CAPACITY),
1303+
1304 /* Reported by Doug Maxey (dwm@austin.ibm.com) */
1305 UNUSUAL_DEV( 0x04b3, 0x4001, 0x0110, 0x0110,
1306 "IBM",
1307@@ -1635,97 +1683,332 @@ UNUSUAL_DEV( 0x1210, 0x0003, 0x0100, 0x0100,
1308 /* Reported by fangxiaozhi <huananhu@huawei.com>
1309 * This brings the HUAWEI data card devices into multi-port mode
1310 */
1311-UNUSUAL_DEV( 0x12d1, 0x1001, 0x0000, 0x0000,
1312+UNUSUAL_DEV( 0x12d1, 0x1001, 0x0000, 0x0000,
1313+ "HUAWEI MOBILE",
1314+ "Mass Storage",
1315+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1316+ 0),
1317+UNUSUAL_DEV( 0x12d1, 0x1003, 0x0000, 0x0000,
1318+ "HUAWEI MOBILE",
1319+ "Mass Storage",
1320+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1321+ 0),
1322+UNUSUAL_DEV( 0x12d1, 0x1004, 0x0000, 0x0000,
1323+ "HUAWEI MOBILE",
1324+ "Mass Storage",
1325+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1326+ 0),
1327+UNUSUAL_DEV( 0x12d1, 0x1401, 0x0000, 0x0000,
1328+ "HUAWEI MOBILE",
1329+ "Mass Storage",
1330+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1331+ 0),
1332+UNUSUAL_DEV( 0x12d1, 0x1402, 0x0000, 0x0000,
1333+ "HUAWEI MOBILE",
1334+ "Mass Storage",
1335+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1336+ 0),
1337+UNUSUAL_DEV( 0x12d1, 0x1403, 0x0000, 0x0000,
1338+ "HUAWEI MOBILE",
1339+ "Mass Storage",
1340+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1341+ 0),
1342+UNUSUAL_DEV( 0x12d1, 0x1404, 0x0000, 0x0000,
1343+ "HUAWEI MOBILE",
1344+ "Mass Storage",
1345+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1346+ 0),
1347+UNUSUAL_DEV( 0x12d1, 0x1405, 0x0000, 0x0000,
1348+ "HUAWEI MOBILE",
1349+ "Mass Storage",
1350+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1351+ 0),
1352+UNUSUAL_DEV( 0x12d1, 0x1406, 0x0000, 0x0000,
1353+ "HUAWEI MOBILE",
1354+ "Mass Storage",
1355+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1356+ 0),
1357+UNUSUAL_DEV( 0x12d1, 0x1407, 0x0000, 0x0000,
1358+ "HUAWEI MOBILE",
1359+ "Mass Storage",
1360+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1361+ 0),
1362+UNUSUAL_DEV( 0x12d1, 0x1408, 0x0000, 0x0000,
1363+ "HUAWEI MOBILE",
1364+ "Mass Storage",
1365+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1366+ 0),
1367+UNUSUAL_DEV( 0x12d1, 0x1409, 0x0000, 0x0000,
1368+ "HUAWEI MOBILE",
1369+ "Mass Storage",
1370+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1371+ 0),
1372+UNUSUAL_DEV( 0x12d1, 0x140A, 0x0000, 0x0000,
1373+ "HUAWEI MOBILE",
1374+ "Mass Storage",
1375+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1376+ 0),
1377+UNUSUAL_DEV( 0x12d1, 0x140B, 0x0000, 0x0000,
1378+ "HUAWEI MOBILE",
1379+ "Mass Storage",
1380+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1381+ 0),
1382+UNUSUAL_DEV( 0x12d1, 0x140C, 0x0000, 0x0000,
1383+ "HUAWEI MOBILE",
1384+ "Mass Storage",
1385+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1386+ 0),
1387+UNUSUAL_DEV( 0x12d1, 0x140D, 0x0000, 0x0000,
1388+ "HUAWEI MOBILE",
1389+ "Mass Storage",
1390+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1391+ 0),
1392+UNUSUAL_DEV( 0x12d1, 0x140E, 0x0000, 0x0000,
1393+ "HUAWEI MOBILE",
1394+ "Mass Storage",
1395+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1396+ 0),
1397+UNUSUAL_DEV( 0x12d1, 0x140F, 0x0000, 0x0000,
1398+ "HUAWEI MOBILE",
1399+ "Mass Storage",
1400+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1401+ 0),
1402+UNUSUAL_DEV( 0x12d1, 0x1410, 0x0000, 0x0000,
1403+ "HUAWEI MOBILE",
1404+ "Mass Storage",
1405+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1406+ 0),
1407+UNUSUAL_DEV( 0x12d1, 0x1411, 0x0000, 0x0000,
1408+ "HUAWEI MOBILE",
1409+ "Mass Storage",
1410+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1411+ 0),
1412+UNUSUAL_DEV( 0x12d1, 0x1412, 0x0000, 0x0000,
1413+ "HUAWEI MOBILE",
1414+ "Mass Storage",
1415+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1416+ 0),
1417+UNUSUAL_DEV( 0x12d1, 0x1413, 0x0000, 0x0000,
1418+ "HUAWEI MOBILE",
1419+ "Mass Storage",
1420+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1421+ 0),
1422+UNUSUAL_DEV( 0x12d1, 0x1414, 0x0000, 0x0000,
1423+ "HUAWEI MOBILE",
1424+ "Mass Storage",
1425+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1426+ 0),
1427+UNUSUAL_DEV( 0x12d1, 0x1415, 0x0000, 0x0000,
1428+ "HUAWEI MOBILE",
1429+ "Mass Storage",
1430+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1431+ 0),
1432+UNUSUAL_DEV( 0x12d1, 0x1416, 0x0000, 0x0000,
1433+ "HUAWEI MOBILE",
1434+ "Mass Storage",
1435+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1436+ 0),
1437+UNUSUAL_DEV( 0x12d1, 0x1417, 0x0000, 0x0000,
1438+ "HUAWEI MOBILE",
1439+ "Mass Storage",
1440+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1441+ 0),
1442+UNUSUAL_DEV( 0x12d1, 0x1418, 0x0000, 0x0000,
1443+ "HUAWEI MOBILE",
1444+ "Mass Storage",
1445+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1446+ 0),
1447+UNUSUAL_DEV( 0x12d1, 0x1419, 0x0000, 0x0000,
1448+ "HUAWEI MOBILE",
1449+ "Mass Storage",
1450+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1451+ 0),
1452+UNUSUAL_DEV( 0x12d1, 0x141A, 0x0000, 0x0000,
1453+ "HUAWEI MOBILE",
1454+ "Mass Storage",
1455+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1456+ 0),
1457+UNUSUAL_DEV( 0x12d1, 0x141B, 0x0000, 0x0000,
1458+ "HUAWEI MOBILE",
1459+ "Mass Storage",
1460+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1461+ 0),
1462+UNUSUAL_DEV( 0x12d1, 0x141C, 0x0000, 0x0000,
1463+ "HUAWEI MOBILE",
1464+ "Mass Storage",
1465+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1466+ 0),
1467+UNUSUAL_DEV( 0x12d1, 0x141D, 0x0000, 0x0000,
1468+ "HUAWEI MOBILE",
1469+ "Mass Storage",
1470+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1471+ 0),
1472+UNUSUAL_DEV( 0x12d1, 0x141E, 0x0000, 0x0000,
1473+ "HUAWEI MOBILE",
1474+ "Mass Storage",
1475+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1476+ 0),
1477+UNUSUAL_DEV( 0x12d1, 0x141F, 0x0000, 0x0000,
1478+ "HUAWEI MOBILE",
1479+ "Mass Storage",
1480+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1481+ 0),
1482+UNUSUAL_DEV( 0x12d1, 0x1420, 0x0000, 0x0000,
1483+ "HUAWEI MOBILE",
1484+ "Mass Storage",
1485+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1486+ 0),
1487+UNUSUAL_DEV( 0x12d1, 0x1421, 0x0000, 0x0000,
1488+ "HUAWEI MOBILE",
1489+ "Mass Storage",
1490+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1491+ 0),
1492+UNUSUAL_DEV( 0x12d1, 0x1422, 0x0000, 0x0000,
1493+ "HUAWEI MOBILE",
1494+ "Mass Storage",
1495+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1496+ 0),
1497+UNUSUAL_DEV( 0x12d1, 0x1423, 0x0000, 0x0000,
1498+ "HUAWEI MOBILE",
1499+ "Mass Storage",
1500+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1501+ 0),
1502+UNUSUAL_DEV( 0x12d1, 0x1424, 0x0000, 0x0000,
1503+ "HUAWEI MOBILE",
1504+ "Mass Storage",
1505+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1506+ 0),
1507+UNUSUAL_DEV( 0x12d1, 0x1425, 0x0000, 0x0000,
1508+ "HUAWEI MOBILE",
1509+ "Mass Storage",
1510+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1511+ 0),
1512+UNUSUAL_DEV( 0x12d1, 0x1426, 0x0000, 0x0000,
1513+ "HUAWEI MOBILE",
1514+ "Mass Storage",
1515+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1516+ 0),
1517+UNUSUAL_DEV( 0x12d1, 0x1427, 0x0000, 0x0000,
1518 "HUAWEI MOBILE",
1519 "Mass Storage",
1520 US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1521 0),
1522-UNUSUAL_DEV( 0x12d1, 0x1003, 0x0000, 0x0000,
1523+UNUSUAL_DEV( 0x12d1, 0x1428, 0x0000, 0x0000,
1524 "HUAWEI MOBILE",
1525 "Mass Storage",
1526 US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1527 0),
1528-UNUSUAL_DEV( 0x12d1, 0x1004, 0x0000, 0x0000,
1529+UNUSUAL_DEV( 0x12d1, 0x1429, 0x0000, 0x0000,
1530 "HUAWEI MOBILE",
1531 "Mass Storage",
1532 US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1533 0),
1534-UNUSUAL_DEV( 0x12d1, 0x1401, 0x0000, 0x0000,
1535+UNUSUAL_DEV( 0x12d1, 0x142A, 0x0000, 0x0000,
1536 "HUAWEI MOBILE",
1537 "Mass Storage",
1538 US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1539 0),
1540-UNUSUAL_DEV( 0x12d1, 0x1403, 0x0000, 0x0000,
1541+UNUSUAL_DEV( 0x12d1, 0x142B, 0x0000, 0x0000,
1542 "HUAWEI MOBILE",
1543 "Mass Storage",
1544 US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1545 0),
1546-UNUSUAL_DEV( 0x12d1, 0x1405, 0x0000, 0x0000,
1547+UNUSUAL_DEV( 0x12d1, 0x142C, 0x0000, 0x0000,
1548 "HUAWEI MOBILE",
1549 "Mass Storage",
1550 US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1551 0),
1552-UNUSUAL_DEV( 0x12d1, 0x1406, 0x0000, 0x0000,
1553+UNUSUAL_DEV( 0x12d1, 0x142D, 0x0000, 0x0000,
1554 "HUAWEI MOBILE",
1555 "Mass Storage",
1556 US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1557 0),
1558-UNUSUAL_DEV( 0x12d1, 0x1408, 0x0000, 0x0000,
1559+UNUSUAL_DEV( 0x12d1, 0x142E, 0x0000, 0x0000,
1560 "HUAWEI MOBILE",
1561 "Mass Storage",
1562 US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1563 0),
1564-UNUSUAL_DEV( 0x12d1, 0x1409, 0x0000, 0x0000,
1565+UNUSUAL_DEV( 0x12d1, 0x142F, 0x0000, 0x0000,
1566 "HUAWEI MOBILE",
1567 "Mass Storage",
1568 US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1569 0),
1570-UNUSUAL_DEV( 0x12d1, 0x1410, 0x0000, 0x0000,
1571+UNUSUAL_DEV( 0x12d1, 0x1430, 0x0000, 0x0000,
1572 "HUAWEI MOBILE",
1573 "Mass Storage",
1574 US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1575 0),
1576-UNUSUAL_DEV( 0x12d1, 0x1411, 0x0000, 0x0000,
1577+UNUSUAL_DEV( 0x12d1, 0x1431, 0x0000, 0x0000,
1578 "HUAWEI MOBILE",
1579 "Mass Storage",
1580 US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1581 0),
1582-UNUSUAL_DEV( 0x12d1, 0x1412, 0x0000, 0x0000,
1583+UNUSUAL_DEV( 0x12d1, 0x1432, 0x0000, 0x0000,
1584 "HUAWEI MOBILE",
1585 "Mass Storage",
1586 US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1587 0),
1588-UNUSUAL_DEV( 0x12d1, 0x1413, 0x0000, 0x0000,
1589+UNUSUAL_DEV( 0x12d1, 0x1433, 0x0000, 0x0000,
1590 "HUAWEI MOBILE",
1591 "Mass Storage",
1592 US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1593 0),
1594-UNUSUAL_DEV( 0x12d1, 0x1414, 0x0000, 0x0000,
1595+UNUSUAL_DEV( 0x12d1, 0x1434, 0x0000, 0x0000,
1596 "HUAWEI MOBILE",
1597 "Mass Storage",
1598 US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1599 0),
1600-UNUSUAL_DEV( 0x12d1, 0x1415, 0x0000, 0x0000,
1601+UNUSUAL_DEV( 0x12d1, 0x1435, 0x0000, 0x0000,
1602 "HUAWEI MOBILE",
1603 "Mass Storage",
1604 US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1605 0),
1606-UNUSUAL_DEV( 0x12d1, 0x1416, 0x0000, 0x0000,
1607+UNUSUAL_DEV( 0x12d1, 0x1436, 0x0000, 0x0000,
1608 "HUAWEI MOBILE",
1609 "Mass Storage",
1610 US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1611 0),
1612-UNUSUAL_DEV( 0x12d1, 0x1417, 0x0000, 0x0000,
1613+UNUSUAL_DEV( 0x12d1, 0x1437, 0x0000, 0x0000,
1614 "HUAWEI MOBILE",
1615 "Mass Storage",
1616 US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1617 0),
1618-UNUSUAL_DEV( 0x12d1, 0x1418, 0x0000, 0x0000,
1619+UNUSUAL_DEV( 0x12d1, 0x1438, 0x0000, 0x0000,
1620 "HUAWEI MOBILE",
1621 "Mass Storage",
1622 US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1623 0),
1624-UNUSUAL_DEV( 0x12d1, 0x1419, 0x0000, 0x0000,
1625+UNUSUAL_DEV( 0x12d1, 0x1439, 0x0000, 0x0000,
1626+ "HUAWEI MOBILE",
1627+ "Mass Storage",
1628+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1629+ 0),
1630+UNUSUAL_DEV( 0x12d1, 0x143A, 0x0000, 0x0000,
1631+ "HUAWEI MOBILE",
1632+ "Mass Storage",
1633+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1634+ 0),
1635+UNUSUAL_DEV( 0x12d1, 0x143B, 0x0000, 0x0000,
1636+ "HUAWEI MOBILE",
1637+ "Mass Storage",
1638+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1639+ 0),
1640+UNUSUAL_DEV( 0x12d1, 0x143C, 0x0000, 0x0000,
1641+ "HUAWEI MOBILE",
1642+ "Mass Storage",
1643+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1644+ 0),
1645+UNUSUAL_DEV( 0x12d1, 0x143D, 0x0000, 0x0000,
1646+ "HUAWEI MOBILE",
1647+ "Mass Storage",
1648+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1649+ 0),
1650+UNUSUAL_DEV( 0x12d1, 0x143E, 0x0000, 0x0000,
1651+ "HUAWEI MOBILE",
1652+ "Mass Storage",
1653+ US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1654+ 0),
1655+UNUSUAL_DEV( 0x12d1, 0x143F, 0x0000, 0x0000,
1656 "HUAWEI MOBILE",
1657 "Mass Storage",
1658 US_SC_DEVICE, US_PR_DEVICE, usb_stor_huawei_e220_init,
1659@@ -1834,6 +2117,15 @@ UNUSUAL_DEV( 0x2770, 0x915d, 0x0010, 0x0010,
1660 US_SC_DEVICE, US_PR_DEVICE, NULL,
1661 US_FL_FIX_CAPACITY ),
1662
1663+/* Reported by Frederic Marchal <frederic.marchal@wowcompany.com>
1664+ * Mio Moov 330
1665+ */
1666+UNUSUAL_DEV( 0x3340, 0xffff, 0x0000, 0x0000,
1667+ "Mitac",
1668+ "Mio DigiWalker USB Sync",
1669+ US_SC_DEVICE,US_PR_DEVICE,NULL,
1670+ US_FL_MAX_SECTORS_64 ),
1671+
1672 /* Reported by Andrey Rahmatullin <wrar@altlinux.org> */
1673 UNUSUAL_DEV( 0x4102, 0x1020, 0x0100, 0x0100,
1674 "iRiver",
1675diff --git a/drivers/watchdog/ib700wdt.c b/drivers/watchdog/ib700wdt.c
1676index 05a2810..8782ec1 100644
1677--- a/drivers/watchdog/ib700wdt.c
1678+++ b/drivers/watchdog/ib700wdt.c
1679@@ -154,7 +154,7 @@ static int ibwdt_set_heartbeat(int t)
1680 return -EINVAL;
1681
1682 for (i = 0x0F; i > -1; i--)
1683- if (wd_times[i] > t)
1684+ if (wd_times[i] >= t)
1685 break;
1686 wd_margin = i;
1687 return 0;
1688diff --git a/fs/binfmt_em86.c b/fs/binfmt_em86.c
1689index f9c88d0..32fb00b 100644
1690--- a/fs/binfmt_em86.c
1691+++ b/fs/binfmt_em86.c
1692@@ -43,7 +43,7 @@ static int load_em86(struct linux_binprm *bprm,struct pt_regs *regs)
1693 return -ENOEXEC;
1694 }
1695
1696- bprm->sh_bang = 1; /* Well, the bang-shell is implicit... */
1697+ bprm->recursion_depth++; /* Well, the bang-shell is implicit... */
1698 allow_write_access(bprm->file);
1699 fput(bprm->file);
1700 bprm->file = NULL;
1701diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
1702index 8d7e88e..f2744ab 100644
1703--- a/fs/binfmt_misc.c
1704+++ b/fs/binfmt_misc.c
1705@@ -117,7 +117,7 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)
1706 goto _ret;
1707
1708 retval = -ENOEXEC;
1709- if (bprm->misc_bang)
1710+ if (bprm->recursion_depth > BINPRM_MAX_RECURSION)
1711 goto _ret;
1712
1713 /* to keep locking time low, we copy the interpreter string */
1714@@ -197,7 +197,7 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)
1715 if (retval < 0)
1716 goto _error;
1717
1718- bprm->misc_bang = 1;
1719+ bprm->recursion_depth++;
1720
1721 retval = search_binary_handler (bprm, regs);
1722 if (retval < 0)
1723diff --git a/fs/binfmt_script.c b/fs/binfmt_script.c
1724index 9e3963f..0834350 100644
1725--- a/fs/binfmt_script.c
1726+++ b/fs/binfmt_script.c
1727@@ -22,14 +22,15 @@ static int load_script(struct linux_binprm *bprm,struct pt_regs *regs)
1728 char interp[BINPRM_BUF_SIZE];
1729 int retval;
1730
1731- if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!') || (bprm->sh_bang))
1732+ if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!') ||
1733+ (bprm->recursion_depth > BINPRM_MAX_RECURSION))
1734 return -ENOEXEC;
1735 /*
1736 * This section does the #! interpretation.
1737 * Sorta complicated, but hopefully it will work. -TYT
1738 */
1739
1740- bprm->sh_bang = 1;
1741+ bprm->recursion_depth++;
1742 allow_write_access(bprm->file);
1743 fput(bprm->file);
1744 bprm->file = NULL;
1745diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
1746index 6e2be4a..223647f 100644
1747--- a/fs/cifs/connect.c
1748+++ b/fs/cifs/connect.c
1749@@ -128,7 +128,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
1750 struct mid_q_entry *mid_entry;
1751
1752 spin_lock(&GlobalMid_Lock);
1753- if (kthread_should_stop()) {
1754+ if (server->tcpStatus == CifsExiting) {
1755 /* the demux thread will exit normally
1756 next time through the loop */
1757 spin_unlock(&GlobalMid_Lock);
1758@@ -182,7 +182,8 @@ cifs_reconnect(struct TCP_Server_Info *server)
1759 spin_unlock(&GlobalMid_Lock);
1760 up(&server->tcpSem);
1761
1762- while ((!kthread_should_stop()) && (server->tcpStatus != CifsGood)) {
1763+ while ((server->tcpStatus != CifsExiting) &&
1764+ (server->tcpStatus != CifsGood)) {
1765 try_to_freeze();
1766 if (server->addr.sockAddr6.sin6_family == AF_INET6) {
1767 rc = ipv6_connect(&server->addr.sockAddr6,
1768@@ -200,7 +201,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
1769 } else {
1770 atomic_inc(&tcpSesReconnectCount);
1771 spin_lock(&GlobalMid_Lock);
1772- if (!kthread_should_stop())
1773+ if (server->tcpStatus != CifsExiting)
1774 server->tcpStatus = CifsGood;
1775 server->sequence_number = 0;
1776 spin_unlock(&GlobalMid_Lock);
1777@@ -355,7 +356,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
1778 GFP_KERNEL);
1779
1780 set_freezable();
1781- while (!kthread_should_stop()) {
1782+ while (server->tcpStatus != CifsExiting) {
1783 if (try_to_freeze())
1784 continue;
1785 if (bigbuf == NULL) {
1786@@ -396,7 +397,7 @@ incomplete_rcv:
1787 kernel_recvmsg(csocket, &smb_msg,
1788 &iov, 1, pdu_length, 0 /* BB other flags? */);
1789
1790- if (kthread_should_stop()) {
1791+ if (server->tcpStatus == CifsExiting) {
1792 break;
1793 } else if (server->tcpStatus == CifsNeedReconnect) {
1794 cFYI(1, ("Reconnect after server stopped responding"));
1795@@ -527,7 +528,7 @@ incomplete_rcv:
1796 total_read += length) {
1797 length = kernel_recvmsg(csocket, &smb_msg, &iov, 1,
1798 pdu_length - total_read, 0);
1799- if (kthread_should_stop() ||
1800+ if ((server->tcpStatus == CifsExiting) ||
1801 (length == -EINTR)) {
1802 /* then will exit */
1803 reconnect = 2;
1804@@ -661,14 +662,6 @@ multi_t2_fnd:
1805 spin_unlock(&GlobalMid_Lock);
1806 wake_up_all(&server->response_q);
1807
1808- /* don't exit until kthread_stop is called */
1809- set_current_state(TASK_UNINTERRUPTIBLE);
1810- while (!kthread_should_stop()) {
1811- schedule();
1812- set_current_state(TASK_UNINTERRUPTIBLE);
1813- }
1814- set_current_state(TASK_RUNNING);
1815-
1816 /* check if we have blocked requests that need to free */
1817 /* Note that cifs_max_pending is normally 50, but
1818 can be set at module install time to as little as two */
1819@@ -764,6 +757,7 @@ multi_t2_fnd:
1820 read_unlock(&cifs_tcp_ses_lock);
1821
1822 kfree(server->hostname);
1823+ task_to_wake = xchg(&server->tsk, NULL);
1824 kfree(server);
1825
1826 length = atomic_dec_return(&tcpSesAllocCount);
1827@@ -771,6 +765,16 @@ multi_t2_fnd:
1828 mempool_resize(cifs_req_poolp, length + cifs_min_rcv,
1829 GFP_KERNEL);
1830
1831+ /* if server->tsk was NULL then wait for a signal before exiting */
1832+ if (!task_to_wake) {
1833+ set_current_state(TASK_INTERRUPTIBLE);
1834+ while (!signal_pending(current)) {
1835+ schedule();
1836+ set_current_state(TASK_INTERRUPTIBLE);
1837+ }
1838+ set_current_state(TASK_RUNNING);
1839+ }
1840+
1841 return 0;
1842 }
1843
1844@@ -2310,7 +2314,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
1845 /* on error free sesinfo and tcon struct if needed */
1846 mount_fail_check:
1847 if (rc) {
1848- /* If find_unc succeeded then rc == 0 so we can not end */
1849+ /* If find_unc succeeded then rc == 0 so we can not end */
1850 /* up accidently freeing someone elses tcon struct */
1851 if (tcon)
1852 cifs_put_tcon(tcon);
1853@@ -3715,8 +3719,10 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
1854 cERROR(1, ("Send error in SessSetup = %d", rc));
1855 } else {
1856 cFYI(1, ("CIFS Session Established successfully"));
1857+ spin_lock(&GlobalMid_Lock);
1858 pSesInfo->status = CifsGood;
1859 pSesInfo->need_reconnect = false;
1860+ spin_unlock(&GlobalMid_Lock);
1861 }
1862
1863 ss_err_exit:
1864diff --git a/fs/exec.c b/fs/exec.c
1865index cecee50..b266ace 100644
1866--- a/fs/exec.c
1867+++ b/fs/exec.c
1868@@ -1164,6 +1164,7 @@ EXPORT_SYMBOL(remove_arg_zero);
1869 */
1870 int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
1871 {
1872+ unsigned int depth = bprm->recursion_depth;
1873 int try,retval;
1874 struct linux_binfmt *fmt;
1875 #ifdef __alpha__
1876@@ -1224,8 +1225,15 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
1877 continue;
1878 read_unlock(&binfmt_lock);
1879 retval = fn(bprm, regs);
1880+ /*
1881+ * Restore the depth counter to its starting value
1882+ * in this call, so we don't have to rely on every
1883+ * load_binary function to restore it on return.
1884+ */
1885+ bprm->recursion_depth = depth;
1886 if (retval >= 0) {
1887- tracehook_report_exec(fmt, bprm, regs);
1888+ if (depth == 0)
1889+ tracehook_report_exec(fmt, bprm, regs);
1890 put_binfmt(fmt);
1891 allow_write_access(bprm->file);
1892 if (bprm->file)
1893diff --git a/fs/fcntl.c b/fs/fcntl.c
1894index ac4f7db..549daf8 100644
1895--- a/fs/fcntl.c
1896+++ b/fs/fcntl.c
1897@@ -19,6 +19,7 @@
1898 #include <linux/signal.h>
1899 #include <linux/rcupdate.h>
1900 #include <linux/pid_namespace.h>
1901+#include <linux/smp_lock.h>
1902
1903 #include <asm/poll.h>
1904 #include <asm/siginfo.h>
1905@@ -175,6 +176,11 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
1906 if (error)
1907 return error;
1908
1909+ /*
1910+ * We still need a lock here for now to keep multiple FASYNC calls
1911+ * from racing with each other.
1912+ */
1913+ lock_kernel();
1914 if ((arg ^ filp->f_flags) & FASYNC) {
1915 if (filp->f_op && filp->f_op->fasync) {
1916 error = filp->f_op->fasync(fd, filp, (arg & FASYNC) != 0);
1917@@ -185,6 +191,7 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
1918
1919 filp->f_flags = (arg & SETFL_MASK) | (filp->f_flags & ~SETFL_MASK);
1920 out:
1921+ unlock_kernel();
1922 return error;
1923 }
1924
1925diff --git a/fs/ioctl.c b/fs/ioctl.c
1926index 7db32b3..612e0b2 100644
1927--- a/fs/ioctl.c
1928+++ b/fs/ioctl.c
1929@@ -123,11 +123,9 @@ static int ioctl_fioasync(unsigned int fd, struct file *filp,
1930
1931 /* Did FASYNC state change ? */
1932 if ((flag ^ filp->f_flags) & FASYNC) {
1933- if (filp->f_op && filp->f_op->fasync) {
1934- lock_kernel();
1935+ if (filp->f_op && filp->f_op->fasync)
1936 error = filp->f_op->fasync(fd, filp, on);
1937- unlock_kernel();
1938- } else
1939+ else
1940 error = -ENOTTY;
1941 }
1942 if (error)
1943@@ -163,11 +161,17 @@ int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
1944 break;
1945
1946 case FIONBIO:
1947+ /* BKL needed to avoid races tweaking f_flags */
1948+ lock_kernel();
1949 error = ioctl_fionbio(filp, argp);
1950+ unlock_kernel();
1951 break;
1952
1953 case FIOASYNC:
1954+ /* BKL needed to avoid races tweaking f_flags */
1955+ lock_kernel();
1956 error = ioctl_fioasync(fd, filp, argp);
1957+ unlock_kernel();
1958 break;
1959
1960 case FIOQSIZE:
1961diff --git a/fs/jbd/checkpoint.c b/fs/jbd/checkpoint.c
1962index a5432bb..fe85219 100644
1963--- a/fs/jbd/checkpoint.c
1964+++ b/fs/jbd/checkpoint.c
1965@@ -93,7 +93,8 @@ static int __try_to_free_cp_buf(struct journal_head *jh)
1966 int ret = 0;
1967 struct buffer_head *bh = jh2bh(jh);
1968
1969- if (jh->b_jlist == BJ_None && !buffer_locked(bh) && !buffer_dirty(bh)) {
1970+ if (jh->b_jlist == BJ_None && !buffer_locked(bh) &&
1971+ !buffer_dirty(bh) && !buffer_write_io_error(bh)) {
1972 JBUFFER_TRACE(jh, "remove from checkpoint list");
1973 ret = __journal_remove_checkpoint(jh) + 1;
1974 jbd_unlock_bh_state(bh);
1975@@ -160,21 +161,25 @@ static void jbd_sync_bh(journal_t *journal, struct buffer_head *bh)
1976 * buffers. Note that we take the buffers in the opposite ordering
1977 * from the one in which they were submitted for IO.
1978 *
1979+ * Return 0 on success, and return <0 if some buffers have failed
1980+ * to be written out.
1981+ *
1982 * Called with j_list_lock held.
1983 */
1984-static void __wait_cp_io(journal_t *journal, transaction_t *transaction)
1985+static int __wait_cp_io(journal_t *journal, transaction_t *transaction)
1986 {
1987 struct journal_head *jh;
1988 struct buffer_head *bh;
1989 tid_t this_tid;
1990 int released = 0;
1991+ int ret = 0;
1992
1993 this_tid = transaction->t_tid;
1994 restart:
1995 /* Did somebody clean up the transaction in the meanwhile? */
1996 if (journal->j_checkpoint_transactions != transaction ||
1997 transaction->t_tid != this_tid)
1998- return;
1999+ return ret;
2000 while (!released && transaction->t_checkpoint_io_list) {
2001 jh = transaction->t_checkpoint_io_list;
2002 bh = jh2bh(jh);
2003@@ -194,6 +199,9 @@ restart:
2004 spin_lock(&journal->j_list_lock);
2005 goto restart;
2006 }
2007+ if (unlikely(buffer_write_io_error(bh)))
2008+ ret = -EIO;
2009+
2010 /*
2011 * Now in whatever state the buffer currently is, we know that
2012 * it has been written out and so we can drop it from the list
2013@@ -203,6 +211,8 @@ restart:
2014 journal_remove_journal_head(bh);
2015 __brelse(bh);
2016 }
2017+
2018+ return ret;
2019 }
2020
2021 #define NR_BATCH 64
2022@@ -226,7 +236,8 @@ __flush_batch(journal_t *journal, struct buffer_head **bhs, int *batch_count)
2023 * Try to flush one buffer from the checkpoint list to disk.
2024 *
2025 * Return 1 if something happened which requires us to abort the current
2026- * scan of the checkpoint list.
2027+ * scan of the checkpoint list. Return <0 if the buffer has failed to
2028+ * be written out.
2029 *
2030 * Called with j_list_lock held and drops it if 1 is returned
2031 * Called under jbd_lock_bh_state(jh2bh(jh)), and drops it
2032@@ -256,6 +267,9 @@ static int __process_buffer(journal_t *journal, struct journal_head *jh,
2033 log_wait_commit(journal, tid);
2034 ret = 1;
2035 } else if (!buffer_dirty(bh)) {
2036+ ret = 1;
2037+ if (unlikely(buffer_write_io_error(bh)))
2038+ ret = -EIO;
2039 J_ASSERT_JH(jh, !buffer_jbddirty(bh));
2040 BUFFER_TRACE(bh, "remove from checkpoint");
2041 __journal_remove_checkpoint(jh);
2042@@ -263,7 +277,6 @@ static int __process_buffer(journal_t *journal, struct journal_head *jh,
2043 jbd_unlock_bh_state(bh);
2044 journal_remove_journal_head(bh);
2045 __brelse(bh);
2046- ret = 1;
2047 } else {
2048 /*
2049 * Important: we are about to write the buffer, and
2050@@ -295,6 +308,7 @@ static int __process_buffer(journal_t *journal, struct journal_head *jh,
2051 * to disk. We submit larger chunks of data at once.
2052 *
2053 * The journal should be locked before calling this function.
2054+ * Called with j_checkpoint_mutex held.
2055 */
2056 int log_do_checkpoint(journal_t *journal)
2057 {
2058@@ -318,6 +332,7 @@ int log_do_checkpoint(journal_t *journal)
2059 * OK, we need to start writing disk blocks. Take one transaction
2060 * and write it.
2061 */
2062+ result = 0;
2063 spin_lock(&journal->j_list_lock);
2064 if (!journal->j_checkpoint_transactions)
2065 goto out;
2066@@ -334,7 +349,7 @@ restart:
2067 int batch_count = 0;
2068 struct buffer_head *bhs[NR_BATCH];
2069 struct journal_head *jh;
2070- int retry = 0;
2071+ int retry = 0, err;
2072
2073 while (!retry && transaction->t_checkpoint_list) {
2074 struct buffer_head *bh;
2075@@ -347,6 +362,8 @@ restart:
2076 break;
2077 }
2078 retry = __process_buffer(journal, jh, bhs,&batch_count);
2079+ if (retry < 0 && !result)
2080+ result = retry;
2081 if (!retry && (need_resched() ||
2082 spin_needbreak(&journal->j_list_lock))) {
2083 spin_unlock(&journal->j_list_lock);
2084@@ -371,14 +388,18 @@ restart:
2085 * Now we have cleaned up the first transaction's checkpoint
2086 * list. Let's clean up the second one
2087 */
2088- __wait_cp_io(journal, transaction);
2089+ err = __wait_cp_io(journal, transaction);
2090+ if (!result)
2091+ result = err;
2092 }
2093 out:
2094 spin_unlock(&journal->j_list_lock);
2095- result = cleanup_journal_tail(journal);
2096 if (result < 0)
2097- return result;
2098- return 0;
2099+ journal_abort(journal, result);
2100+ else
2101+ result = cleanup_journal_tail(journal);
2102+
2103+ return (result < 0) ? result : 0;
2104 }
2105
2106 /*
2107@@ -394,8 +415,9 @@ out:
2108 * This is the only part of the journaling code which really needs to be
2109 * aware of transaction aborts. Checkpointing involves writing to the
2110 * main filesystem area rather than to the journal, so it can proceed
2111- * even in abort state, but we must not update the journal superblock if
2112- * we have an abort error outstanding.
2113+ * even in abort state, but we must not update the super block if
2114+ * checkpointing may have failed. Otherwise, we would lose some metadata
2115+ * buffers which should be written-back to the filesystem.
2116 */
2117
2118 int cleanup_journal_tail(journal_t *journal)
2119@@ -404,6 +426,9 @@ int cleanup_journal_tail(journal_t *journal)
2120 tid_t first_tid;
2121 unsigned long blocknr, freed;
2122
2123+ if (is_journal_aborted(journal))
2124+ return 1;
2125+
2126 /* OK, work out the oldest transaction remaining in the log, and
2127 * the log block it starts at.
2128 *
2129diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
2130index aa7143a..9e4fa52 100644
2131--- a/fs/jbd/journal.c
2132+++ b/fs/jbd/journal.c
2133@@ -1121,9 +1121,12 @@ recovery_error:
2134 *
2135 * Release a journal_t structure once it is no longer in use by the
2136 * journaled object.
2137+ * Return <0 if we couldn't clean up the journal.
2138 */
2139-void journal_destroy(journal_t *journal)
2140+int journal_destroy(journal_t *journal)
2141 {
2142+ int err = 0;
2143+
2144 /* Wait for the commit thread to wake up and die. */
2145 journal_kill_thread(journal);
2146
2147@@ -1146,11 +1149,16 @@ void journal_destroy(journal_t *journal)
2148 J_ASSERT(journal->j_checkpoint_transactions == NULL);
2149 spin_unlock(&journal->j_list_lock);
2150
2151- /* We can now mark the journal as empty. */
2152- journal->j_tail = 0;
2153- journal->j_tail_sequence = ++journal->j_transaction_sequence;
2154 if (journal->j_sb_buffer) {
2155- journal_update_superblock(journal, 1);
2156+ if (!is_journal_aborted(journal)) {
2157+ /* We can now mark the journal as empty. */
2158+ journal->j_tail = 0;
2159+ journal->j_tail_sequence =
2160+ ++journal->j_transaction_sequence;
2161+ journal_update_superblock(journal, 1);
2162+ } else {
2163+ err = -EIO;
2164+ }
2165 brelse(journal->j_sb_buffer);
2166 }
2167
2168@@ -1160,6 +1168,8 @@ void journal_destroy(journal_t *journal)
2169 journal_destroy_revoke(journal);
2170 kfree(journal->j_wbuf);
2171 kfree(journal);
2172+
2173+ return err;
2174 }
2175
2176
2177@@ -1359,10 +1369,16 @@ int journal_flush(journal_t *journal)
2178 spin_lock(&journal->j_list_lock);
2179 while (!err && journal->j_checkpoint_transactions != NULL) {
2180 spin_unlock(&journal->j_list_lock);
2181+ mutex_lock(&journal->j_checkpoint_mutex);
2182 err = log_do_checkpoint(journal);
2183+ mutex_unlock(&journal->j_checkpoint_mutex);
2184 spin_lock(&journal->j_list_lock);
2185 }
2186 spin_unlock(&journal->j_list_lock);
2187+
2188+ if (is_journal_aborted(journal))
2189+ return -EIO;
2190+
2191 cleanup_journal_tail(journal);
2192
2193 /* Finally, mark the journal as really needing no recovery.
2194@@ -1384,7 +1400,7 @@ int journal_flush(journal_t *journal)
2195 J_ASSERT(journal->j_head == journal->j_tail);
2196 J_ASSERT(journal->j_tail_sequence == journal->j_transaction_sequence);
2197 spin_unlock(&journal->j_state_lock);
2198- return err;
2199+ return 0;
2200 }
2201
2202 /**
2203diff --git a/fs/jbd/recovery.c b/fs/jbd/recovery.c
2204index 43bc5e5..db5e982 100644
2205--- a/fs/jbd/recovery.c
2206+++ b/fs/jbd/recovery.c
2207@@ -223,7 +223,7 @@ do { \
2208 */
2209 int journal_recover(journal_t *journal)
2210 {
2211- int err;
2212+ int err, err2;
2213 journal_superblock_t * sb;
2214
2215 struct recovery_info info;
2216@@ -261,7 +261,10 @@ int journal_recover(journal_t *journal)
2217 journal->j_transaction_sequence = ++info.end_transaction;
2218
2219 journal_clear_revoke(journal);
2220- sync_blockdev(journal->j_fs_dev);
2221+ err2 = sync_blockdev(journal->j_fs_dev);
2222+ if (!err)
2223+ err = err2;
2224+
2225 return err;
2226 }
2227
2228diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
2229index f3ada04..8b84227 100644
2230--- a/fs/proc/task_mmu.c
2231+++ b/fs/proc/task_mmu.c
2232@@ -563,9 +563,9 @@ static u64 swap_pte_to_pagemap_entry(pte_t pte)
2233 return swp_type(e) | (swp_offset(e) << MAX_SWAPFILES_SHIFT);
2234 }
2235
2236-static unsigned long pte_to_pagemap_entry(pte_t pte)
2237+static u64 pte_to_pagemap_entry(pte_t pte)
2238 {
2239- unsigned long pme = 0;
2240+ u64 pme = 0;
2241 if (is_swap_pte(pte))
2242 pme = PM_PFRAME(swap_pte_to_pagemap_entry(pte))
2243 | PM_PSHIFT(PAGE_SHIFT) | PM_SWAP;
2244diff --git a/fs/xfs/xfs_rename.c b/fs/xfs/xfs_rename.c
2245index d700dac..c903130 100644
2246--- a/fs/xfs/xfs_rename.c
2247+++ b/fs/xfs/xfs_rename.c
2248@@ -212,7 +212,7 @@ xfs_rename(
2249 if (unlikely((target_dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) &&
2250 (target_dp->i_d.di_projid != src_ip->i_d.di_projid))) {
2251 error = XFS_ERROR(EXDEV);
2252- xfs_rename_unlock4(inodes, XFS_ILOCK_SHARED);
2253+ xfs_rename_unlock4(inodes, XFS_ILOCK_EXCL);
2254 xfs_trans_cancel(tp, cancel_flags);
2255 goto std_return;
2256 }
2257diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
2258index 826f623..12413a1 100644
2259--- a/include/linux/binfmts.h
2260+++ b/include/linux/binfmts.h
2261@@ -36,6 +36,7 @@ struct linux_binprm{
2262 unsigned long p; /* current top of mem */
2263 unsigned int sh_bang:1,
2264 misc_bang:1;
2265+ unsigned int recursion_depth;
2266 struct file * file;
2267 int e_uid, e_gid;
2268 kernel_cap_t cap_post_exec_permitted;
2269@@ -58,6 +59,7 @@ struct linux_binprm{
2270 #define BINPRM_FLAGS_EXECFD_BIT 1
2271 #define BINPRM_FLAGS_EXECFD (1 << BINPRM_FLAGS_EXECFD_BIT)
2272
2273+#define BINPRM_MAX_RECURSION 4
2274
2275 /*
2276 * This structure defines the functions that are used to load the binary formats that
2277diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
2278index 53ea933..73f4532 100644
2279--- a/include/linux/blkdev.h
2280+++ b/include/linux/blkdev.h
2281@@ -623,6 +623,7 @@ extern unsigned long blk_max_low_pfn, blk_max_pfn;
2282 * default timeout for SG_IO if none specified
2283 */
2284 #define BLK_DEFAULT_SG_TIMEOUT (60 * HZ)
2285+#define BLK_MIN_SG_TIMEOUT (7 * HZ)
2286
2287 #ifdef CONFIG_BOUNCE
2288 extern int init_emergency_isa_pool(void);
2289diff --git a/include/linux/jbd.h b/include/linux/jbd.h
2290index 07a9b52..0be86be 100644
2291--- a/include/linux/jbd.h
2292+++ b/include/linux/jbd.h
2293@@ -908,7 +908,7 @@ extern int journal_set_features
2294 (journal_t *, unsigned long, unsigned long, unsigned long);
2295 extern int journal_create (journal_t *);
2296 extern int journal_load (journal_t *journal);
2297-extern void journal_destroy (journal_t *);
2298+extern int journal_destroy (journal_t *);
2299 extern int journal_recover (journal_t *journal);
2300 extern int journal_wipe (journal_t *, int);
2301 extern int journal_skip_recovery (journal_t *);
2302diff --git a/include/linux/pnp.h b/include/linux/pnp.h
2303index be764e5..53b70fd 100644
2304--- a/include/linux/pnp.h
2305+++ b/include/linux/pnp.h
2306@@ -22,9 +22,11 @@ struct pnp_dev;
2307 * Resource Management
2308 */
2309 #ifdef CONFIG_PNP
2310-struct resource *pnp_get_resource(struct pnp_dev *, unsigned int, unsigned int);
2311+struct resource *pnp_get_resource(struct pnp_dev *dev, unsigned long type,
2312+ unsigned int num);
2313 #else
2314-static inline struct resource *pnp_get_resource(struct pnp_dev *dev, unsigned int type, unsigned int num)
2315+static inline struct resource *pnp_get_resource(struct pnp_dev *dev,
2316+ unsigned long type, unsigned int num)
2317 {
2318 return NULL;
2319 }
2320diff --git a/kernel/fork.c b/kernel/fork.c
2321index 7ce2ebe..d8ad2c6 100644
2322--- a/kernel/fork.c
2323+++ b/kernel/fork.c
2324@@ -313,17 +313,20 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
2325 file = tmp->vm_file;
2326 if (file) {
2327 struct inode *inode = file->f_path.dentry->d_inode;
2328+ struct address_space *mapping = file->f_mapping;
2329+
2330 get_file(file);
2331 if (tmp->vm_flags & VM_DENYWRITE)
2332 atomic_dec(&inode->i_writecount);
2333-
2334- /* insert tmp into the share list, just after mpnt */
2335- spin_lock(&file->f_mapping->i_mmap_lock);
2336+ spin_lock(&mapping->i_mmap_lock);
2337+ if (tmp->vm_flags & VM_SHARED)
2338+ mapping->i_mmap_writable++;
2339 tmp->vm_truncate_count = mpnt->vm_truncate_count;
2340- flush_dcache_mmap_lock(file->f_mapping);
2341+ flush_dcache_mmap_lock(mapping);
2342+ /* insert tmp into the share list, just after mpnt */
2343 vma_prio_tree_add(tmp, mpnt);
2344- flush_dcache_mmap_unlock(file->f_mapping);
2345- spin_unlock(&file->f_mapping->i_mmap_lock);
2346+ flush_dcache_mmap_unlock(mapping);
2347+ spin_unlock(&mapping->i_mmap_lock);
2348 }
2349
2350 /*
2351diff --git a/kernel/sched.c b/kernel/sched.c
2352index a992cbe..92c0a70 100644
2353--- a/kernel/sched.c
2354+++ b/kernel/sched.c
2355@@ -6500,7 +6500,9 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu)
2356 req = list_entry(rq->migration_queue.next,
2357 struct migration_req, list);
2358 list_del_init(&req->list);
2359+ spin_unlock_irq(&rq->lock);
2360 complete(&req->done);
2361+ spin_lock_irq(&rq->lock);
2362 }
2363 spin_unlock_irq(&rq->lock);
2364 break;
2365@@ -6802,15 +6804,17 @@ cpu_attach_domain(struct sched_domain *sd, struct root_domain *rd, int cpu)
2366 struct sched_domain *tmp;
2367
2368 /* Remove the sched domains which do not contribute to scheduling. */
2369- for (tmp = sd; tmp; tmp = tmp->parent) {
2370+ for (tmp = sd; tmp; ) {
2371 struct sched_domain *parent = tmp->parent;
2372 if (!parent)
2373 break;
2374+
2375 if (sd_parent_degenerate(tmp, parent)) {
2376 tmp->parent = parent->parent;
2377 if (parent->parent)
2378 parent->parent->child = tmp;
2379- }
2380+ } else
2381+ tmp = tmp->parent;
2382 }
2383
2384 if (sd && sd_degenerate(sd)) {
2385diff --git a/net/atm/svc.c b/net/atm/svc.c
2386index de1e4f2..8fb54dc 100644
2387--- a/net/atm/svc.c
2388+++ b/net/atm/svc.c
2389@@ -293,7 +293,10 @@ static int svc_listen(struct socket *sock,int backlog)
2390 error = -EINVAL;
2391 goto out;
2392 }
2393- vcc_insert_socket(sk);
2394+ if (test_bit(ATM_VF_LISTEN, &vcc->flags)) {
2395+ error = -EADDRINUSE;
2396+ goto out;
2397+ }
2398 set_bit(ATM_VF_WAITING, &vcc->flags);
2399 prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
2400 sigd_enq(vcc,as_listen,NULL,NULL,&vcc->local);
2401@@ -307,6 +310,7 @@ static int svc_listen(struct socket *sock,int backlog)
2402 goto out;
2403 }
2404 set_bit(ATM_VF_LISTEN,&vcc->flags);
2405+ vcc_insert_socket(sk);
2406 sk->sk_max_ack_backlog = backlog > 0 ? backlog : ATM_BACKLOG_DEFAULT;
2407 error = -sk->sk_err;
2408 out:
2409diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
2410index 57e26fa..915e6b7 100644
2411--- a/net/ipv4/udp.c
2412+++ b/net/ipv4/udp.c
2413@@ -302,7 +302,7 @@ static struct sock *__udp4_lib_lookup(struct net *net, __be32 saddr,
2414 return result;
2415 }
2416
2417-static inline struct sock *udp_v4_mcast_next(struct sock *sk,
2418+static inline struct sock *udp_v4_mcast_next(struct net *net, struct sock *sk,
2419 __be16 loc_port, __be32 loc_addr,
2420 __be16 rmt_port, __be32 rmt_addr,
2421 int dif)
2422@@ -314,7 +314,8 @@ static inline struct sock *udp_v4_mcast_next(struct sock *sk,
2423 sk_for_each_from(s, node) {
2424 struct inet_sock *inet = inet_sk(s);
2425
2426- if (s->sk_hash != hnum ||
2427+ if (!net_eq(sock_net(s), net) ||
2428+ s->sk_hash != hnum ||
2429 (inet->daddr && inet->daddr != rmt_addr) ||
2430 (inet->dport != rmt_port && inet->dport) ||
2431 (inet->rcv_saddr && inet->rcv_saddr != loc_addr) ||
2432@@ -1097,15 +1098,16 @@ static int __udp4_lib_mcast_deliver(struct net *net, struct sk_buff *skb,
2433 read_lock(&udp_hash_lock);
2434 sk = sk_head(&udptable[udp_hashfn(net, ntohs(uh->dest))]);
2435 dif = skb->dev->ifindex;
2436- sk = udp_v4_mcast_next(sk, uh->dest, daddr, uh->source, saddr, dif);
2437+ sk = udp_v4_mcast_next(net, sk, uh->dest, daddr, uh->source, saddr, dif);
2438 if (sk) {
2439 struct sock *sknext = NULL;
2440
2441 do {
2442 struct sk_buff *skb1 = skb;
2443
2444- sknext = udp_v4_mcast_next(sk_next(sk), uh->dest, daddr,
2445- uh->source, saddr, dif);
2446+ sknext = udp_v4_mcast_next(net, sk_next(sk), uh->dest,
2447+ daddr, uh->source, saddr,
2448+ dif);
2449 if (sknext)
2450 skb1 = skb_clone(skb, GFP_ATOMIC);
2451
2452diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
2453index a6aecf7..e53d101 100644
2454--- a/net/ipv6/udp.c
2455+++ b/net/ipv6/udp.c
2456@@ -313,7 +313,7 @@ drop:
2457 return -1;
2458 }
2459
2460-static struct sock *udp_v6_mcast_next(struct sock *sk,
2461+static struct sock *udp_v6_mcast_next(struct net *net, struct sock *sk,
2462 __be16 loc_port, struct in6_addr *loc_addr,
2463 __be16 rmt_port, struct in6_addr *rmt_addr,
2464 int dif)
2465@@ -325,7 +325,7 @@ static struct sock *udp_v6_mcast_next(struct sock *sk,
2466 sk_for_each_from(s, node) {
2467 struct inet_sock *inet = inet_sk(s);
2468
2469- if (sock_net(s) != sock_net(sk))
2470+ if (!net_eq(sock_net(s), net))
2471 continue;
2472
2473 if (s->sk_hash == num && s->sk_family == PF_INET6) {
2474@@ -368,14 +368,14 @@ static int __udp6_lib_mcast_deliver(struct net *net, struct sk_buff *skb,
2475 read_lock(&udp_hash_lock);
2476 sk = sk_head(&udptable[udp_hashfn(net, ntohs(uh->dest))]);
2477 dif = inet6_iif(skb);
2478- sk = udp_v6_mcast_next(sk, uh->dest, daddr, uh->source, saddr, dif);
2479+ sk = udp_v6_mcast_next(net, sk, uh->dest, daddr, uh->source, saddr, dif);
2480 if (!sk) {
2481 kfree_skb(skb);
2482 goto out;
2483 }
2484
2485 sk2 = sk;
2486- while ((sk2 = udp_v6_mcast_next(sk_next(sk2), uh->dest, daddr,
2487+ while ((sk2 = udp_v6_mcast_next(net, sk_next(sk2), uh->dest, daddr,
2488 uh->source, saddr, dif))) {
2489 struct sk_buff *buff = skb_clone(skb, GFP_ATOMIC);
2490 if (buff) {
2491diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
2492index b0785ef..8e66fe0 100644
2493--- a/net/unix/af_unix.c
2494+++ b/net/unix/af_unix.c
2495@@ -2230,7 +2230,7 @@ static int unix_net_init(struct net *net)
2496 #endif
2497 error = 0;
2498 out:
2499- return 0;
2500+ return error;
2501 }
2502
2503 static void unix_net_exit(struct net *net)
2504diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
2505index 2f283ea..de5ee8f 100644
2506--- a/sound/pci/emu10k1/emu10k1_main.c
2507+++ b/sound/pci/emu10k1/emu10k1_main.c
2508@@ -1464,6 +1464,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
2509 .ca0151_chip = 1,
2510 .spk71 = 1,
2511 .spdif_bug = 1,
2512+ .invert_shared_spdif = 1, /* digital/analog switch swapped */
2513 .ac97_chip = 1} ,
2514 {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20021102,
2515 .driver = "Audigy2", .name = "Audigy 2 ZS [SB0350]",
2516@@ -1473,6 +1474,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
2517 .ca0151_chip = 1,
2518 .spk71 = 1,
2519 .spdif_bug = 1,
2520+ .invert_shared_spdif = 1, /* digital/analog switch swapped */
2521 .ac97_chip = 1} ,
2522 {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20011102,
2523 .driver = "Audigy2", .name = "Audigy 2 ZS [2001]",
2524@@ -1482,6 +1484,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
2525 .ca0151_chip = 1,
2526 .spk71 = 1,
2527 .spdif_bug = 1,
2528+ .invert_shared_spdif = 1, /* digital/analog switch swapped */
2529 .ac97_chip = 1} ,
2530 /* Audigy 2 */
2531 /* Tested by James@superbug.co.uk 3rd July 2005 */
2532diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c
2533index 1e5aff5..2fe4ea1 100644
2534--- a/sound/pci/hda/hda_proc.c
2535+++ b/sound/pci/hda/hda_proc.c
2536@@ -216,7 +216,7 @@ static void print_pin_caps(struct snd_info_buffer *buffer,
2537 unsigned int caps, val;
2538
2539 caps = snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP);
2540- snd_iprintf(buffer, " Pincap 0x08%x:", caps);
2541+ snd_iprintf(buffer, " Pincap 0x%08x:", caps);
2542 if (caps & AC_PINCAP_IN)
2543 snd_iprintf(buffer, " IN");
2544 if (caps & AC_PINCAP_OUT)
2545diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
2546index e8003d9..cb13307 100644
2547--- a/sound/pci/hda/patch_analog.c
2548+++ b/sound/pci/hda/patch_analog.c
2549@@ -2247,8 +2247,12 @@ static struct hda_verb ad1988_spdif_init_verbs[] = {
2550
2551 /* AD1989 has no ADC -> SPDIF route */
2552 static struct hda_verb ad1989_spdif_init_verbs[] = {
2553- /* SPDIF out pin */
2554+ /* SPDIF-1 out pin */
2555+ {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
2556 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE | 0x27}, /* 0dB */
2557+ /* SPDIF-2/HDMI out pin */
2558+ {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
2559+ {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE | 0x27}, /* 0dB */
2560 { }
2561 };
2562
2563@@ -2868,6 +2872,7 @@ static struct snd_pci_quirk ad1988_cfg_tbl[] = {
2564 SND_PCI_QUIRK(0x1043, 0x81ec, "Asus P5B-DLX", AD1988_6STACK_DIG),
2565 SND_PCI_QUIRK(0x1043, 0x81f6, "Asus M2N-SLI", AD1988_6STACK_DIG),
2566 SND_PCI_QUIRK(0x1043, 0x8277, "Asus P5K-E/WIFI-AP", AD1988_6STACK_DIG),
2567+ SND_PCI_QUIRK(0x1043, 0x8311, "Asus P5Q-Premium/Pro", AD1988_6STACK_DIG),
2568 {}
2569 };
2570
2571@@ -3842,6 +3847,9 @@ static const char *ad1884a_models[AD1884A_MODELS] = {
2572
2573 static struct snd_pci_quirk ad1884a_cfg_tbl[] = {
2574 SND_PCI_QUIRK(0x103c, 0x3030, "HP", AD1884A_MOBILE),
2575+ SND_PCI_QUIRK(0x103c, 0x3056, "HP", AD1884A_MOBILE),
2576+ SND_PCI_QUIRK(0x103c, 0x30e7, "HP EliteBook 8530p", AD1884A_LAPTOP),
2577+ SND_PCI_QUIRK(0x103c, 0x3614, "HP 6730s", AD1884A_LAPTOP),
2578 SND_PCI_QUIRK(0x17aa, 0x20ac, "Thinkpad X300", AD1884A_THINKPAD),
2579 {}
2580 };
2581diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
2582index 6602516..a1a3a34 100644
2583--- a/sound/pci/hda/patch_realtek.c
2584+++ b/sound/pci/hda/patch_realtek.c
2585@@ -100,6 +100,7 @@ enum {
2586 ALC262_BENQ_T31,
2587 ALC262_ULTRA,
2588 ALC262_LENOVO_3000,
2589+ ALC262_NEC,
2590 ALC262_AUTO,
2591 ALC262_MODEL_LAST /* last tag */
2592 };
2593@@ -291,6 +292,13 @@ struct alc_spec {
2594 /* for PLL fix */
2595 hda_nid_t pll_nid;
2596 unsigned int pll_coef_idx, pll_coef_bit;
2597+
2598+#ifdef SND_HDA_NEEDS_RESUME
2599+#define ALC_MAX_PINS 16
2600+ unsigned int num_pins;
2601+ hda_nid_t pin_nids[ALC_MAX_PINS];
2602+ unsigned int pin_cfgs[ALC_MAX_PINS];
2603+#endif
2604 };
2605
2606 /*
2607@@ -2722,6 +2730,64 @@ static void alc_free(struct hda_codec *codec)
2608 codec->spec = NULL; /* to be sure */
2609 }
2610
2611+#ifdef SND_HDA_NEEDS_RESUME
2612+static void store_pin_configs(struct hda_codec *codec)
2613+{
2614+ struct alc_spec *spec = codec->spec;
2615+ hda_nid_t nid, end_nid;
2616+
2617+ end_nid = codec->start_nid + codec->num_nodes;
2618+ for (nid = codec->start_nid; nid < end_nid; nid++) {
2619+ unsigned int wid_caps = get_wcaps(codec, nid);
2620+ unsigned int wid_type =
2621+ (wid_caps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT;
2622+ if (wid_type != AC_WID_PIN)
2623+ continue;
2624+ if (spec->num_pins >= ARRAY_SIZE(spec->pin_nids))
2625+ break;
2626+ spec->pin_nids[spec->num_pins] = nid;
2627+ spec->pin_cfgs[spec->num_pins] =
2628+ snd_hda_codec_read(codec, nid, 0,
2629+ AC_VERB_GET_CONFIG_DEFAULT, 0);
2630+ spec->num_pins++;
2631+ }
2632+}
2633+
2634+static void resume_pin_configs(struct hda_codec *codec)
2635+{
2636+ struct alc_spec *spec = codec->spec;
2637+ int i;
2638+
2639+ for (i = 0; i < spec->num_pins; i++) {
2640+ hda_nid_t pin_nid = spec->pin_nids[i];
2641+ unsigned int pin_config = spec->pin_cfgs[i];
2642+ snd_hda_codec_write(codec, pin_nid, 0,
2643+ AC_VERB_SET_CONFIG_DEFAULT_BYTES_0,
2644+ pin_config & 0x000000ff);
2645+ snd_hda_codec_write(codec, pin_nid, 0,
2646+ AC_VERB_SET_CONFIG_DEFAULT_BYTES_1,
2647+ (pin_config & 0x0000ff00) >> 8);
2648+ snd_hda_codec_write(codec, pin_nid, 0,
2649+ AC_VERB_SET_CONFIG_DEFAULT_BYTES_2,
2650+ (pin_config & 0x00ff0000) >> 16);
2651+ snd_hda_codec_write(codec, pin_nid, 0,
2652+ AC_VERB_SET_CONFIG_DEFAULT_BYTES_3,
2653+ pin_config >> 24);
2654+ }
2655+}
2656+
2657+static int alc_resume(struct hda_codec *codec)
2658+{
2659+ resume_pin_configs(codec);
2660+ codec->patch_ops.init(codec);
2661+ snd_hda_codec_resume_amp(codec);
2662+ snd_hda_codec_resume_cache(codec);
2663+ return 0;
2664+}
2665+#else
2666+#define store_pin_configs(codec)
2667+#endif
2668+
2669 /*
2670 */
2671 static struct hda_codec_ops alc_patch_ops = {
2672@@ -2730,6 +2796,9 @@ static struct hda_codec_ops alc_patch_ops = {
2673 .init = alc_init,
2674 .free = alc_free,
2675 .unsol_event = alc_unsol_event,
2676+#ifdef SND_HDA_NEEDS_RESUME
2677+ .resume = alc_resume,
2678+#endif
2679 #ifdef CONFIG_SND_HDA_POWER_SAVE
2680 .check_power_status = alc_check_power_status,
2681 #endif
2682@@ -3776,6 +3845,7 @@ static int alc880_parse_auto_config(struct hda_codec *codec)
2683 spec->num_mux_defs = 1;
2684 spec->input_mux = &spec->private_imux;
2685
2686+ store_pin_configs(codec);
2687 return 1;
2688 }
2689
2690@@ -5124,6 +5194,7 @@ static int alc260_parse_auto_config(struct hda_codec *codec)
2691 }
2692 spec->num_mixers++;
2693
2694+ store_pin_configs(codec);
2695 return 1;
2696 }
2697
2698@@ -6554,6 +6625,7 @@ static int patch_alc882(struct hda_codec *codec)
2699 board_config = ALC885_MACPRO;
2700 break;
2701 case 0x106b1000: /* iMac 24 */
2702+ case 0x106b2800: /* AppleTV */
2703 board_config = ALC885_IMAC24;
2704 break;
2705 case 0x106b00a1: /* Macbook (might be wrong - PCI SSID?) */
2706@@ -6563,7 +6635,8 @@ static int patch_alc882(struct hda_codec *codec)
2707 break;
2708 default:
2709 /* ALC889A is handled better as ALC888-compatible */
2710- if (codec->revision_id == 0x100103) {
2711+ if (codec->revision_id == 0x100101 ||
2712+ codec->revision_id == 0x100103) {
2713 alc_free(codec);
2714 return patch_alc883(codec);
2715 }
2716@@ -7940,6 +8013,7 @@ static const char *alc883_models[ALC883_MODEL_LAST] = {
2717 static struct snd_pci_quirk alc883_cfg_tbl[] = {
2718 SND_PCI_QUIRK(0x1019, 0x6668, "ECS", ALC883_3ST_6ch_DIG),
2719 SND_PCI_QUIRK(0x1025, 0x006c, "Acer Aspire 9810", ALC883_ACER_ASPIRE),
2720+ SND_PCI_QUIRK(0x1025, 0x0090, "Acer Aspire", ALC883_ACER_ASPIRE),
2721 SND_PCI_QUIRK(0x1025, 0x0110, "Acer Aspire", ALC883_ACER_ASPIRE),
2722 SND_PCI_QUIRK(0x1025, 0x0112, "Acer Aspire 9303", ALC883_ACER_ASPIRE),
2723 SND_PCI_QUIRK(0x1025, 0x0121, "Acer Aspire 5920G", ALC883_ACER_ASPIRE),
2724@@ -7990,6 +8064,7 @@ static struct snd_pci_quirk alc883_cfg_tbl[] = {
2725 SND_PCI_QUIRK(0x17aa, 0x3bfc, "Lenovo NB0763", ALC883_LENOVO_NB0763),
2726 SND_PCI_QUIRK(0x17aa, 0x3bfd, "Lenovo NB0763", ALC883_LENOVO_NB0763),
2727 SND_PCI_QUIRK(0x17c0, 0x4071, "MEDION MD2", ALC883_MEDION_MD2),
2728+ SND_PCI_QUIRK(0x17c0, 0x4085, "MEDION MD96630", ALC888_LENOVO_MS7195_DIG),
2729 SND_PCI_QUIRK(0x17f2, 0x5000, "Albatron KI690-AM2", ALC883_6ST_DIG),
2730 SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66),
2731 SND_PCI_QUIRK(0x8086, 0x0001, "DG33BUC", ALC883_3ST_6ch_INTEL),
2732@@ -8948,6 +9023,41 @@ static void alc262_hippo1_unsol_event(struct hda_codec *codec,
2733 }
2734
2735 /*
2736+ * nec model
2737+ * 0x15 = headphone
2738+ * 0x16 = internal speaker
2739+ * 0x18 = external mic
2740+ */
2741+
2742+static struct snd_kcontrol_new alc262_nec_mixer[] = {
2743+ HDA_CODEC_VOLUME_MONO("Speaker Playback Volume", 0x0e, 1, 0x0, HDA_OUTPUT),
2744+ HDA_CODEC_MUTE_MONO("Speaker Playback Switch", 0x16, 0, 0x0, HDA_OUTPUT),
2745+
2746+ HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
2747+ HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
2748+ HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
2749+
2750+ HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
2751+ HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
2752+ { } /* end */
2753+};
2754+
2755+static struct hda_verb alc262_nec_verbs[] = {
2756+ /* Unmute Speaker */
2757+ {0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
2758+
2759+ /* Headphone */
2760+ {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
2761+ {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
2762+
2763+ /* External mic to headphone */
2764+ {0x0d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
2765+ /* External mic to speaker */
2766+ {0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
2767+ {}
2768+};
2769+
2770+/*
2771 * fujitsu model
2772 * 0x14 = headphone/spdif-out, 0x15 = internal speaker,
2773 * 0x1b = port replicator headphone out
2774@@ -9693,6 +9803,7 @@ static int alc262_parse_auto_config(struct hda_codec *codec)
2775 if (err < 0)
2776 return err;
2777
2778+ store_pin_configs(codec);
2779 return 1;
2780 }
2781
2782@@ -9731,11 +9842,13 @@ static const char *alc262_models[ALC262_MODEL_LAST] = {
2783 [ALC262_SONY_ASSAMD] = "sony-assamd",
2784 [ALC262_ULTRA] = "ultra",
2785 [ALC262_LENOVO_3000] = "lenovo-3000",
2786+ [ALC262_NEC] = "nec",
2787 [ALC262_AUTO] = "auto",
2788 };
2789
2790 static struct snd_pci_quirk alc262_cfg_tbl[] = {
2791 SND_PCI_QUIRK(0x1002, 0x437b, "Hippo", ALC262_HIPPO),
2792+ SND_PCI_QUIRK(0x1033, 0x8895, "NEC Versa S9100", ALC262_NEC),
2793 SND_PCI_QUIRK(0x103c, 0x12fe, "HP xw9400", ALC262_HP_BPC),
2794 SND_PCI_QUIRK(0x103c, 0x12ff, "HP xw4550", ALC262_HP_BPC),
2795 SND_PCI_QUIRK(0x103c, 0x1306, "HP xw8600", ALC262_HP_BPC),
2796@@ -9946,6 +10059,16 @@ static struct alc_config_preset alc262_presets[] = {
2797 .input_mux = &alc262_fujitsu_capture_source,
2798 .unsol_event = alc262_lenovo_3000_unsol_event,
2799 },
2800+ [ALC262_NEC] = {
2801+ .mixers = { alc262_nec_mixer },
2802+ .init_verbs = { alc262_nec_verbs },
2803+ .num_dacs = ARRAY_SIZE(alc262_dac_nids),
2804+ .dac_nids = alc262_dac_nids,
2805+ .hp_nid = 0x03,
2806+ .num_channel_mode = ARRAY_SIZE(alc262_modes),
2807+ .channel_mode = alc262_modes,
2808+ .input_mux = &alc262_capture_source,
2809+ },
2810 };
2811
2812 static int patch_alc262(struct hda_codec *codec)
2813@@ -10712,6 +10835,7 @@ static int alc268_parse_auto_config(struct hda_codec *codec)
2814 if (err < 0)
2815 return err;
2816
2817+ store_pin_configs(codec);
2818 return 1;
2819 }
2820
2821@@ -10758,6 +10882,7 @@ static struct snd_pci_quirk alc268_cfg_tbl[] = {
2822 SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST),
2823 SND_PCI_QUIRK(0x1179, 0xff10, "TOSHIBA A205", ALC268_TOSHIBA),
2824 SND_PCI_QUIRK(0x1179, 0xff50, "TOSHIBA A305", ALC268_TOSHIBA),
2825+ SND_PCI_QUIRK(0x1179, 0xff64, "TOSHIBA L305", ALC268_TOSHIBA),
2826 SND_PCI_QUIRK(0x14c0, 0x0025, "COMPAL IFL90/JFL-92", ALC268_TOSHIBA),
2827 SND_PCI_QUIRK(0x152d, 0x0763, "Diverse (CPR2000)", ALC268_ACER),
2828 SND_PCI_QUIRK(0x152d, 0x0771, "Quanta IL1", ALC267_QUANTA_IL1),
2829@@ -10990,6 +11115,14 @@ static hda_nid_t alc269_adc_nids[1] = {
2830 0x08,
2831 };
2832
2833+static hda_nid_t alc269_capsrc_nids[1] = {
2834+ 0x23,
2835+};
2836+
2837+/* NOTE: ADC2 (0x07) is connected from a recording *MIXER* (0x24),
2838+ * not a mux!
2839+ */
2840+
2841 static struct hda_input_mux alc269_eeepc_dmic_capture_source = {
2842 .num_items = 2,
2843 .items = {
2844@@ -11356,6 +11489,10 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
2845 spec->init_verbs[spec->num_init_verbs++] = alc269_init_verbs;
2846 spec->num_mux_defs = 1;
2847 spec->input_mux = &spec->private_imux;
2848+ /* set default input source */
2849+ snd_hda_codec_write_cache(codec, alc269_capsrc_nids[0],
2850+ 0, AC_VERB_SET_CONNECT_SEL,
2851+ spec->input_mux->items[0].index);
2852
2853 err = alc_auto_add_mic_boost(codec);
2854 if (err < 0)
2855@@ -11364,6 +11501,7 @@ static int alc269_parse_auto_config(struct hda_codec *codec)
2856 spec->mixers[spec->num_mixers] = alc269_capture_mixer;
2857 spec->num_mixers++;
2858
2859+ store_pin_configs(codec);
2860 return 1;
2861 }
2862
2863@@ -11488,6 +11626,7 @@ static int patch_alc269(struct hda_codec *codec)
2864
2865 spec->adc_nids = alc269_adc_nids;
2866 spec->num_adc_nids = ARRAY_SIZE(alc269_adc_nids);
2867+ spec->capsrc_nids = alc269_capsrc_nids;
2868
2869 codec->patch_ops = alc_patch_ops;
2870 if (board_config == ALC269_AUTO)
2871@@ -12431,6 +12570,7 @@ static int alc861_parse_auto_config(struct hda_codec *codec)
2872 spec->mixers[spec->num_mixers] = alc861_capture_mixer;
2873 spec->num_mixers++;
2874
2875+ store_pin_configs(codec);
2876 return 1;
2877 }
2878
2879@@ -13542,6 +13682,7 @@ static int alc861vd_parse_auto_config(struct hda_codec *codec)
2880 if (err < 0)
2881 return err;
2882
2883+ store_pin_configs(codec);
2884 return 1;
2885 }
2886
2887@@ -14789,6 +14930,8 @@ static int alc662_parse_auto_config(struct hda_codec *codec)
2888
2889 spec->mixers[spec->num_mixers] = alc662_capture_mixer;
2890 spec->num_mixers++;
2891+
2892+ store_pin_configs(codec);
2893 return 1;
2894 }
2895
2896@@ -14846,6 +14989,9 @@ static int patch_alc662(struct hda_codec *codec)
2897 if (codec->vendor_id == 0x10ec0663) {
2898 spec->stream_name_analog = "ALC663 Analog";
2899 spec->stream_name_digital = "ALC663 Digital";
2900+ } else if (codec->vendor_id == 0x10ec0272) {
2901+ spec->stream_name_analog = "ALC272 Analog";
2902+ spec->stream_name_digital = "ALC272 Digital";
2903 } else {
2904 spec->stream_name_analog = "ALC662 Analog";
2905 spec->stream_name_digital = "ALC662 Digital";
2906@@ -14883,6 +15029,7 @@ struct hda_codec_preset snd_hda_preset_realtek[] = {
2907 { .id = 0x10ec0267, .name = "ALC267", .patch = patch_alc268 },
2908 { .id = 0x10ec0268, .name = "ALC268", .patch = patch_alc268 },
2909 { .id = 0x10ec0269, .name = "ALC269", .patch = patch_alc269 },
2910+ { .id = 0x10ec0272, .name = "ALC272", .patch = patch_alc662 },
2911 { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660",
2912 .patch = patch_alc861 },
2913 { .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd },
2914@@ -14896,9 +15043,12 @@ struct hda_codec_preset snd_hda_preset_realtek[] = {
2915 { .id = 0x10ec0880, .name = "ALC880", .patch = patch_alc880 },
2916 { .id = 0x10ec0882, .name = "ALC882", .patch = patch_alc882 },
2917 { .id = 0x10ec0883, .name = "ALC883", .patch = patch_alc883 },
2918+ { .id = 0x10ec0885, .rev = 0x100101, .name = "ALC889A",
2919+ .patch = patch_alc882 }, /* should be patch_alc883() in future */
2920 { .id = 0x10ec0885, .rev = 0x100103, .name = "ALC889A",
2921 .patch = patch_alc882 }, /* should be patch_alc883() in future */
2922 { .id = 0x10ec0885, .name = "ALC885", .patch = patch_alc882 },
2923+ { .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc883 },
2924 { .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc883 },
2925 { .id = 0x10ec0889, .name = "ALC889", .patch = patch_alc883 },
2926 {} /* terminator */
2927diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
2928index 732ce13..1d96aed 100644
2929--- a/sound/pci/hda/patch_sigmatel.c
2930+++ b/sound/pci/hda/patch_sigmatel.c
2931@@ -105,6 +105,7 @@ enum {
2932 STAC_MACBOOK_PRO_V2,
2933 STAC_IMAC_INTEL,
2934 STAC_IMAC_INTEL_20,
2935+ STAC_ECS_202,
2936 STAC_922X_DELL_D81,
2937 STAC_922X_DELL_D82,
2938 STAC_922X_DELL_M81,
2939@@ -547,8 +548,8 @@ static struct hda_verb dell_eq_core_init[] = {
2940 { 0x1f, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xec},
2941 /* setup audio connections */
2942 { 0x0d, AC_VERB_SET_CONNECT_SEL, 0x00},
2943- { 0x0a, AC_VERB_SET_CONNECT_SEL, 0x01},
2944- { 0x0f, AC_VERB_SET_CONNECT_SEL, 0x02},
2945+ { 0x0a, AC_VERB_SET_CONNECT_SEL, 0x02},
2946+ { 0x0f, AC_VERB_SET_CONNECT_SEL, 0x01},
2947 /* setup adcs to point to mixer */
2948 { 0x20, AC_VERB_SET_CONNECT_SEL, 0x0b},
2949 { 0x21, AC_VERB_SET_CONNECT_SEL, 0x0b},
2950@@ -1310,7 +1311,7 @@ static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = {
2951 SND_PCI_QUIRK(PCI_VENDOR_ID_INTEL, 0x2668,
2952 "DFI LanParty", STAC_92HD73XX_REF),
2953 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0254,
2954- "unknown Dell", STAC_DELL_M6),
2955+ "Dell Studio 1535", STAC_DELL_M6),
2956 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0255,
2957 "unknown Dell", STAC_DELL_M6),
2958 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0256,
2959@@ -1323,6 +1324,8 @@ static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = {
2960 "unknown Dell", STAC_DELL_M6),
2961 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0271,
2962 "unknown Dell", STAC_DELL_M6),
2963+ SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x029f,
2964+ "Dell Studio 15", STAC_DELL_M6),
2965 {} /* terminator */
2966 };
2967
2968@@ -1478,6 +1481,11 @@ static unsigned int intel_mac_v5_pin_configs[10] = {
2969 0x400000fc, 0x400000fb,
2970 };
2971
2972+static unsigned int ecs202_pin_configs[10] = {
2973+ 0x0221401f, 0x02a19020, 0x01a19020, 0x01114010,
2974+ 0x408000f0, 0x01813022, 0x074510a0, 0x40c400f1,
2975+ 0x9037012e, 0x40e000f2,
2976+};
2977
2978 static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = {
2979 [STAC_D945_REF] = ref922x_pin_configs,
2980@@ -1496,6 +1504,7 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = {
2981 [STAC_MACBOOK_PRO_V2] = intel_mac_v3_pin_configs,
2982 [STAC_IMAC_INTEL] = intel_mac_v2_pin_configs,
2983 [STAC_IMAC_INTEL_20] = intel_mac_v3_pin_configs,
2984+ [STAC_ECS_202] = ecs202_pin_configs,
2985 [STAC_922X_DELL_D81] = dell_922x_d81_pin_configs,
2986 [STAC_922X_DELL_D82] = dell_922x_d82_pin_configs,
2987 [STAC_922X_DELL_M81] = dell_922x_m81_pin_configs,
2988@@ -1519,6 +1528,7 @@ static const char *stac922x_models[STAC_922X_MODELS] = {
2989 [STAC_MACBOOK_PRO_V2] = "macbook-pro",
2990 [STAC_IMAC_INTEL] = "imac-intel",
2991 [STAC_IMAC_INTEL_20] = "imac-intel-20",
2992+ [STAC_ECS_202] = "ecs202",
2993 [STAC_922X_DELL_D81] = "dell-d81",
2994 [STAC_922X_DELL_D82] = "dell-d82",
2995 [STAC_922X_DELL_M81] = "dell-m81",
2996@@ -1605,6 +1615,33 @@ static struct snd_pci_quirk stac922x_cfg_tbl[] = {
2997 "unknown Dell", STAC_922X_DELL_D81),
2998 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01d7,
2999 "Dell XPS M1210", STAC_922X_DELL_M82),
3000+ /* ECS/PC Chips boards */
3001+ SND_PCI_QUIRK(0x1019, 0x2144,
3002+ "ECS/PC chips", STAC_ECS_202),
3003+ SND_PCI_QUIRK(0x1019, 0x2608,
3004+ "ECS/PC chips", STAC_ECS_202),
3005+ SND_PCI_QUIRK(0x1019, 0x2633,
3006+ "ECS/PC chips P17G/1333", STAC_ECS_202),
3007+ SND_PCI_QUIRK(0x1019, 0x2811,
3008+ "ECS/PC chips", STAC_ECS_202),
3009+ SND_PCI_QUIRK(0x1019, 0x2812,
3010+ "ECS/PC chips", STAC_ECS_202),
3011+ SND_PCI_QUIRK(0x1019, 0x2813,
3012+ "ECS/PC chips", STAC_ECS_202),
3013+ SND_PCI_QUIRK(0x1019, 0x2814,
3014+ "ECS/PC chips", STAC_ECS_202),
3015+ SND_PCI_QUIRK(0x1019, 0x2815,
3016+ "ECS/PC chips", STAC_ECS_202),
3017+ SND_PCI_QUIRK(0x1019, 0x2816,
3018+ "ECS/PC chips", STAC_ECS_202),
3019+ SND_PCI_QUIRK(0x1019, 0x2817,
3020+ "ECS/PC chips", STAC_ECS_202),
3021+ SND_PCI_QUIRK(0x1019, 0x2818,
3022+ "ECS/PC chips", STAC_ECS_202),
3023+ SND_PCI_QUIRK(0x1019, 0x2819,
3024+ "ECS/PC chips", STAC_ECS_202),
3025+ SND_PCI_QUIRK(0x1019, 0x2820,
3026+ "ECS/PC chips", STAC_ECS_202),
3027 {} /* terminator */
3028 };
3029
3030@@ -2468,7 +2505,7 @@ static int stac92xx_auto_create_multi_out_ctls(struct hda_codec *codec,
3031 }
3032 }
3033
3034- if (cfg->hp_outs > 1) {
3035+ if (cfg->hp_outs > 1 && cfg->line_out_type == AUTO_PIN_LINE_OUT) {
3036 err = stac92xx_add_control(spec,
3037 STAC_CTL_WIDGET_HP_SWITCH,
3038 "Headphone as Line Out Switch", 0);