Gentoo Archives: gentoo-commits

From: "Mike Pagano (mpagano)" <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] linux-patches r1659 - genpatches-2.6/trunk/2.6.32
Date: Fri, 29 Jan 2010 00:11:07
Message-Id: E1NaeRp-0000qs-5B@stork.gentoo.org
1 Author: mpagano
2 Date: 2010-01-29 00:10:52 +0000 (Fri, 29 Jan 2010)
3 New Revision: 1659
4
5 Added:
6 genpatches-2.6/trunk/2.6.32/1006_linux-2.6.32.7.patch
7 Removed:
8 genpatches-2.6/trunk/2.6.32/1900_EFI-GPT-header-read-fix.patch
9 genpatches-2.6/trunk/2.6.32/1910_sector-size-for-EFI-GPT-fix.patch
10 Modified:
11 genpatches-2.6/trunk/2.6.32/0000_README
12 Log:
13 Linux patch 2.6.32.7 and removal of redundant patches
14
15 Modified: genpatches-2.6/trunk/2.6.32/0000_README
16 ===================================================================
17 --- genpatches-2.6/trunk/2.6.32/0000_README 2010-01-26 02:13:25 UTC (rev 1658)
18 +++ genpatches-2.6/trunk/2.6.32/0000_README 2010-01-29 00:10:52 UTC (rev 1659)
19 @@ -63,6 +63,10 @@
20 From: http://www.kernel.org
21 Desc: Linux 2.6.32.6
22
23 +Patch: 1006_linux-2.6.32.7.patch
24 +From: http://www.kernel.org
25 +Desc: Linux 2.6.32.7
26 +
27 Patch: 1900_EFI-GPT-header-read-fix.patch
28 From: http://bugs.gentoo.org/show_bug.cgi?id=296915
29 Desc: Read whole sector with EFI GPT header
30
31 Added: genpatches-2.6/trunk/2.6.32/1006_linux-2.6.32.7.patch
32 ===================================================================
33 --- genpatches-2.6/trunk/2.6.32/1006_linux-2.6.32.7.patch (rev 0)
34 +++ genpatches-2.6/trunk/2.6.32/1006_linux-2.6.32.7.patch 2010-01-29 00:10:52 UTC (rev 1659)
35 @@ -0,0 +1,4401 @@
36 +diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
37 +index ab8300f..50075df 100644
38 +--- a/Documentation/DocBook/Makefile
39 ++++ b/Documentation/DocBook/Makefile
40 +@@ -32,10 +32,10 @@ PS_METHOD = $(prefer-db2x)
41 +
42 + ###
43 + # The targets that may be used.
44 +-PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs media
45 ++PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs xmldoclinks
46 +
47 + BOOKS := $(addprefix $(obj)/,$(DOCBOOKS))
48 +-xmldocs: $(BOOKS)
49 ++xmldocs: $(BOOKS) xmldoclinks
50 + sgmldocs: xmldocs
51 +
52 + PS := $(patsubst %.xml, %.ps, $(BOOKS))
53 +@@ -45,15 +45,24 @@ PDF := $(patsubst %.xml, %.pdf, $(BOOKS))
54 + pdfdocs: $(PDF)
55 +
56 + HTML := $(sort $(patsubst %.xml, %.html, $(BOOKS)))
57 +-htmldocs: media $(HTML)
58 ++htmldocs: $(HTML)
59 + $(call build_main_index)
60 ++ $(call build_images)
61 +
62 + MAN := $(patsubst %.xml, %.9, $(BOOKS))
63 + mandocs: $(MAN)
64 +
65 +-media:
66 +- mkdir -p $(srctree)/Documentation/DocBook/media/
67 +- cp $(srctree)/Documentation/DocBook/dvb/*.png $(srctree)/Documentation/DocBook/v4l/*.gif $(srctree)/Documentation/DocBook/media/
68 ++build_images = mkdir -p $(objtree)/Documentation/DocBook/media/ && \
69 ++ cp $(srctree)/Documentation/DocBook/dvb/*.png $(srctree)/Documentation/DocBook/v4l/*.gif $(objtree)/Documentation/DocBook/media/
70 ++
71 ++xmldoclinks:
72 ++ifneq ($(objtree),$(srctree))
73 ++ for dep in dvb media-entities.tmpl media-indices.tmpl v4l; do \
74 ++ rm -f $(objtree)/Documentation/DocBook/$$dep \
75 ++ && ln -s $(srctree)/Documentation/DocBook/$$dep $(objtree)/Documentation/DocBook/ \
76 ++ || exit; \
77 ++ done
78 ++endif
79 +
80 + installmandocs: mandocs
81 + mkdir -p /usr/local/man/man9/
82 +diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134
83 +index 2620d60..94e255a 100644
84 +--- a/Documentation/video4linux/CARDLIST.saa7134
85 ++++ b/Documentation/video4linux/CARDLIST.saa7134
86 +@@ -172,3 +172,4 @@
87 + 171 -> Beholder BeholdTV X7 [5ace:7595]
88 + 172 -> RoverMedia TV Link Pro FM [19d1:0138]
89 + 173 -> Zolid Hybrid TV Tuner PCI [1131:2004]
90 ++174 -> Asus Europa Hybrid OEM [1043:4847]
91 +diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
92 +index 0976049..36e4fb4 100644
93 +--- a/arch/arm/mach-davinci/dm646x.c
94 ++++ b/arch/arm/mach-davinci/dm646x.c
95 +@@ -789,7 +789,14 @@ static struct davinci_id dm646x_ids[] = {
96 + .part_no = 0xb770,
97 + .manufacturer = 0x017,
98 + .cpu_id = DAVINCI_CPU_ID_DM6467,
99 +- .name = "dm6467",
100 ++ .name = "dm6467_rev1.x",
101 ++ },
102 ++ {
103 ++ .variant = 0x1,
104 ++ .part_no = 0xb770,
105 ++ .manufacturer = 0x017,
106 ++ .cpu_id = DAVINCI_CPU_ID_DM6467,
107 ++ .name = "dm6467_rev3.x",
108 + },
109 + };
110 +
111 +diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
112 +index ae88b14..e82749b 100644
113 +--- a/arch/powerpc/sysdev/fsl_pci.c
114 ++++ b/arch/powerpc/sysdev/fsl_pci.c
115 +@@ -392,8 +392,22 @@ DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8536, quirk_fsl_pcie_header);
116 + DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8641, quirk_fsl_pcie_header);
117 + DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8641D, quirk_fsl_pcie_header);
118 + DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8610, quirk_fsl_pcie_header);
119 ++DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P1011E, quirk_fsl_pcie_header);
120 ++DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P1011, quirk_fsl_pcie_header);
121 ++DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P1013E, quirk_fsl_pcie_header);
122 ++DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P1013, quirk_fsl_pcie_header);
123 ++DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P1020E, quirk_fsl_pcie_header);
124 ++DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P1020, quirk_fsl_pcie_header);
125 ++DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P1022E, quirk_fsl_pcie_header);
126 ++DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P1022, quirk_fsl_pcie_header);
127 ++DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P2010E, quirk_fsl_pcie_header);
128 ++DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P2010, quirk_fsl_pcie_header);
129 + DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P2020E, quirk_fsl_pcie_header);
130 + DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P2020, quirk_fsl_pcie_header);
131 ++DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P4040E, quirk_fsl_pcie_header);
132 ++DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P4040, quirk_fsl_pcie_header);
133 ++DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P4080E, quirk_fsl_pcie_header);
134 ++DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P4080, quirk_fsl_pcie_header);
135 + #endif /* CONFIG_PPC_85xx || CONFIG_PPC_86xx */
136 +
137 + #if defined(CONFIG_PPC_83xx) || defined(CONFIG_PPC_MPC512x)
138 +diff --git a/arch/s390/kvm/intercept.c b/arch/s390/kvm/intercept.c
139 +index ba9d8a7..b400964 100644
140 +--- a/arch/s390/kvm/intercept.c
141 ++++ b/arch/s390/kvm/intercept.c
142 +@@ -213,7 +213,7 @@ static int handle_instruction_and_prog(struct kvm_vcpu *vcpu)
143 + return rc2;
144 + }
145 +
146 +-static const intercept_handler_t intercept_funcs[0x48 >> 2] = {
147 ++static const intercept_handler_t intercept_funcs[] = {
148 + [0x00 >> 2] = handle_noop,
149 + [0x04 >> 2] = handle_instruction,
150 + [0x08 >> 2] = handle_prog,
151 +@@ -230,7 +230,7 @@ int kvm_handle_sie_intercept(struct kvm_vcpu *vcpu)
152 + intercept_handler_t func;
153 + u8 code = vcpu->arch.sie_block->icptcode;
154 +
155 +- if (code & 3 || code > 0x48)
156 ++ if (code & 3 || (code >> 2) >= ARRAY_SIZE(intercept_funcs))
157 + return -ENOTSUPP;
158 + func = intercept_funcs[code >> 2];
159 + if (func)
160 +diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
161 +index 40e1835..a2a03cf 100644
162 +--- a/arch/x86/kernel/cpu/intel.c
163 ++++ b/arch/x86/kernel/cpu/intel.c
164 +@@ -70,7 +70,6 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
165 + if (c->x86_power & (1 << 8)) {
166 + set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
167 + set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC);
168 +- set_cpu_cap(c, X86_FEATURE_TSC_RELIABLE);
169 + sched_clock_stable = 1;
170 + }
171 +
172 +diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c
173 +index f8590c5..0c91110 100644
174 +--- a/arch/x86/kernel/cpuid.c
175 ++++ b/arch/x86/kernel/cpuid.c
176 +@@ -234,7 +234,7 @@ static void __exit cpuid_exit(void)
177 + for_each_online_cpu(cpu)
178 + cpuid_device_destroy(cpu);
179 + class_destroy(cpuid_class);
180 +- unregister_chrdev(CPUID_MAJOR, "cpu/cpuid");
181 ++ __unregister_chrdev(CPUID_MAJOR, 0, NR_CPUS, "cpu/cpuid");
182 + unregister_hotcpu_notifier(&cpuid_class_cpu_notifier);
183 + }
184 +
185 +diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
186 +index b42e63b..5eaeb5e 100644
187 +--- a/arch/x86/kernel/msr.c
188 ++++ b/arch/x86/kernel/msr.c
189 +@@ -290,7 +290,7 @@ static void __exit msr_exit(void)
190 + for_each_online_cpu(cpu)
191 + msr_device_destroy(cpu);
192 + class_destroy(msr_class);
193 +- unregister_chrdev(MSR_MAJOR, "cpu/msr");
194 ++ __unregister_chrdev(MSR_MAJOR, 0, NR_CPUS, "cpu/msr");
195 + unregister_hotcpu_notifier(&msr_class_cpu_notifier);
196 + }
197 +
198 +diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
199 +index cd982f4..597683a 100644
200 +--- a/arch/x86/kernel/tsc.c
201 ++++ b/arch/x86/kernel/tsc.c
202 +@@ -763,6 +763,7 @@ void mark_tsc_unstable(char *reason)
203 + {
204 + if (!tsc_unstable) {
205 + tsc_unstable = 1;
206 ++ sched_clock_stable = 0;
207 + printk(KERN_INFO "Marking TSC unstable due to %s\n", reason);
208 + /* Change only the rating, when not registered */
209 + if (clocksource_tsc.mult)
210 +diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
211 +index 41659fb..8dfeaaa 100644
212 +--- a/arch/x86/kvm/lapic.c
213 ++++ b/arch/x86/kvm/lapic.c
214 +@@ -374,6 +374,12 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode,
215 + if (unlikely(!apic_enabled(apic)))
216 + break;
217 +
218 ++ if (trig_mode) {
219 ++ apic_debug("level trig mode for vector %d", vector);
220 ++ apic_set_vector(vector, apic->regs + APIC_TMR);
221 ++ } else
222 ++ apic_clear_vector(vector, apic->regs + APIC_TMR);
223 ++
224 + result = !apic_test_and_set_irr(vector, apic);
225 + trace_kvm_apic_accept_irq(vcpu->vcpu_id, delivery_mode,
226 + trig_mode, vector, !result);
227 +@@ -384,11 +390,6 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode,
228 + break;
229 + }
230 +
231 +- if (trig_mode) {
232 +- apic_debug("level trig mode for vector %d", vector);
233 +- apic_set_vector(vector, apic->regs + APIC_TMR);
234 +- } else
235 +- apic_clear_vector(vector, apic->regs + APIC_TMR);
236 + kvm_vcpu_kick(vcpu);
237 + break;
238 +
239 +diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
240 +index 818b92a..3a01519 100644
241 +--- a/arch/x86/kvm/mmu.c
242 ++++ b/arch/x86/kvm/mmu.c
243 +@@ -477,7 +477,7 @@ static int host_mapping_level(struct kvm *kvm, gfn_t gfn)
244 +
245 + addr = gfn_to_hva(kvm, gfn);
246 + if (kvm_is_error_hva(addr))
247 +- return page_size;
248 ++ return PT_PAGE_TABLE_LEVEL;
249 +
250 + down_read(&current->mm->mmap_sem);
251 + vma = find_vma(current->mm, addr);
252 +@@ -515,11 +515,9 @@ static int mapping_level(struct kvm_vcpu *vcpu, gfn_t large_gfn)
253 + if (host_level == PT_PAGE_TABLE_LEVEL)
254 + return host_level;
255 +
256 +- for (level = PT_DIRECTORY_LEVEL; level <= host_level; ++level) {
257 +-
258 ++ for (level = PT_DIRECTORY_LEVEL; level <= host_level; ++level)
259 + if (has_wrprotected_page(vcpu->kvm, large_gfn, level))
260 + break;
261 +- }
262 +
263 + return level - 1;
264 + }
265 +diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
266 +index 85e12cd..5fa3325 100644
267 +--- a/arch/x86/kvm/paging_tmpl.h
268 ++++ b/arch/x86/kvm/paging_tmpl.h
269 +@@ -150,7 +150,9 @@ walk:
270 + walker->table_gfn[walker->level - 1] = table_gfn;
271 + walker->pte_gpa[walker->level - 1] = pte_gpa;
272 +
273 +- kvm_read_guest(vcpu->kvm, pte_gpa, &pte, sizeof(pte));
274 ++ if (kvm_read_guest(vcpu->kvm, pte_gpa, &pte, sizeof(pte)))
275 ++ goto not_present;
276 ++
277 + trace_kvm_mmu_paging_element(pte, walker->level);
278 +
279 + if (!is_present_gpte(pte))
280 +diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
281 +index 97b31fa..6378e07 100644
282 +--- a/arch/x86/kvm/x86.c
283 ++++ b/arch/x86/kvm/x86.c
284 +@@ -4766,12 +4766,13 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
285 + GFP_KERNEL);
286 + if (!vcpu->arch.mce_banks) {
287 + r = -ENOMEM;
288 +- goto fail_mmu_destroy;
289 ++ goto fail_free_lapic;
290 + }
291 + vcpu->arch.mcg_cap = KVM_MAX_MCE_BANKS;
292 +
293 + return 0;
294 +-
295 ++fail_free_lapic:
296 ++ kvm_free_lapic(vcpu);
297 + fail_mmu_destroy:
298 + kvm_mmu_destroy(vcpu);
299 + fail_free_pio_data:
300 +@@ -4782,6 +4783,7 @@ fail:
301 +
302 + void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu)
303 + {
304 ++ kfree(vcpu->arch.mce_banks);
305 + kvm_free_lapic(vcpu);
306 + down_read(&vcpu->kvm->slots_lock);
307 + kvm_mmu_destroy(vcpu);
308 +diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
309 +index bbd066e..a8f3ca6 100644
310 +--- a/drivers/acpi/processor_idle.c
311 ++++ b/drivers/acpi/processor_idle.c
312 +@@ -299,6 +299,17 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
313 + pr->power.states[ACPI_STATE_C2].latency = acpi_gbl_FADT.C2latency;
314 + pr->power.states[ACPI_STATE_C3].latency = acpi_gbl_FADT.C3latency;
315 +
316 ++ /*
317 ++ * FADT specified C2 latency must be less than or equal to
318 ++ * 100 microseconds.
319 ++ */
320 ++ if (acpi_gbl_FADT.C2latency > ACPI_PROCESSOR_MAX_C2_LATENCY) {
321 ++ ACPI_DEBUG_PRINT((ACPI_DB_INFO,
322 ++ "C2 latency too large [%d]\n", acpi_gbl_FADT.C2latency));
323 ++ /* invalidate C2 */
324 ++ pr->power.states[ACPI_STATE_C2].address = 0;
325 ++ }
326 ++
327 + ACPI_DEBUG_PRINT((ACPI_DB_INFO,
328 + "lvl2[0x%08x] lvl3[0x%08x]\n",
329 + pr->power.states[ACPI_STATE_C2].address,
330 +@@ -495,16 +506,6 @@ static void acpi_processor_power_verify_c2(struct acpi_processor_cx *cx)
331 + return;
332 +
333 + /*
334 +- * C2 latency must be less than or equal to 100
335 +- * microseconds.
336 +- */
337 +- else if (cx->latency > ACPI_PROCESSOR_MAX_C2_LATENCY) {
338 +- ACPI_DEBUG_PRINT((ACPI_DB_INFO,
339 +- "latency too large [%d]\n", cx->latency));
340 +- return;
341 +- }
342 +-
343 +- /*
344 + * Otherwise we've met all of our C2 requirements.
345 + * Normalize the C2 latency to expidite policy
346 + */
347 +diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
348 +index a3241a1..9519c77 100644
349 +--- a/drivers/ata/ahci.c
350 ++++ b/drivers/ata/ahci.c
351 +@@ -113,6 +113,7 @@ enum {
352 + board_ahci_mcp65 = 6,
353 + board_ahci_nopmp = 7,
354 + board_ahci_yesncq = 8,
355 ++ board_ahci_nosntf = 9,
356 +
357 + /* global controller registers */
358 + HOST_CAP = 0x00, /* host capabilities */
359 +@@ -235,6 +236,7 @@ enum {
360 + AHCI_HFLAG_NO_SUSPEND = (1 << 10), /* don't suspend */
361 + AHCI_HFLAG_SRST_TOUT_IS_OFFLINE = (1 << 11), /* treat SRST timeout as
362 + link offline */
363 ++ AHCI_HFLAG_NO_SNTF = (1 << 12), /* no sntf */
364 +
365 + /* ap->flags bits */
366 +
367 +@@ -508,7 +510,7 @@ static const struct ata_port_info ahci_port_info[] = {
368 + .udma_mask = ATA_UDMA6,
369 + .port_ops = &ahci_ops,
370 + },
371 +- /* board_ahci_yesncq */
372 ++ [board_ahci_yesncq] =
373 + {
374 + AHCI_HFLAGS (AHCI_HFLAG_YES_NCQ),
375 + .flags = AHCI_FLAG_COMMON,
376 +@@ -516,6 +518,14 @@ static const struct ata_port_info ahci_port_info[] = {
377 + .udma_mask = ATA_UDMA6,
378 + .port_ops = &ahci_ops,
379 + },
380 ++ [board_ahci_nosntf] =
381 ++ {
382 ++ AHCI_HFLAGS (AHCI_HFLAG_NO_SNTF),
383 ++ .flags = AHCI_FLAG_COMMON,
384 ++ .pio_mask = ATA_PIO4,
385 ++ .udma_mask = ATA_UDMA6,
386 ++ .port_ops = &ahci_ops,
387 ++ },
388 + };
389 +
390 + static const struct pci_device_id ahci_pci_tbl[] = {
391 +@@ -531,7 +541,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {
392 + { PCI_VDEVICE(INTEL, 0x2683), board_ahci }, /* ESB2 */
393 + { PCI_VDEVICE(INTEL, 0x27c6), board_ahci }, /* ICH7-M DH */
394 + { PCI_VDEVICE(INTEL, 0x2821), board_ahci }, /* ICH8 */
395 +- { PCI_VDEVICE(INTEL, 0x2822), board_ahci }, /* ICH8 */
396 ++ { PCI_VDEVICE(INTEL, 0x2822), board_ahci_nosntf }, /* ICH8 */
397 + { PCI_VDEVICE(INTEL, 0x2824), board_ahci }, /* ICH8 */
398 + { PCI_VDEVICE(INTEL, 0x2829), board_ahci }, /* ICH8M */
399 + { PCI_VDEVICE(INTEL, 0x282a), board_ahci }, /* ICH8M */
400 +@@ -849,6 +859,12 @@ static void ahci_save_initial_config(struct pci_dev *pdev,
401 + cap &= ~HOST_CAP_PMP;
402 + }
403 +
404 ++ if ((cap & HOST_CAP_SNTF) && (hpriv->flags & AHCI_HFLAG_NO_SNTF)) {
405 ++ dev_printk(KERN_INFO, &pdev->dev,
406 ++ "controller can't do SNTF, turning off CAP_SNTF\n");
407 ++ cap &= ~HOST_CAP_SNTF;
408 ++ }
409 ++
410 + if (pdev->vendor == PCI_VENDOR_ID_JMICRON && pdev->device == 0x2361 &&
411 + port_map != 1) {
412 + dev_printk(KERN_INFO, &pdev->dev,
413 +diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
414 +index 9ac4e37..0c6155f 100644
415 +--- a/drivers/ata/ata_piix.c
416 ++++ b/drivers/ata/ata_piix.c
417 +@@ -869,10 +869,10 @@ static void do_pata_set_dmamode(struct ata_port *ap, struct ata_device *adev, in
418 + (timings[pio][1] << 8);
419 + }
420 +
421 +- if (ap->udma_mask) {
422 ++ if (ap->udma_mask)
423 + udma_enable &= ~(1 << devid);
424 +- pci_write_config_word(dev, master_port, master_data);
425 +- }
426 ++
427 ++ pci_write_config_word(dev, master_port, master_data);
428 + }
429 + /* Don't scribble on 0x48 if the controller does not support UDMA */
430 + if (ap->udma_mask)
431 +diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
432 +index a1cb5af..33faaa2 100644
433 +--- a/drivers/base/devtmpfs.c
434 ++++ b/drivers/base/devtmpfs.c
435 +@@ -353,6 +353,7 @@ int __init devtmpfs_init(void)
436 + {
437 + int err;
438 + struct vfsmount *mnt;
439 ++ char options[] = "mode=0755";
440 +
441 + err = register_filesystem(&dev_fs_type);
442 + if (err) {
443 +@@ -361,7 +362,7 @@ int __init devtmpfs_init(void)
444 + return err;
445 + }
446 +
447 +- mnt = kern_mount(&dev_fs_type);
448 ++ mnt = kern_mount_data(&dev_fs_type, options);
449 + if (IS_ERR(mnt)) {
450 + err = PTR_ERR(mnt);
451 + printk(KERN_ERR "devtmpfs: unable to create devtmpfs %i\n", err);
452 +diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
453 +index 938100f..3a2ccb0 100644
454 +--- a/drivers/firmware/dmi_scan.c
455 ++++ b/drivers/firmware/dmi_scan.c
456 +@@ -429,7 +429,7 @@ static bool dmi_matches(const struct dmi_system_id *dmi)
457 + for (i = 0; i < ARRAY_SIZE(dmi->matches); i++) {
458 + int s = dmi->matches[i].slot;
459 + if (s == DMI_NONE)
460 +- continue;
461 ++ break;
462 + if (dmi_ident[s]
463 + && strstr(dmi_ident[s], dmi->matches[i].substr))
464 + continue;
465 +@@ -440,6 +440,15 @@ static bool dmi_matches(const struct dmi_system_id *dmi)
466 + }
467 +
468 + /**
469 ++ * dmi_is_end_of_table - check for end-of-table marker
470 ++ * @dmi: pointer to the dmi_system_id structure to check
471 ++ */
472 ++static bool dmi_is_end_of_table(const struct dmi_system_id *dmi)
473 ++{
474 ++ return dmi->matches[0].slot == DMI_NONE;
475 ++}
476 ++
477 ++/**
478 + * dmi_check_system - check system DMI data
479 + * @list: array of dmi_system_id structures to match against
480 + * All non-null elements of the list must match
481 +@@ -457,7 +466,7 @@ int dmi_check_system(const struct dmi_system_id *list)
482 + int count = 0;
483 + const struct dmi_system_id *d;
484 +
485 +- for (d = list; d->ident; d++)
486 ++ for (d = list; !dmi_is_end_of_table(d); d++)
487 + if (dmi_matches(d)) {
488 + count++;
489 + if (d->callback && d->callback(d))
490 +@@ -484,7 +493,7 @@ const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list)
491 + {
492 + const struct dmi_system_id *d;
493 +
494 +- for (d = list; d->ident; d++)
495 ++ for (d = list; !dmi_is_end_of_table(d); d++)
496 + if (dmi_matches(d))
497 + return d;
498 +
499 +diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
500 +index 03bd703..5d901f6 100644
501 +--- a/drivers/hid/usbhid/hid-core.c
502 ++++ b/drivers/hid/usbhid/hid-core.c
503 +@@ -998,7 +998,8 @@ static int usbhid_start(struct hid_device *hid)
504 + usbhid->urbctrl->transfer_dma = usbhid->ctrlbuf_dma;
505 + usbhid->urbctrl->transfer_flags |= (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP);
506 +
507 +- usbhid_init_reports(hid);
508 ++ if (!(hid->quirks & HID_QUIRK_NO_INIT_REPORTS))
509 ++ usbhid_init_reports(hid);
510 +
511 + set_bit(HID_STARTED, &usbhid->iofl);
512 +
513 +diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
514 +index 0d9045a..5713b93 100644
515 +--- a/drivers/hid/usbhid/hid-quirks.c
516 ++++ b/drivers/hid/usbhid/hid-quirks.c
517 +@@ -280,7 +280,7 @@ u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct)
518 + if (idVendor == USB_VENDOR_ID_NCR &&
519 + idProduct >= USB_DEVICE_ID_NCR_FIRST &&
520 + idProduct <= USB_DEVICE_ID_NCR_LAST)
521 +- return HID_QUIRK_NOGET;
522 ++ return HID_QUIRK_NO_INIT_REPORTS;
523 +
524 + down_read(&dquirks_rwsem);
525 + bl_entry = usbhid_exists_dquirk(idVendor, idProduct);
526 +diff --git a/drivers/hwmon/fschmd.c b/drivers/hwmon/fschmd.c
527 +index da1b1f9..f600813 100644
528 +--- a/drivers/hwmon/fschmd.c
529 ++++ b/drivers/hwmon/fschmd.c
530 +@@ -767,6 +767,7 @@ leave:
531 + static int watchdog_open(struct inode *inode, struct file *filp)
532 + {
533 + struct fschmd_data *pos, *data = NULL;
534 ++ int watchdog_is_open;
535 +
536 + /* We get called from drivers/char/misc.c with misc_mtx hold, and we
537 + call misc_register() from fschmd_probe() with watchdog_data_mutex
538 +@@ -781,10 +782,12 @@ static int watchdog_open(struct inode *inode, struct file *filp)
539 + }
540 + }
541 + /* Note we can never not have found data, so we don't check for this */
542 +- kref_get(&data->kref);
543 ++ watchdog_is_open = test_and_set_bit(0, &data->watchdog_is_open);
544 ++ if (!watchdog_is_open)
545 ++ kref_get(&data->kref);
546 + mutex_unlock(&watchdog_data_mutex);
547 +
548 +- if (test_and_set_bit(0, &data->watchdog_is_open))
549 ++ if (watchdog_is_open)
550 + return -EBUSY;
551 +
552 + /* Start the watchdog */
553 +diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
554 +index 2bf5116..df3eb8c 100644
555 +--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
556 ++++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
557 +@@ -884,6 +884,7 @@ struct ipoib_neigh *ipoib_neigh_alloc(struct neighbour *neighbour,
558 +
559 + neigh->neighbour = neighbour;
560 + neigh->dev = dev;
561 ++ memset(&neigh->dgid.raw, 0, sizeof (union ib_gid));
562 + *to_ipoib_neigh(neighbour) = neigh;
563 + skb_queue_head_init(&neigh->queue);
564 + ipoib_cm_set(neigh, NULL);
565 +diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
566 +index f361106..fc8823b 100644
567 +--- a/drivers/input/mouse/alps.c
568 ++++ b/drivers/input/mouse/alps.c
569 +@@ -5,6 +5,7 @@
570 + * Copyright (c) 2003-2005 Peter Osterlund <petero2@×××××.com>
571 + * Copyright (c) 2004 Dmitry Torokhov <dtor@××××.ru>
572 + * Copyright (c) 2005 Vojtech Pavlik <vojtech@××××.cz>
573 ++ * Copyright (c) 2009 Sebastian Kapfer <sebastian_kapfer@×××.net>
574 + *
575 + * ALPS detection, tap switching and status querying info is taken from
576 + * tpconfig utility (by C. Scott Ananian and Bruce Kall).
577 +@@ -35,6 +36,8 @@
578 + #define ALPS_OLDPROTO 0x10
579 + #define ALPS_PASS 0x20
580 + #define ALPS_FW_BK_2 0x40
581 ++#define ALPS_PS2_INTERLEAVED 0x80 /* 3-byte PS/2 packet interleaved with
582 ++ 6-byte ALPS packet */
583 +
584 + static const struct alps_model_info alps_model_data[] = {
585 + { { 0x32, 0x02, 0x14 }, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT }, /* Toshiba Salellite Pro M10 */
586 +@@ -55,7 +58,9 @@ static const struct alps_model_info alps_model_data[] = {
587 + { { 0x20, 0x02, 0x0e }, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT }, /* XXX */
588 + { { 0x22, 0x02, 0x0a }, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT },
589 + { { 0x22, 0x02, 0x14 }, 0xff, 0xff, ALPS_PASS | ALPS_DUALPOINT }, /* Dell Latitude D600 */
590 +- { { 0x62, 0x02, 0x14 }, 0xcf, 0xcf, ALPS_PASS | ALPS_DUALPOINT }, /* Dell Latitude E6500 */
591 ++ /* Dell Latitude E5500, E6400, E6500, Precision M4400 */
592 ++ { { 0x62, 0x02, 0x14 }, 0xcf, 0xcf,
593 ++ ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED },
594 + { { 0x73, 0x02, 0x50 }, 0xcf, 0xcf, ALPS_FW_BK_1 }, /* Dell Vostro 1400 */
595 + };
596 +
597 +@@ -66,20 +71,88 @@ static const struct alps_model_info alps_model_data[] = {
598 + */
599 +
600 + /*
601 +- * ALPS abolute Mode - new format
602 ++ * PS/2 packet format
603 ++ *
604 ++ * byte 0: 0 0 YSGN XSGN 1 M R L
605 ++ * byte 1: X7 X6 X5 X4 X3 X2 X1 X0
606 ++ * byte 2: Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0
607 ++ *
608 ++ * Note that the device never signals overflow condition.
609 ++ *
610 ++ * ALPS absolute Mode - new format
611 + *
612 + * byte 0: 1 ? ? ? 1 ? ? ?
613 + * byte 1: 0 x6 x5 x4 x3 x2 x1 x0
614 +- * byte 2: 0 x10 x9 x8 x7 ? fin ges
615 ++ * byte 2: 0 x10 x9 x8 x7 ? fin ges
616 + * byte 3: 0 y9 y8 y7 1 M R L
617 + * byte 4: 0 y6 y5 y4 y3 y2 y1 y0
618 + * byte 5: 0 z6 z5 z4 z3 z2 z1 z0
619 + *
620 ++ * Dualpoint device -- interleaved packet format
621 ++ *
622 ++ * byte 0: 1 1 0 0 1 1 1 1
623 ++ * byte 1: 0 x6 x5 x4 x3 x2 x1 x0
624 ++ * byte 2: 0 x10 x9 x8 x7 0 fin ges
625 ++ * byte 3: 0 0 YSGN XSGN 1 1 1 1
626 ++ * byte 4: X7 X6 X5 X4 X3 X2 X1 X0
627 ++ * byte 5: Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0
628 ++ * byte 6: 0 y9 y8 y7 1 m r l
629 ++ * byte 7: 0 y6 y5 y4 y3 y2 y1 y0
630 ++ * byte 8: 0 z6 z5 z4 z3 z2 z1 z0
631 ++ *
632 ++ * CAPITALS = stick, miniscules = touchpad
633 ++ *
634 + * ?'s can have different meanings on different models,
635 + * such as wheel rotation, extra buttons, stick buttons
636 + * on a dualpoint, etc.
637 + */
638 +
639 ++static bool alps_is_valid_first_byte(const struct alps_model_info *model,
640 ++ unsigned char data)
641 ++{
642 ++ return (data & model->mask0) == model->byte0;
643 ++}
644 ++
645 ++static void alps_report_buttons(struct psmouse *psmouse,
646 ++ struct input_dev *dev1, struct input_dev *dev2,
647 ++ int left, int right, int middle)
648 ++{
649 ++ struct alps_data *priv = psmouse->private;
650 ++ const struct alps_model_info *model = priv->i;
651 ++
652 ++ if (model->flags & ALPS_PS2_INTERLEAVED) {
653 ++ struct input_dev *dev;
654 ++
655 ++ /*
656 ++ * If shared button has already been reported on the
657 ++ * other device (dev2) then this event should be also
658 ++ * sent through that device.
659 ++ */
660 ++ dev = test_bit(BTN_LEFT, dev2->key) ? dev2 : dev1;
661 ++ input_report_key(dev, BTN_LEFT, left);
662 ++
663 ++ dev = test_bit(BTN_RIGHT, dev2->key) ? dev2 : dev1;
664 ++ input_report_key(dev, BTN_RIGHT, right);
665 ++
666 ++ dev = test_bit(BTN_MIDDLE, dev2->key) ? dev2 : dev1;
667 ++ input_report_key(dev, BTN_MIDDLE, middle);
668 ++
669 ++ /*
670 ++ * Sync the _other_ device now, we'll do the first
671 ++ * device later once we report the rest of the events.
672 ++ */
673 ++ input_sync(dev2);
674 ++ } else {
675 ++ /*
676 ++ * For devices with non-interleaved packets we know what
677 ++ * device buttons belong to so we can simply report them.
678 ++ */
679 ++ input_report_key(dev1, BTN_LEFT, left);
680 ++ input_report_key(dev1, BTN_RIGHT, right);
681 ++ input_report_key(dev1, BTN_MIDDLE, middle);
682 ++ }
683 ++}
684 ++
685 + static void alps_process_packet(struct psmouse *psmouse)
686 + {
687 + struct alps_data *priv = psmouse->private;
688 +@@ -89,18 +162,6 @@ static void alps_process_packet(struct psmouse *psmouse)
689 + int x, y, z, ges, fin, left, right, middle;
690 + int back = 0, forward = 0;
691 +
692 +- if ((packet[0] & 0xc8) == 0x08) { /* 3-byte PS/2 packet */
693 +- input_report_key(dev2, BTN_LEFT, packet[0] & 1);
694 +- input_report_key(dev2, BTN_RIGHT, packet[0] & 2);
695 +- input_report_key(dev2, BTN_MIDDLE, packet[0] & 4);
696 +- input_report_rel(dev2, REL_X,
697 +- packet[1] ? packet[1] - ((packet[0] << 4) & 0x100) : 0);
698 +- input_report_rel(dev2, REL_Y,
699 +- packet[2] ? ((packet[0] << 3) & 0x100) - packet[2] : 0);
700 +- input_sync(dev2);
701 +- return;
702 +- }
703 +-
704 + if (priv->i->flags & ALPS_OLDPROTO) {
705 + left = packet[2] & 0x10;
706 + right = packet[2] & 0x08;
707 +@@ -136,18 +197,13 @@ static void alps_process_packet(struct psmouse *psmouse)
708 + input_report_rel(dev2, REL_X, (x > 383 ? (x - 768) : x));
709 + input_report_rel(dev2, REL_Y, -(y > 255 ? (y - 512) : y));
710 +
711 +- input_report_key(dev2, BTN_LEFT, left);
712 +- input_report_key(dev2, BTN_RIGHT, right);
713 +- input_report_key(dev2, BTN_MIDDLE, middle);
714 ++ alps_report_buttons(psmouse, dev2, dev, left, right, middle);
715 +
716 +- input_sync(dev);
717 + input_sync(dev2);
718 + return;
719 + }
720 +
721 +- input_report_key(dev, BTN_LEFT, left);
722 +- input_report_key(dev, BTN_RIGHT, right);
723 +- input_report_key(dev, BTN_MIDDLE, middle);
724 ++ alps_report_buttons(psmouse, dev, dev2, left, right, middle);
725 +
726 + /* Convert hardware tap to a reasonable Z value */
727 + if (ges && !fin) z = 40;
728 +@@ -188,25 +244,168 @@ static void alps_process_packet(struct psmouse *psmouse)
729 + input_sync(dev);
730 + }
731 +
732 ++static void alps_report_bare_ps2_packet(struct psmouse *psmouse,
733 ++ unsigned char packet[],
734 ++ bool report_buttons)
735 ++{
736 ++ struct alps_data *priv = psmouse->private;
737 ++ struct input_dev *dev2 = priv->dev2;
738 ++
739 ++ if (report_buttons)
740 ++ alps_report_buttons(psmouse, dev2, psmouse->dev,
741 ++ packet[0] & 1, packet[0] & 2, packet[0] & 4);
742 ++
743 ++ input_report_rel(dev2, REL_X,
744 ++ packet[1] ? packet[1] - ((packet[0] << 4) & 0x100) : 0);
745 ++ input_report_rel(dev2, REL_Y,
746 ++ packet[2] ? ((packet[0] << 3) & 0x100) - packet[2] : 0);
747 ++
748 ++ input_sync(dev2);
749 ++}
750 ++
751 ++static psmouse_ret_t alps_handle_interleaved_ps2(struct psmouse *psmouse)
752 ++{
753 ++ struct alps_data *priv = psmouse->private;
754 ++
755 ++ if (psmouse->pktcnt < 6)
756 ++ return PSMOUSE_GOOD_DATA;
757 ++
758 ++ if (psmouse->pktcnt == 6) {
759 ++ /*
760 ++ * Start a timer to flush the packet if it ends up last
761 ++ * 6-byte packet in the stream. Timer needs to fire
762 ++ * psmouse core times out itself. 20 ms should be enough
763 ++ * to decide if we are getting more data or not.
764 ++ */
765 ++ mod_timer(&priv->timer, jiffies + msecs_to_jiffies(20));
766 ++ return PSMOUSE_GOOD_DATA;
767 ++ }
768 ++
769 ++ del_timer(&priv->timer);
770 ++
771 ++ if (psmouse->packet[6] & 0x80) {
772 ++
773 ++ /*
774 ++ * Highest bit is set - that means we either had
775 ++ * complete ALPS packet and this is start of the
776 ++ * next packet or we got garbage.
777 ++ */
778 ++
779 ++ if (((psmouse->packet[3] |
780 ++ psmouse->packet[4] |
781 ++ psmouse->packet[5]) & 0x80) ||
782 ++ (!alps_is_valid_first_byte(priv->i, psmouse->packet[6]))) {
783 ++ dbg("refusing packet %x %x %x %x "
784 ++ "(suspected interleaved ps/2)\n",
785 ++ psmouse->packet[3], psmouse->packet[4],
786 ++ psmouse->packet[5], psmouse->packet[6]);
787 ++ return PSMOUSE_BAD_DATA;
788 ++ }
789 ++
790 ++ alps_process_packet(psmouse);
791 ++
792 ++ /* Continue with the next packet */
793 ++ psmouse->packet[0] = psmouse->packet[6];
794 ++ psmouse->pktcnt = 1;
795 ++
796 ++ } else {
797 ++
798 ++ /*
799 ++ * High bit is 0 - that means that we indeed got a PS/2
800 ++ * packet in the middle of ALPS packet.
801 ++ *
802 ++ * There is also possibility that we got 6-byte ALPS
803 ++ * packet followed by 3-byte packet from trackpoint. We
804 ++ * can not distinguish between these 2 scenarios but
805 ++ * becase the latter is unlikely to happen in course of
806 ++ * normal operation (user would need to press all
807 ++ * buttons on the pad and start moving trackpoint
808 ++ * without touching the pad surface) we assume former.
809 ++ * Even if we are wrong the wost thing that would happen
810 ++ * the cursor would jump but we should not get protocol
811 ++ * desynchronization.
812 ++ */
813 ++
814 ++ alps_report_bare_ps2_packet(psmouse, &psmouse->packet[3],
815 ++ false);
816 ++
817 ++ /*
818 ++ * Continue with the standard ALPS protocol handling,
819 ++ * but make sure we won't process it as an interleaved
820 ++ * packet again, which may happen if all buttons are
821 ++ * pressed. To avoid this let's reset the 4th bit which
822 ++ * is normally 1.
823 ++ */
824 ++ psmouse->packet[3] = psmouse->packet[6] & 0xf7;
825 ++ psmouse->pktcnt = 4;
826 ++ }
827 ++
828 ++ return PSMOUSE_GOOD_DATA;
829 ++}
830 ++
831 ++static void alps_flush_packet(unsigned long data)
832 ++{
833 ++ struct psmouse *psmouse = (struct psmouse *)data;
834 ++
835 ++ serio_pause_rx(psmouse->ps2dev.serio);
836 ++
837 ++ if (psmouse->pktcnt == 6) {
838 ++
839 ++ /*
840 ++ * We did not any more data in reasonable amount of time.
841 ++ * Validate the last 3 bytes and process as a standard
842 ++ * ALPS packet.
843 ++ */
844 ++ if ((psmouse->packet[3] |
845 ++ psmouse->packet[4] |
846 ++ psmouse->packet[5]) & 0x80) {
847 ++ dbg("refusing packet %x %x %x "
848 ++ "(suspected interleaved ps/2)\n",
849 ++ psmouse->packet[3], psmouse->packet[4],
850 ++ psmouse->packet[5]);
851 ++ } else {
852 ++ alps_process_packet(psmouse);
853 ++ }
854 ++ psmouse->pktcnt = 0;
855 ++ }
856 ++
857 ++ serio_continue_rx(psmouse->ps2dev.serio);
858 ++}
859 ++
860 + static psmouse_ret_t alps_process_byte(struct psmouse *psmouse)
861 + {
862 + struct alps_data *priv = psmouse->private;
863 ++ const struct alps_model_info *model = priv->i;
864 +
865 + if ((psmouse->packet[0] & 0xc8) == 0x08) { /* PS/2 packet */
866 + if (psmouse->pktcnt == 3) {
867 +- alps_process_packet(psmouse);
868 ++ alps_report_bare_ps2_packet(psmouse, psmouse->packet,
869 ++ true);
870 + return PSMOUSE_FULL_PACKET;
871 + }
872 + return PSMOUSE_GOOD_DATA;
873 + }
874 +
875 +- if ((psmouse->packet[0] & priv->i->mask0) != priv->i->byte0)
876 ++ /* Check for PS/2 packet stuffed in the middle of ALPS packet. */
877 ++
878 ++ if ((model->flags & ALPS_PS2_INTERLEAVED) &&
879 ++ psmouse->pktcnt >= 4 && (psmouse->packet[3] & 0x0f) == 0x0f) {
880 ++ return alps_handle_interleaved_ps2(psmouse);
881 ++ }
882 ++
883 ++ if (!alps_is_valid_first_byte(model, psmouse->packet[0])) {
884 ++ dbg("refusing packet[0] = %x (mask0 = %x, byte0 = %x)\n",
885 ++ psmouse->packet[0], model->mask0, model->byte0);
886 + return PSMOUSE_BAD_DATA;
887 ++ }
888 +
889 + /* Bytes 2 - 6 should have 0 in the highest bit */
890 + if (psmouse->pktcnt >= 2 && psmouse->pktcnt <= 6 &&
891 +- (psmouse->packet[psmouse->pktcnt - 1] & 0x80))
892 ++ (psmouse->packet[psmouse->pktcnt - 1] & 0x80)) {
893 ++ dbg("refusing packet[%i] = %x\n",
894 ++ psmouse->pktcnt - 1, psmouse->packet[psmouse->pktcnt - 1]);
895 + return PSMOUSE_BAD_DATA;
896 ++ }
897 +
898 + if (psmouse->pktcnt == 6) {
899 + alps_process_packet(psmouse);
900 +@@ -445,6 +644,7 @@ static void alps_disconnect(struct psmouse *psmouse)
901 + struct alps_data *priv = psmouse->private;
902 +
903 + psmouse_reset(psmouse);
904 ++ del_timer_sync(&priv->timer);
905 + input_unregister_device(priv->dev2);
906 + kfree(priv);
907 + }
908 +@@ -461,6 +661,8 @@ int alps_init(struct psmouse *psmouse)
909 + goto init_fail;
910 +
911 + priv->dev2 = dev2;
912 ++ setup_timer(&priv->timer, alps_flush_packet, (unsigned long)psmouse);
913 ++
914 + psmouse->private = priv;
915 +
916 + if (alps_hw_init(psmouse, &version))
917 +diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h
918 +index bc87936..904ed8b 100644
919 +--- a/drivers/input/mouse/alps.h
920 ++++ b/drivers/input/mouse/alps.h
921 +@@ -23,6 +23,7 @@ struct alps_data {
922 + char phys[32]; /* Phys */
923 + const struct alps_model_info *i;/* Info */
924 + int prev_fin; /* Finger bit from previous packet */
925 ++ struct timer_list timer;
926 + };
927 +
928 + #ifdef CONFIG_MOUSE_PS2_ALPS
929 +diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
930 +index 2bcf1ac..2a5982e 100644
931 +--- a/drivers/input/serio/i8042-x86ia64io.h
932 ++++ b/drivers/input/serio/i8042-x86ia64io.h
933 +@@ -67,10 +67,12 @@ static inline void i8042_write_command(int val)
934 +
935 + #include <linux/dmi.h>
936 +
937 +-static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = {
938 ++static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = {
939 + {
940 +- /* AUX LOOP command does not raise AUX IRQ */
941 +- .ident = "Arima-Rioworks HDAMB",
942 ++ /*
943 ++ * Arima-Rioworks HDAMB -
944 ++ * AUX LOOP command does not raise AUX IRQ
945 ++ */
946 + .matches = {
947 + DMI_MATCH(DMI_BOARD_VENDOR, "RIOWORKS"),
948 + DMI_MATCH(DMI_BOARD_NAME, "HDAMB"),
949 +@@ -78,7 +80,7 @@ static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = {
950 + },
951 + },
952 + {
953 +- .ident = "ASUS G1S",
954 ++ /* ASUS G1S */
955 + .matches = {
956 + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."),
957 + DMI_MATCH(DMI_BOARD_NAME, "G1S"),
958 +@@ -86,8 +88,7 @@ static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = {
959 + },
960 + },
961 + {
962 +- /* AUX LOOP command does not raise AUX IRQ */
963 +- .ident = "ASUS P65UP5",
964 ++ /* ASUS P65UP5 - AUX LOOP command does not raise AUX IRQ */
965 + .matches = {
966 + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
967 + DMI_MATCH(DMI_BOARD_NAME, "P/I-P65UP5"),
968 +@@ -95,7 +96,6 @@ static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = {
969 + },
970 + },
971 + {
972 +- .ident = "Compaq Proliant 8500",
973 + .matches = {
974 + DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
975 + DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
976 +@@ -103,7 +103,6 @@ static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = {
977 + },
978 + },
979 + {
980 +- .ident = "Compaq Proliant DL760",
981 + .matches = {
982 + DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
983 + DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
984 +@@ -111,7 +110,7 @@ static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = {
985 + },
986 + },
987 + {
988 +- .ident = "OQO Model 01",
989 ++ /* OQO Model 01 */
990 + .matches = {
991 + DMI_MATCH(DMI_SYS_VENDOR, "OQO"),
992 + DMI_MATCH(DMI_PRODUCT_NAME, "ZEPTO"),
993 +@@ -119,8 +118,7 @@ static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = {
994 + },
995 + },
996 + {
997 +- /* AUX LOOP does not work properly */
998 +- .ident = "ULI EV4873",
999 ++ /* ULI EV4873 - AUX LOOP does not work properly */
1000 + .matches = {
1001 + DMI_MATCH(DMI_SYS_VENDOR, "ULI"),
1002 + DMI_MATCH(DMI_PRODUCT_NAME, "EV4873"),
1003 +@@ -128,7 +126,7 @@ static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = {
1004 + },
1005 + },
1006 + {
1007 +- .ident = "Microsoft Virtual Machine",
1008 ++ /* Microsoft Virtual Machine */
1009 + .matches = {
1010 + DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
1011 + DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
1012 +@@ -136,7 +134,7 @@ static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = {
1013 + },
1014 + },
1015 + {
1016 +- .ident = "Medion MAM 2070",
1017 ++ /* Medion MAM 2070 */
1018 + .matches = {
1019 + DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
1020 + DMI_MATCH(DMI_PRODUCT_NAME, "MAM 2070"),
1021 +@@ -144,7 +142,7 @@ static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = {
1022 + },
1023 + },
1024 + {
1025 +- .ident = "Blue FB5601",
1026 ++ /* Blue FB5601 */
1027 + .matches = {
1028 + DMI_MATCH(DMI_SYS_VENDOR, "blue"),
1029 + DMI_MATCH(DMI_PRODUCT_NAME, "FB5601"),
1030 +@@ -152,7 +150,7 @@ static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = {
1031 + },
1032 + },
1033 + {
1034 +- .ident = "Gigabyte M912",
1035 ++ /* Gigabyte M912 */
1036 + .matches = {
1037 + DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
1038 + DMI_MATCH(DMI_PRODUCT_NAME, "M912"),
1039 +@@ -160,7 +158,14 @@ static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = {
1040 + },
1041 + },
1042 + {
1043 +- .ident = "HP DV9700",
1044 ++ /* Gigabyte M1022M netbook */
1045 ++ .matches = {
1046 ++ DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co.,Ltd."),
1047 ++ DMI_MATCH(DMI_BOARD_NAME, "M1022E"),
1048 ++ DMI_MATCH(DMI_BOARD_VERSION, "1.02"),
1049 ++ },
1050 ++ },
1051 ++ {
1052 + .matches = {
1053 + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
1054 + DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"),
1055 +@@ -177,72 +182,72 @@ static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = {
1056 + * ... apparently some Toshibas don't like MUX mode either and
1057 + * die horrible death on reboot.
1058 + */
1059 +-static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = {
1060 ++static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = {
1061 + {
1062 +- .ident = "Fujitsu Lifebook P7010/P7010D",
1063 ++ /* Fujitsu Lifebook P7010/P7010D */
1064 + .matches = {
1065 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
1066 + DMI_MATCH(DMI_PRODUCT_NAME, "P7010"),
1067 + },
1068 + },
1069 + {
1070 +- .ident = "Fujitsu Lifebook P7010",
1071 ++ /* Fujitsu Lifebook P7010 */
1072 + .matches = {
1073 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
1074 + DMI_MATCH(DMI_PRODUCT_NAME, "0000000000"),
1075 + },
1076 + },
1077 + {
1078 +- .ident = "Fujitsu Lifebook P5020D",
1079 ++ /* Fujitsu Lifebook P5020D */
1080 + .matches = {
1081 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
1082 + DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P Series"),
1083 + },
1084 + },
1085 + {
1086 +- .ident = "Fujitsu Lifebook S2000",
1087 ++ /* Fujitsu Lifebook S2000 */
1088 + .matches = {
1089 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
1090 + DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S Series"),
1091 + },
1092 + },
1093 + {
1094 +- .ident = "Fujitsu Lifebook S6230",
1095 ++ /* Fujitsu Lifebook S6230 */
1096 + .matches = {
1097 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
1098 + DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S6230"),
1099 + },
1100 + },
1101 + {
1102 +- .ident = "Fujitsu T70H",
1103 ++ /* Fujitsu T70H */
1104 + .matches = {
1105 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
1106 + DMI_MATCH(DMI_PRODUCT_NAME, "FMVLT70H"),
1107 + },
1108 + },
1109 + {
1110 +- .ident = "Fujitsu-Siemens Lifebook T3010",
1111 ++ /* Fujitsu-Siemens Lifebook T3010 */
1112 + .matches = {
1113 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
1114 + DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T3010"),
1115 + },
1116 + },
1117 + {
1118 +- .ident = "Fujitsu-Siemens Lifebook E4010",
1119 ++ /* Fujitsu-Siemens Lifebook E4010 */
1120 + .matches = {
1121 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
1122 + DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E4010"),
1123 + },
1124 + },
1125 + {
1126 +- .ident = "Fujitsu-Siemens Amilo Pro 2010",
1127 ++ /* Fujitsu-Siemens Amilo Pro 2010 */
1128 + .matches = {
1129 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
1130 + DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2010"),
1131 + },
1132 + },
1133 + {
1134 +- .ident = "Fujitsu-Siemens Amilo Pro 2030",
1135 ++ /* Fujitsu-Siemens Amilo Pro 2030 */
1136 + .matches = {
1137 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
1138 + DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"),
1139 +@@ -253,7 +258,7 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = {
1140 + * No data is coming from the touchscreen unless KBC
1141 + * is in legacy mode.
1142 + */
1143 +- .ident = "Panasonic CF-29",
1144 ++ /* Panasonic CF-29 */
1145 + .matches = {
1146 + DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"),
1147 + DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"),
1148 +@@ -261,10 +266,10 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = {
1149 + },
1150 + {
1151 + /*
1152 +- * Errors on MUX ports are reported without raising AUXDATA
1153 ++ * HP Pavilion DV4017EA -
1154 ++ * errors on MUX ports are reported without raising AUXDATA
1155 + * causing "spurious NAK" messages.
1156 + */
1157 +- .ident = "HP Pavilion DV4017EA",
1158 + .matches = {
1159 + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
1160 + DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EA032EA#ABF)"),
1161 +@@ -272,9 +277,9 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = {
1162 + },
1163 + {
1164 + /*
1165 +- * Like DV4017EA does not raise AUXERR for errors on MUX ports.
1166 ++ * HP Pavilion ZT1000 -
1167 ++ * like DV4017EA does not raise AUXERR for errors on MUX ports.
1168 + */
1169 +- .ident = "HP Pavilion ZT1000",
1170 + .matches = {
1171 + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
1172 + DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Notebook PC"),
1173 +@@ -283,44 +288,41 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = {
1174 + },
1175 + {
1176 + /*
1177 +- * Like DV4017EA does not raise AUXERR for errors on MUX ports.
1178 ++ * HP Pavilion DV4270ca -
1179 ++ * like DV4017EA does not raise AUXERR for errors on MUX ports.
1180 + */
1181 +- .ident = "HP Pavilion DV4270ca",
1182 + .matches = {
1183 + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
1184 + DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EH476UA#ABL)"),
1185 + },
1186 + },
1187 + {
1188 +- .ident = "Toshiba P10",
1189 + .matches = {
1190 + DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
1191 + DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"),
1192 + },
1193 + },
1194 + {
1195 +- .ident = "Toshiba Equium A110",
1196 + .matches = {
1197 + DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
1198 + DMI_MATCH(DMI_PRODUCT_NAME, "EQUIUM A110"),
1199 + },
1200 + },
1201 + {
1202 +- .ident = "Alienware Sentia",
1203 + .matches = {
1204 + DMI_MATCH(DMI_SYS_VENDOR, "ALIENWARE"),
1205 + DMI_MATCH(DMI_PRODUCT_NAME, "Sentia"),
1206 + },
1207 + },
1208 + {
1209 +- .ident = "Sharp Actius MM20",
1210 ++ /* Sharp Actius MM20 */
1211 + .matches = {
1212 + DMI_MATCH(DMI_SYS_VENDOR, "SHARP"),
1213 + DMI_MATCH(DMI_PRODUCT_NAME, "PC-MM20 Series"),
1214 + },
1215 + },
1216 + {
1217 +- .ident = "Sony Vaio FS-115b",
1218 ++ /* Sony Vaio FS-115b */
1219 + .matches = {
1220 + DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
1221 + DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FS115B"),
1222 +@@ -328,73 +330,72 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = {
1223 + },
1224 + {
1225 + /*
1226 +- * Reset and GET ID commands issued via KBD port are
1227 ++ * Sony Vaio FZ-240E -
1228 ++ * reset and GET ID commands issued via KBD port are
1229 + * sometimes being delivered to AUX3.
1230 + */
1231 +- .ident = "Sony Vaio FZ-240E",
1232 + .matches = {
1233 + DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
1234 + DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ240E"),
1235 + },
1236 + },
1237 + {
1238 +- .ident = "Amoi M636/A737",
1239 ++ /* Amoi M636/A737 */
1240 + .matches = {
1241 + DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."),
1242 + DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"),
1243 + },
1244 + },
1245 + {
1246 +- .ident = "Lenovo 3000 n100",
1247 ++ /* Lenovo 3000 n100 */
1248 + .matches = {
1249 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
1250 + DMI_MATCH(DMI_PRODUCT_NAME, "076804U"),
1251 + },
1252 + },
1253 + {
1254 +- .ident = "Acer Aspire 1360",
1255 + .matches = {
1256 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
1257 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"),
1258 + },
1259 + },
1260 + {
1261 +- .ident = "Gericom Bellagio",
1262 ++ /* Gericom Bellagio */
1263 + .matches = {
1264 + DMI_MATCH(DMI_SYS_VENDOR, "Gericom"),
1265 + DMI_MATCH(DMI_PRODUCT_NAME, "N34AS6"),
1266 + },
1267 + },
1268 + {
1269 +- .ident = "IBM 2656",
1270 ++ /* IBM 2656 */
1271 + .matches = {
1272 + DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
1273 + DMI_MATCH(DMI_PRODUCT_NAME, "2656"),
1274 + },
1275 + },
1276 + {
1277 +- .ident = "Dell XPS M1530",
1278 ++ /* Dell XPS M1530 */
1279 + .matches = {
1280 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
1281 + DMI_MATCH(DMI_PRODUCT_NAME, "XPS M1530"),
1282 + },
1283 + },
1284 + {
1285 +- .ident = "Compal HEL80I",
1286 ++ /* Compal HEL80I */
1287 + .matches = {
1288 + DMI_MATCH(DMI_SYS_VENDOR, "COMPAL"),
1289 + DMI_MATCH(DMI_PRODUCT_NAME, "HEL80I"),
1290 + },
1291 + },
1292 + {
1293 +- .ident = "Dell Vostro 1510",
1294 ++ /* Dell Vostro 1510 */
1295 + .matches = {
1296 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
1297 + DMI_MATCH(DMI_PRODUCT_NAME, "Vostro1510"),
1298 + },
1299 + },
1300 + {
1301 +- .ident = "Acer Aspire 5536",
1302 ++ /* Acer Aspire 5536 */
1303 + .matches = {
1304 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
1305 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5536"),
1306 +@@ -404,65 +405,65 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = {
1307 + { }
1308 + };
1309 +
1310 +-static struct dmi_system_id __initdata i8042_dmi_reset_table[] = {
1311 ++static const struct dmi_system_id __initconst i8042_dmi_reset_table[] = {
1312 + {
1313 +- .ident = "MSI Wind U-100",
1314 ++ /* MSI Wind U-100 */
1315 + .matches = {
1316 + DMI_MATCH(DMI_BOARD_NAME, "U-100"),
1317 + DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
1318 + },
1319 + },
1320 + {
1321 +- .ident = "LG Electronics X110",
1322 ++ /* LG Electronics X110 */
1323 + .matches = {
1324 + DMI_MATCH(DMI_BOARD_NAME, "X110"),
1325 + DMI_MATCH(DMI_BOARD_VENDOR, "LG Electronics Inc."),
1326 + },
1327 + },
1328 + {
1329 +- .ident = "Acer Aspire One 150",
1330 ++ /* Acer Aspire One 150 */
1331 + .matches = {
1332 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
1333 + DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"),
1334 + },
1335 + },
1336 + {
1337 +- .ident = "Advent 4211",
1338 ++ /* Advent 4211 */
1339 + .matches = {
1340 + DMI_MATCH(DMI_SYS_VENDOR, "DIXONSXP"),
1341 + DMI_MATCH(DMI_PRODUCT_NAME, "Advent 4211"),
1342 + },
1343 + },
1344 + {
1345 +- .ident = "Medion Akoya Mini E1210",
1346 ++ /* Medion Akoya Mini E1210 */
1347 + .matches = {
1348 + DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
1349 + DMI_MATCH(DMI_PRODUCT_NAME, "E1210"),
1350 + },
1351 + },
1352 + {
1353 +- .ident = "Mivvy M310",
1354 ++ /* Mivvy M310 */
1355 + .matches = {
1356 + DMI_MATCH(DMI_SYS_VENDOR, "VIOOO"),
1357 + DMI_MATCH(DMI_PRODUCT_NAME, "N10"),
1358 + },
1359 + },
1360 + {
1361 +- .ident = "Dell Vostro 1320",
1362 ++ /* Dell Vostro 1320 */
1363 + .matches = {
1364 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
1365 + DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1320"),
1366 + },
1367 + },
1368 + {
1369 +- .ident = "Dell Vostro 1520",
1370 ++ /* Dell Vostro 1520 */
1371 + .matches = {
1372 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
1373 + DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1520"),
1374 + },
1375 + },
1376 + {
1377 +- .ident = "Dell Vostro 1720",
1378 ++ /* Dell Vostro 1720 */
1379 + .matches = {
1380 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
1381 + DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1720"),
1382 +@@ -472,16 +473,16 @@ static struct dmi_system_id __initdata i8042_dmi_reset_table[] = {
1383 + };
1384 +
1385 + #ifdef CONFIG_PNP
1386 +-static struct dmi_system_id __initdata i8042_dmi_nopnp_table[] = {
1387 ++static const struct dmi_system_id __initconst i8042_dmi_nopnp_table[] = {
1388 + {
1389 +- .ident = "Intel MBO Desktop D845PESV",
1390 ++ /* Intel MBO Desktop D845PESV */
1391 + .matches = {
1392 + DMI_MATCH(DMI_BOARD_NAME, "D845PESV"),
1393 + DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
1394 + },
1395 + },
1396 + {
1397 +- .ident = "MSI Wind U-100",
1398 ++ /* MSI Wind U-100 */
1399 + .matches = {
1400 + DMI_MATCH(DMI_BOARD_NAME, "U-100"),
1401 + DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
1402 +@@ -490,27 +491,23 @@ static struct dmi_system_id __initdata i8042_dmi_nopnp_table[] = {
1403 + { }
1404 + };
1405 +
1406 +-static struct dmi_system_id __initdata i8042_dmi_laptop_table[] = {
1407 ++static const struct dmi_system_id __initconst i8042_dmi_laptop_table[] = {
1408 + {
1409 +- .ident = "Portable",
1410 + .matches = {
1411 + DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
1412 + },
1413 + },
1414 + {
1415 +- .ident = "Laptop",
1416 + .matches = {
1417 + DMI_MATCH(DMI_CHASSIS_TYPE, "9"), /* Laptop */
1418 + },
1419 + },
1420 + {
1421 +- .ident = "Notebook",
1422 + .matches = {
1423 + DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
1424 + },
1425 + },
1426 + {
1427 +- .ident = "Sub-Notebook",
1428 + .matches = {
1429 + DMI_MATCH(DMI_CHASSIS_TYPE, "14"), /* Sub-Notebook */
1430 + },
1431 +@@ -525,58 +522,65 @@ static struct dmi_system_id __initdata i8042_dmi_laptop_table[] = {
1432 + * Originally, this was just confined to older laptops, but a few Acer laptops
1433 + * have turned up in 2007 that also need this again.
1434 + */
1435 +-static struct dmi_system_id __initdata i8042_dmi_dritek_table[] = {
1436 ++static const struct dmi_system_id __initconst i8042_dmi_dritek_table[] = {
1437 ++ {
1438 ++ /* Acer Aspire 5610 */
1439 ++ .matches = {
1440 ++ DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
1441 ++ DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"),
1442 ++ },
1443 ++ },
1444 + {
1445 +- .ident = "Acer Aspire 5630",
1446 ++ /* Acer Aspire 5630 */
1447 + .matches = {
1448 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
1449 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5630"),
1450 + },
1451 + },
1452 + {
1453 +- .ident = "Acer Aspire 5650",
1454 ++ /* Acer Aspire 5650 */
1455 + .matches = {
1456 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
1457 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"),
1458 + },
1459 + },
1460 + {
1461 +- .ident = "Acer Aspire 5680",
1462 ++ /* Acer Aspire 5680 */
1463 + .matches = {
1464 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
1465 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"),
1466 + },
1467 + },
1468 + {
1469 +- .ident = "Acer Aspire 5720",
1470 ++ /* Acer Aspire 5720 */
1471 + .matches = {
1472 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
1473 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"),
1474 + },
1475 + },
1476 + {
1477 +- .ident = "Acer Aspire 9110",
1478 ++ /* Acer Aspire 9110 */
1479 + .matches = {
1480 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
1481 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 9110"),
1482 + },
1483 + },
1484 + {
1485 +- .ident = "Acer TravelMate 660",
1486 ++ /* Acer TravelMate 660 */
1487 + .matches = {
1488 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
1489 + DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
1490 + },
1491 + },
1492 + {
1493 +- .ident = "Acer TravelMate 2490",
1494 ++ /* Acer TravelMate 2490 */
1495 + .matches = {
1496 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
1497 + DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"),
1498 + },
1499 + },
1500 + {
1501 +- .ident = "Acer TravelMate 4280",
1502 ++ /* Acer TravelMate 4280 */
1503 + .matches = {
1504 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
1505 + DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4280"),
1506 +diff --git a/drivers/md/md.c b/drivers/md/md.c
1507 +index c6a6685..08f7471 100644
1508 +--- a/drivers/md/md.c
1509 ++++ b/drivers/md/md.c
1510 +@@ -4173,7 +4173,7 @@ static int do_md_run(mddev_t * mddev)
1511 + mddev->barriers_work = 1;
1512 + mddev->ok_start_degraded = start_dirty_degraded;
1513 +
1514 +- if (start_readonly)
1515 ++ if (start_readonly && mddev->ro == 0)
1516 + mddev->ro = 2; /* read-only, but switch on first write */
1517 +
1518 + err = mddev->pers->run(mddev);
1519 +diff --git a/drivers/media/dvb/siano/smsusb.c b/drivers/media/dvb/siano/smsusb.c
1520 +index 8f88a58..6b03dbf 100644
1521 +--- a/drivers/media/dvb/siano/smsusb.c
1522 ++++ b/drivers/media/dvb/siano/smsusb.c
1523 +@@ -533,8 +533,18 @@ struct usb_device_id smsusb_id_table[] = {
1524 + .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
1525 + { USB_DEVICE(0x2040, 0xb910),
1526 + .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
1527 ++ { USB_DEVICE(0x2040, 0xb980),
1528 ++ .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
1529 ++ { USB_DEVICE(0x2040, 0xb990),
1530 ++ .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
1531 + { USB_DEVICE(0x2040, 0xc000),
1532 + .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
1533 ++ { USB_DEVICE(0x2040, 0xc010),
1534 ++ .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
1535 ++ { USB_DEVICE(0x2040, 0xc080),
1536 ++ .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
1537 ++ { USB_DEVICE(0x2040, 0xc090),
1538 ++ .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
1539 + { } /* Terminating entry */
1540 + };
1541 +
1542 +diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
1543 +index 0901322..6781a07 100644
1544 +--- a/drivers/media/video/saa7134/saa7134-cards.c
1545 ++++ b/drivers/media/video/saa7134/saa7134-cards.c
1546 +@@ -5279,6 +5279,30 @@ struct saa7134_board saa7134_boards[] = {
1547 + .amux = TV,
1548 + },
1549 + },
1550 ++ [SAA7134_BOARD_ASUS_EUROPA_HYBRID] = {
1551 ++ .name = "Asus Europa Hybrid OEM",
1552 ++ .audio_clock = 0x00187de7,
1553 ++ .tuner_type = TUNER_PHILIPS_TD1316,
1554 ++ .radio_type = UNSET,
1555 ++ .tuner_addr = 0x61,
1556 ++ .radio_addr = ADDR_UNSET,
1557 ++ .tda9887_conf = TDA9887_PRESENT | TDA9887_PORT1_ACTIVE,
1558 ++ .mpeg = SAA7134_MPEG_DVB,
1559 ++ .inputs = { {
1560 ++ .name = name_tv,
1561 ++ .vmux = 3,
1562 ++ .amux = TV,
1563 ++ .tv = 1,
1564 ++ }, {
1565 ++ .name = name_comp1,
1566 ++ .vmux = 4,
1567 ++ .amux = LINE2,
1568 ++ }, {
1569 ++ .name = name_svideo,
1570 ++ .vmux = 8,
1571 ++ .amux = LINE2,
1572 ++ } },
1573 ++ },
1574 +
1575 + };
1576 +
1577 +@@ -6418,6 +6442,12 @@ struct pci_device_id saa7134_pci_tbl[] = {
1578 + .subdevice = 0x2004,
1579 + .driver_data = SAA7134_BOARD_ZOLID_HYBRID_PCI,
1580 + }, {
1581 ++ .vendor = PCI_VENDOR_ID_PHILIPS,
1582 ++ .device = PCI_DEVICE_ID_PHILIPS_SAA7134,
1583 ++ .subvendor = 0x1043,
1584 ++ .subdevice = 0x4847,
1585 ++ .driver_data = SAA7134_BOARD_ASUS_EUROPA_HYBRID,
1586 ++ }, {
1587 + /* --- boards without eeprom + subsystem ID --- */
1588 + .vendor = PCI_VENDOR_ID_PHILIPS,
1589 + .device = PCI_DEVICE_ID_PHILIPS_SAA7134,
1590 +@@ -7079,6 +7109,7 @@ int saa7134_board_init2(struct saa7134_dev *dev)
1591 + /* break intentionally omitted */
1592 + case SAA7134_BOARD_VIDEOMATE_DVBT_300:
1593 + case SAA7134_BOARD_ASUS_EUROPA2_HYBRID:
1594 ++ case SAA7134_BOARD_ASUS_EUROPA_HYBRID:
1595 + {
1596 +
1597 + /* The Philips EUROPA based hybrid boards have the tuner
1598 +diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
1599 +index a26e997..b8a805c 100644
1600 +--- a/drivers/media/video/saa7134/saa7134-dvb.c
1601 ++++ b/drivers/media/video/saa7134/saa7134-dvb.c
1602 +@@ -1116,6 +1116,7 @@ static int dvb_init(struct saa7134_dev *dev)
1603 + break;
1604 + case SAA7134_BOARD_PHILIPS_EUROPA:
1605 + case SAA7134_BOARD_VIDEOMATE_DVBT_300:
1606 ++ case SAA7134_BOARD_ASUS_EUROPA_HYBRID:
1607 + fe0->dvb.frontend = dvb_attach(tda10046_attach,
1608 + &philips_europa_config,
1609 + &dev->i2c_adap);
1610 +diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h
1611 +index f8697d4..94e1a3b 100644
1612 +--- a/drivers/media/video/saa7134/saa7134.h
1613 ++++ b/drivers/media/video/saa7134/saa7134.h
1614 +@@ -297,6 +297,7 @@ struct saa7134_format {
1615 + #define SAA7134_BOARD_BEHOLD_X7 171
1616 + #define SAA7134_BOARD_ROVERMEDIA_LINK_PRO_FM 172
1617 + #define SAA7134_BOARD_ZOLID_HYBRID_PCI 173
1618 ++#define SAA7134_BOARD_ASUS_EUROPA_HYBRID 174
1619 +
1620 + #define SAA7134_MAXBOARDS 32
1621 + #define SAA7134_INPUT_MAX 8
1622 +diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c
1623 +index 1b89735..4a293b4 100644
1624 +--- a/drivers/media/video/uvc/uvc_ctrl.c
1625 ++++ b/drivers/media/video/uvc/uvc_ctrl.c
1626 +@@ -1405,7 +1405,7 @@ uvc_ctrl_prune_entity(struct uvc_device *dev, struct uvc_entity *entity)
1627 + size = entity->processing.bControlSize;
1628 +
1629 + for (i = 0; i < ARRAY_SIZE(blacklist); ++i) {
1630 +- if (!usb_match_id(dev->intf, &blacklist[i].id))
1631 ++ if (!usb_match_one_id(dev->intf, &blacklist[i].id))
1632 + continue;
1633 +
1634 + if (blacklist[i].index >= 8 * size ||
1635 +diff --git a/drivers/mtd/ubi/upd.c b/drivers/mtd/ubi/upd.c
1636 +index c1d7b88..425bf5a 100644
1637 +--- a/drivers/mtd/ubi/upd.c
1638 ++++ b/drivers/mtd/ubi/upd.c
1639 +@@ -155,6 +155,7 @@ int ubi_start_update(struct ubi_device *ubi, struct ubi_volume *vol,
1640 + if (err)
1641 + return err;
1642 + vol->updating = 0;
1643 ++ return 0;
1644 + }
1645 +
1646 + vol->upd_buf = vmalloc(ubi->leb_size);
1647 +diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c
1648 +index 1afc61e..4004402 100644
1649 +--- a/drivers/mtd/ubi/vtbl.c
1650 ++++ b/drivers/mtd/ubi/vtbl.c
1651 +@@ -566,6 +566,7 @@ static int init_volumes(struct ubi_device *ubi, const struct ubi_scan_info *si,
1652 + vol->reserved_pebs = be32_to_cpu(vtbl[i].reserved_pebs);
1653 + vol->alignment = be32_to_cpu(vtbl[i].alignment);
1654 + vol->data_pad = be32_to_cpu(vtbl[i].data_pad);
1655 ++ vol->upd_marker = vtbl[i].upd_marker;
1656 + vol->vol_type = vtbl[i].vol_type == UBI_VID_DYNAMIC ?
1657 + UBI_DYNAMIC_VOLUME : UBI_STATIC_VOLUME;
1658 + vol->name_len = be16_to_cpu(vtbl[i].name_len);
1659 +diff --git a/drivers/net/atl1c/atl1c.h b/drivers/net/atl1c/atl1c.h
1660 +index 2a1120a..790e55b 100644
1661 +--- a/drivers/net/atl1c/atl1c.h
1662 ++++ b/drivers/net/atl1c/atl1c.h
1663 +@@ -534,6 +534,9 @@ struct atl1c_adapter {
1664 + #define __AT_TESTING 0x0001
1665 + #define __AT_RESETTING 0x0002
1666 + #define __AT_DOWN 0x0003
1667 ++ u8 work_event;
1668 ++#define ATL1C_WORK_EVENT_RESET 0x01
1669 ++#define ATL1C_WORK_EVENT_LINK_CHANGE 0x02
1670 + u32 msg_enable;
1671 +
1672 + bool have_msi;
1673 +@@ -545,8 +548,7 @@ struct atl1c_adapter {
1674 + spinlock_t tx_lock;
1675 + atomic_t irq_sem;
1676 +
1677 +- struct work_struct reset_task;
1678 +- struct work_struct link_chg_task;
1679 ++ struct work_struct common_task;
1680 + struct timer_list watchdog_timer;
1681 + struct timer_list phy_config_timer;
1682 +
1683 +diff --git a/drivers/net/atl1c/atl1c_main.c b/drivers/net/atl1c/atl1c_main.c
1684 +index 1372e9a..be00ee9 100644
1685 +--- a/drivers/net/atl1c/atl1c_main.c
1686 ++++ b/drivers/net/atl1c/atl1c_main.c
1687 +@@ -198,27 +198,12 @@ static void atl1c_phy_config(unsigned long data)
1688 +
1689 + void atl1c_reinit_locked(struct atl1c_adapter *adapter)
1690 + {
1691 +-
1692 + WARN_ON(in_interrupt());
1693 + atl1c_down(adapter);
1694 + atl1c_up(adapter);
1695 + clear_bit(__AT_RESETTING, &adapter->flags);
1696 + }
1697 +
1698 +-static void atl1c_reset_task(struct work_struct *work)
1699 +-{
1700 +- struct atl1c_adapter *adapter;
1701 +- struct net_device *netdev;
1702 +-
1703 +- adapter = container_of(work, struct atl1c_adapter, reset_task);
1704 +- netdev = adapter->netdev;
1705 +-
1706 +- netif_device_detach(netdev);
1707 +- atl1c_down(adapter);
1708 +- atl1c_up(adapter);
1709 +- netif_device_attach(netdev);
1710 +-}
1711 +-
1712 + static void atl1c_check_link_status(struct atl1c_adapter *adapter)
1713 + {
1714 + struct atl1c_hw *hw = &adapter->hw;
1715 +@@ -275,18 +260,6 @@ static void atl1c_check_link_status(struct atl1c_adapter *adapter)
1716 + }
1717 + }
1718 +
1719 +-/*
1720 +- * atl1c_link_chg_task - deal with link change event Out of interrupt context
1721 +- * @netdev: network interface device structure
1722 +- */
1723 +-static void atl1c_link_chg_task(struct work_struct *work)
1724 +-{
1725 +- struct atl1c_adapter *adapter;
1726 +-
1727 +- adapter = container_of(work, struct atl1c_adapter, link_chg_task);
1728 +- atl1c_check_link_status(adapter);
1729 +-}
1730 +-
1731 + static void atl1c_link_chg_event(struct atl1c_adapter *adapter)
1732 + {
1733 + struct net_device *netdev = adapter->netdev;
1734 +@@ -311,20 +284,40 @@ static void atl1c_link_chg_event(struct atl1c_adapter *adapter)
1735 + adapter->link_speed = SPEED_0;
1736 + }
1737 + }
1738 +- schedule_work(&adapter->link_chg_task);
1739 ++
1740 ++ adapter->work_event |= ATL1C_WORK_EVENT_LINK_CHANGE;
1741 ++ schedule_work(&adapter->common_task);
1742 + }
1743 +
1744 +-static void atl1c_del_timer(struct atl1c_adapter *adapter)
1745 ++static void atl1c_common_task(struct work_struct *work)
1746 + {
1747 +- del_timer_sync(&adapter->phy_config_timer);
1748 ++ struct atl1c_adapter *adapter;
1749 ++ struct net_device *netdev;
1750 ++
1751 ++ adapter = container_of(work, struct atl1c_adapter, common_task);
1752 ++ netdev = adapter->netdev;
1753 ++
1754 ++ if (adapter->work_event & ATL1C_WORK_EVENT_RESET) {
1755 ++ netif_device_detach(netdev);
1756 ++ atl1c_down(adapter);
1757 ++ atl1c_up(adapter);
1758 ++ netif_device_attach(netdev);
1759 ++ return;
1760 ++ }
1761 ++
1762 ++ if (adapter->work_event & ATL1C_WORK_EVENT_LINK_CHANGE)
1763 ++ atl1c_check_link_status(adapter);
1764 ++
1765 ++ return;
1766 + }
1767 +
1768 +-static void atl1c_cancel_work(struct atl1c_adapter *adapter)
1769 ++
1770 ++static void atl1c_del_timer(struct atl1c_adapter *adapter)
1771 + {
1772 +- cancel_work_sync(&adapter->reset_task);
1773 +- cancel_work_sync(&adapter->link_chg_task);
1774 ++ del_timer_sync(&adapter->phy_config_timer);
1775 + }
1776 +
1777 ++
1778 + /*
1779 + * atl1c_tx_timeout - Respond to a Tx Hang
1780 + * @netdev: network interface device structure
1781 +@@ -334,7 +327,8 @@ static void atl1c_tx_timeout(struct net_device *netdev)
1782 + struct atl1c_adapter *adapter = netdev_priv(netdev);
1783 +
1784 + /* Do the reset outside of interrupt context */
1785 +- schedule_work(&adapter->reset_task);
1786 ++ adapter->work_event |= ATL1C_WORK_EVENT_RESET;
1787 ++ schedule_work(&adapter->common_task);
1788 + }
1789 +
1790 + /*
1791 +@@ -1536,7 +1530,8 @@ static irqreturn_t atl1c_intr(int irq, void *data)
1792 + /* reset MAC */
1793 + hw->intr_mask &= ~ISR_ERROR;
1794 + AT_WRITE_REG(hw, REG_IMR, hw->intr_mask);
1795 +- schedule_work(&adapter->reset_task);
1796 ++ adapter->work_event |= ATL1C_WORK_EVENT_RESET;
1797 ++ schedule_work(&adapter->common_task);
1798 + break;
1799 + }
1800 +
1801 +@@ -2200,8 +2195,7 @@ void atl1c_down(struct atl1c_adapter *adapter)
1802 + struct net_device *netdev = adapter->netdev;
1803 +
1804 + atl1c_del_timer(adapter);
1805 +- atl1c_cancel_work(adapter);
1806 +-
1807 ++ adapter->work_event = 0; /* clear all event */
1808 + /* signal that we're down so the interrupt handler does not
1809 + * reschedule our watchdog timer */
1810 + set_bit(__AT_DOWN, &adapter->flags);
1811 +@@ -2601,8 +2595,8 @@ static int __devinit atl1c_probe(struct pci_dev *pdev,
1812 + adapter->hw.mac_addr[4], adapter->hw.mac_addr[5]);
1813 +
1814 + atl1c_hw_set_mac_addr(&adapter->hw);
1815 +- INIT_WORK(&adapter->reset_task, atl1c_reset_task);
1816 +- INIT_WORK(&adapter->link_chg_task, atl1c_link_chg_task);
1817 ++ INIT_WORK(&adapter->common_task, atl1c_common_task);
1818 ++ adapter->work_event = 0;
1819 + err = register_netdev(netdev);
1820 + if (err) {
1821 + dev_err(&pdev->dev, "register netdevice failed\n");
1822 +diff --git a/drivers/net/atl1e/atl1e_main.c b/drivers/net/atl1e/atl1e_main.c
1823 +index 955da73..1b5facf 100644
1824 +--- a/drivers/net/atl1e/atl1e_main.c
1825 ++++ b/drivers/net/atl1e/atl1e_main.c
1826 +@@ -1666,41 +1666,6 @@ static int atl1e_tso_csum(struct atl1e_adapter *adapter,
1827 + }
1828 + return 0;
1829 + }
1830 +-
1831 +- if (offload_type & SKB_GSO_TCPV6) {
1832 +- real_len = (((unsigned char *)ipv6_hdr(skb) - skb->data)
1833 +- + ntohs(ipv6_hdr(skb)->payload_len));
1834 +- if (real_len < skb->len)
1835 +- pskb_trim(skb, real_len);
1836 +-
1837 +- /* check payload == 0 byte ? */
1838 +- hdr_len = (skb_transport_offset(skb) + tcp_hdrlen(skb));
1839 +- if (unlikely(skb->len == hdr_len)) {
1840 +- /* only xsum need */
1841 +- dev_warn(&pdev->dev,
1842 +- "IPV6 tso with zero data??\n");
1843 +- goto check_sum;
1844 +- } else {
1845 +- tcp_hdr(skb)->check = ~csum_ipv6_magic(
1846 +- &ipv6_hdr(skb)->saddr,
1847 +- &ipv6_hdr(skb)->daddr,
1848 +- 0, IPPROTO_TCP, 0);
1849 +- tpd->word3 |= 1 << TPD_IP_VERSION_SHIFT;
1850 +- hdr_len >>= 1;
1851 +- tpd->word3 |= (hdr_len & TPD_V6_IPHLLO_MASK) <<
1852 +- TPD_V6_IPHLLO_SHIFT;
1853 +- tpd->word3 |= ((hdr_len >> 3) &
1854 +- TPD_V6_IPHLHI_MASK) <<
1855 +- TPD_V6_IPHLHI_SHIFT;
1856 +- tpd->word3 |= (tcp_hdrlen(skb) >> 2 &
1857 +- TPD_TCPHDRLEN_MASK) <<
1858 +- TPD_TCPHDRLEN_SHIFT;
1859 +- tpd->word3 |= ((skb_shinfo(skb)->gso_size) &
1860 +- TPD_MSS_MASK) << TPD_MSS_SHIFT;
1861 +- tpd->word3 |= 1 << TPD_SEGMENT_EN_SHIFT;
1862 +- }
1863 +- }
1864 +- return 0;
1865 + }
1866 +
1867 + check_sum:
1868 +@@ -2289,7 +2254,6 @@ static int atl1e_init_netdev(struct net_device *netdev, struct pci_dev *pdev)
1869 + NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
1870 + netdev->features |= NETIF_F_LLTX;
1871 + netdev->features |= NETIF_F_TSO;
1872 +- netdev->features |= NETIF_F_TSO6;
1873 +
1874 + return 0;
1875 + }
1876 +diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h
1877 +index 3b79a22..a84f1c5 100644
1878 +--- a/drivers/net/benet/be.h
1879 ++++ b/drivers/net/benet/be.h
1880 +@@ -35,20 +35,31 @@
1881 + #define DRV_VER "2.101.205"
1882 + #define DRV_NAME "be2net"
1883 + #define BE_NAME "ServerEngines BladeEngine2 10Gbps NIC"
1884 ++#define BE3_NAME "ServerEngines BladeEngine3 10Gbps NIC"
1885 + #define OC_NAME "Emulex OneConnect 10Gbps NIC"
1886 ++#define OC_NAME1 "Emulex OneConnect 10Gbps NIC (be3)"
1887 + #define DRV_DESC BE_NAME "Driver"
1888 +
1889 + #define BE_VENDOR_ID 0x19a2
1890 + #define BE_DEVICE_ID1 0x211
1891 ++#define BE_DEVICE_ID2 0x221
1892 + #define OC_DEVICE_ID1 0x700
1893 + #define OC_DEVICE_ID2 0x701
1894 ++#define OC_DEVICE_ID3 0x710
1895 +
1896 + static inline char *nic_name(struct pci_dev *pdev)
1897 + {
1898 +- if (pdev->device == OC_DEVICE_ID1 || pdev->device == OC_DEVICE_ID2)
1899 ++ switch (pdev->device) {
1900 ++ case OC_DEVICE_ID1:
1901 ++ case OC_DEVICE_ID2:
1902 + return OC_NAME;
1903 +- else
1904 ++ case OC_DEVICE_ID3:
1905 ++ return OC_NAME1;
1906 ++ case BE_DEVICE_ID2:
1907 ++ return BE3_NAME;
1908 ++ default:
1909 + return BE_NAME;
1910 ++ }
1911 + }
1912 +
1913 + /* Number of bytes of an RX frame that are copied to skb->data */
1914 +diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
1915 +index 876b357..3749bb1 100644
1916 +--- a/drivers/net/benet/be_main.c
1917 ++++ b/drivers/net/benet/be_main.c
1918 +@@ -31,8 +31,10 @@ MODULE_PARM_DESC(rx_frag_size, "Size of a fragment that holds rcvd data.");
1919 +
1920 + static DEFINE_PCI_DEVICE_TABLE(be_dev_ids) = {
1921 + { PCI_DEVICE(BE_VENDOR_ID, BE_DEVICE_ID1) },
1922 ++ { PCI_DEVICE(BE_VENDOR_ID, BE_DEVICE_ID2) },
1923 + { PCI_DEVICE(BE_VENDOR_ID, OC_DEVICE_ID1) },
1924 + { PCI_DEVICE(BE_VENDOR_ID, OC_DEVICE_ID2) },
1925 ++ { PCI_DEVICE(BE_VENDOR_ID, OC_DEVICE_ID3) },
1926 + { 0 }
1927 + };
1928 + MODULE_DEVICE_TABLE(pci, be_dev_ids);
1929 +diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
1930 +index a2fc70a..35d896b 100644
1931 +--- a/drivers/net/qlge/qlge_main.c
1932 ++++ b/drivers/net/qlge/qlge_main.c
1933 +@@ -3310,10 +3310,8 @@ static int ql_adapter_initialize(struct ql_adapter *qdev)
1934 +
1935 + /* Initialize the port and set the max framesize. */
1936 + status = qdev->nic_ops->port_initialize(qdev);
1937 +- if (status) {
1938 +- QPRINTK(qdev, IFUP, ERR, "Failed to start port.\n");
1939 +- return status;
1940 +- }
1941 ++ if (status)
1942 ++ QPRINTK(qdev, IFUP, ERR, "Failed to start port.\n");
1943 +
1944 + /* Set up the MAC address and frame routing filter. */
1945 + status = ql_cam_route_initialize(qdev);
1946 +@@ -3714,9 +3712,6 @@ static int qlge_set_mac_address(struct net_device *ndev, void *p)
1947 + struct sockaddr *addr = p;
1948 + int status;
1949 +
1950 +- if (netif_running(ndev))
1951 +- return -EBUSY;
1952 +-
1953 + if (!is_valid_ether_addr(addr->sa_data))
1954 + return -EADDRNOTAVAIL;
1955 + memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len);
1956 +@@ -3868,8 +3863,7 @@ static int __devinit ql_init_device(struct pci_dev *pdev,
1957 + struct net_device *ndev, int cards_found)
1958 + {
1959 + struct ql_adapter *qdev = netdev_priv(ndev);
1960 +- int pos, err = 0;
1961 +- u16 val16;
1962 ++ int err = 0;
1963 +
1964 + memset((void *)qdev, 0, sizeof(*qdev));
1965 + err = pci_enable_device(pdev);
1966 +@@ -3881,18 +3875,12 @@ static int __devinit ql_init_device(struct pci_dev *pdev,
1967 + qdev->ndev = ndev;
1968 + qdev->pdev = pdev;
1969 + pci_set_drvdata(pdev, ndev);
1970 +- pos = pci_find_capability(pdev, PCI_CAP_ID_EXP);
1971 +- if (pos <= 0) {
1972 +- dev_err(&pdev->dev, PFX "Cannot find PCI Express capability, "
1973 +- "aborting.\n");
1974 +- return pos;
1975 +- } else {
1976 +- pci_read_config_word(pdev, pos + PCI_EXP_DEVCTL, &val16);
1977 +- val16 &= ~PCI_EXP_DEVCTL_NOSNOOP_EN;
1978 +- val16 |= (PCI_EXP_DEVCTL_CERE |
1979 +- PCI_EXP_DEVCTL_NFERE |
1980 +- PCI_EXP_DEVCTL_FERE | PCI_EXP_DEVCTL_URRE);
1981 +- pci_write_config_word(pdev, pos + PCI_EXP_DEVCTL, val16);
1982 ++
1983 ++ /* Set PCIe read request size */
1984 ++ err = pcie_set_readrq(pdev, 4096);
1985 ++ if (err) {
1986 ++ dev_err(&pdev->dev, "Set readrq failed.\n");
1987 ++ goto err_out;
1988 + }
1989 +
1990 + err = pci_request_regions(pdev, DRV_NAME);
1991 +diff --git a/drivers/net/qlge/qlge_mpi.c b/drivers/net/qlge/qlge_mpi.c
1992 +index aec05f2..32b1e1f 100644
1993 +--- a/drivers/net/qlge/qlge_mpi.c
1994 ++++ b/drivers/net/qlge/qlge_mpi.c
1995 +@@ -446,6 +446,9 @@ static int ql_mpi_handler(struct ql_adapter *qdev, struct mbox_params *mbcp)
1996 + ql_aen_lost(qdev, mbcp);
1997 + break;
1998 +
1999 ++ case AEN_DCBX_CHG:
2000 ++ /* Need to support AEN 8110 */
2001 ++ break;
2002 + default:
2003 + QPRINTK(qdev, DRV, ERR,
2004 + "Unsupported AE %.08x.\n", mbcp->mbox_out[0]);
2005 +diff --git a/drivers/net/sfc/tx.c b/drivers/net/sfc/tx.c
2006 +index 489c4de..d443ad7 100644
2007 +--- a/drivers/net/sfc/tx.c
2008 ++++ b/drivers/net/sfc/tx.c
2009 +@@ -821,8 +821,6 @@ static void efx_enqueue_unwind(struct efx_tx_queue *tx_queue)
2010 + tx_queue->efx->type->txd_ring_mask];
2011 + efx_tsoh_free(tx_queue, buffer);
2012 + EFX_BUG_ON_PARANOID(buffer->skb);
2013 +- buffer->len = 0;
2014 +- buffer->continuation = true;
2015 + if (buffer->unmap_len) {
2016 + unmap_addr = (buffer->dma_addr + buffer->len -
2017 + buffer->unmap_len);
2018 +@@ -836,6 +834,8 @@ static void efx_enqueue_unwind(struct efx_tx_queue *tx_queue)
2019 + PCI_DMA_TODEVICE);
2020 + buffer->unmap_len = 0;
2021 + }
2022 ++ buffer->len = 0;
2023 ++ buffer->continuation = true;
2024 + }
2025 + }
2026 +
2027 +diff --git a/drivers/net/wireless/ath/ar9170/usb.c b/drivers/net/wireless/ath/ar9170/usb.c
2028 +index e974e58..f141a4f 100644
2029 +--- a/drivers/net/wireless/ath/ar9170/usb.c
2030 ++++ b/drivers/net/wireless/ath/ar9170/usb.c
2031 +@@ -68,8 +68,10 @@ static struct usb_device_id ar9170_usb_ids[] = {
2032 + { USB_DEVICE(0x0cf3, 0x1002) },
2033 + /* Cace Airpcap NX */
2034 + { USB_DEVICE(0xcace, 0x0300) },
2035 +- /* D-Link DWA 160A */
2036 ++ /* D-Link DWA 160 A1 */
2037 + { USB_DEVICE(0x07d1, 0x3c10) },
2038 ++ /* D-Link DWA 160 A2 */
2039 ++ { USB_DEVICE(0x07d1, 0x3a09) },
2040 + /* Netgear WNDA3100 */
2041 + { USB_DEVICE(0x0846, 0x9010) },
2042 + /* Netgear WN111 v2 */
2043 +diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
2044 +index 94a1225..133df70 100644
2045 +--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
2046 ++++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
2047 +@@ -1666,6 +1666,7 @@ struct iwl_cfg iwl5300_agn_cfg = {
2048 + .valid_rx_ant = ANT_ABC,
2049 + .need_pll_cfg = true,
2050 + .ht_greenfield_support = true,
2051 ++ .use_rts_for_ht = true, /* use rts/cts protection */
2052 + };
2053 +
2054 + struct iwl_cfg iwl5100_bg_cfg = {
2055 +@@ -1717,6 +1718,7 @@ struct iwl_cfg iwl5100_agn_cfg = {
2056 + .valid_rx_ant = ANT_AB,
2057 + .need_pll_cfg = true,
2058 + .ht_greenfield_support = true,
2059 ++ .use_rts_for_ht = true, /* use rts/cts protection */
2060 + };
2061 +
2062 + struct iwl_cfg iwl5350_agn_cfg = {
2063 +@@ -1734,6 +1736,7 @@ struct iwl_cfg iwl5350_agn_cfg = {
2064 + .valid_rx_ant = ANT_ABC,
2065 + .need_pll_cfg = true,
2066 + .ht_greenfield_support = true,
2067 ++ .use_rts_for_ht = true, /* use rts/cts protection */
2068 + };
2069 +
2070 + struct iwl_cfg iwl5150_agn_cfg = {
2071 +@@ -1751,6 +1754,7 @@ struct iwl_cfg iwl5150_agn_cfg = {
2072 + .valid_rx_ant = ANT_AB,
2073 + .need_pll_cfg = true,
2074 + .ht_greenfield_support = true,
2075 ++ .use_rts_for_ht = true, /* use rts/cts protection */
2076 + };
2077 +
2078 + MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX));
2079 +diff --git a/drivers/pci/pcie/aer/aer_inject.c b/drivers/pci/pcie/aer/aer_inject.c
2080 +index 62d15f6..0d91a8a 100644
2081 +--- a/drivers/pci/pcie/aer/aer_inject.c
2082 ++++ b/drivers/pci/pcie/aer/aer_inject.c
2083 +@@ -392,8 +392,14 @@ static int aer_inject(struct aer_error_inj *einj)
2084 + if (ret)
2085 + goto out_put;
2086 +
2087 +- if (find_aer_device(rpdev, &edev))
2088 ++ if (find_aer_device(rpdev, &edev)) {
2089 ++ if (!get_service_data(edev)) {
2090 ++ printk(KERN_WARNING "AER service is not initialized\n");
2091 ++ ret = -EINVAL;
2092 ++ goto out_put;
2093 ++ }
2094 + aer_irq(-1, edev);
2095 ++ }
2096 + else
2097 + ret = -EINVAL;
2098 + out_put:
2099 +diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
2100 +index cb1a027..dd58c6a 100644
2101 +--- a/drivers/pci/setup-bus.c
2102 ++++ b/drivers/pci/setup-bus.c
2103 +@@ -142,7 +142,6 @@ static void pci_setup_bridge(struct pci_bus *bus)
2104 + struct pci_dev *bridge = bus->self;
2105 + struct pci_bus_region region;
2106 + u32 l, bu, lu, io_upper16;
2107 +- int pref_mem64;
2108 +
2109 + if (pci_is_enabled(bridge))
2110 + return;
2111 +@@ -198,7 +197,6 @@ static void pci_setup_bridge(struct pci_bus *bus)
2112 + pci_write_config_dword(bridge, PCI_PREF_LIMIT_UPPER32, 0);
2113 +
2114 + /* Set up PREF base/limit. */
2115 +- pref_mem64 = 0;
2116 + bu = lu = 0;
2117 + pcibios_resource_to_bus(bridge, &region, bus->resource[2]);
2118 + if (bus->resource[2]->flags & IORESOURCE_PREFETCH) {
2119 +@@ -206,7 +204,6 @@ static void pci_setup_bridge(struct pci_bus *bus)
2120 + l = (region.start >> 16) & 0xfff0;
2121 + l |= region.end & 0xfff00000;
2122 + if (bus->resource[2]->flags & IORESOURCE_MEM_64) {
2123 +- pref_mem64 = 1;
2124 + bu = upper_32_bits(region.start);
2125 + lu = upper_32_bits(region.end);
2126 + width = 16;
2127 +@@ -221,11 +218,9 @@ static void pci_setup_bridge(struct pci_bus *bus)
2128 + }
2129 + pci_write_config_dword(bridge, PCI_PREF_MEMORY_BASE, l);
2130 +
2131 +- if (pref_mem64) {
2132 +- /* Set the upper 32 bits of PREF base & limit. */
2133 +- pci_write_config_dword(bridge, PCI_PREF_BASE_UPPER32, bu);
2134 +- pci_write_config_dword(bridge, PCI_PREF_LIMIT_UPPER32, lu);
2135 +- }
2136 ++ /* Set the upper 32 bits of PREF base & limit. */
2137 ++ pci_write_config_dword(bridge, PCI_PREF_BASE_UPPER32, bu);
2138 ++ pci_write_config_dword(bridge, PCI_PREF_LIMIT_UPPER32, lu);
2139 +
2140 + pci_write_config_word(bridge, PCI_BRIDGE_CONTROL, bus->bridge_ctl);
2141 + }
2142 +diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
2143 +index 2490b74..55f9973 100644
2144 +--- a/drivers/s390/cio/device.c
2145 ++++ b/drivers/s390/cio/device.c
2146 +@@ -1292,7 +1292,7 @@ static int io_subchannel_probe(struct subchannel *sch)
2147 + sch->private = kzalloc(sizeof(struct io_subchannel_private),
2148 + GFP_KERNEL | GFP_DMA);
2149 + if (!sch->private)
2150 +- goto out_err;
2151 ++ goto out_schedule;
2152 + /*
2153 + * First check if a fitting device may be found amongst the
2154 + * disconnected devices or in the orphanage.
2155 +@@ -1317,7 +1317,7 @@ static int io_subchannel_probe(struct subchannel *sch)
2156 + }
2157 + cdev = io_subchannel_create_ccwdev(sch);
2158 + if (IS_ERR(cdev))
2159 +- goto out_err;
2160 ++ goto out_schedule;
2161 + rc = io_subchannel_recog(cdev, sch);
2162 + if (rc) {
2163 + spin_lock_irqsave(sch->lock, flags);
2164 +@@ -1325,9 +1325,7 @@ static int io_subchannel_probe(struct subchannel *sch)
2165 + spin_unlock_irqrestore(sch->lock, flags);
2166 + }
2167 + return 0;
2168 +-out_err:
2169 +- kfree(sch->private);
2170 +- sysfs_remove_group(&sch->dev.kobj, &io_subchannel_attr_group);
2171 ++
2172 + out_schedule:
2173 + io_subchannel_schedule_removal(sch);
2174 + return 0;
2175 +@@ -1341,13 +1339,14 @@ io_subchannel_remove (struct subchannel *sch)
2176 +
2177 + cdev = sch_get_cdev(sch);
2178 + if (!cdev)
2179 +- return 0;
2180 ++ goto out_free;
2181 + /* Set ccw device to not operational and drop reference. */
2182 + spin_lock_irqsave(cdev->ccwlock, flags);
2183 + sch_set_cdev(sch, NULL);
2184 + cdev->private->state = DEV_STATE_NOT_OPER;
2185 + spin_unlock_irqrestore(cdev->ccwlock, flags);
2186 + ccw_device_unregister(cdev);
2187 ++out_free:
2188 + kfree(sch->private);
2189 + sysfs_remove_group(&sch->dev.kobj, &io_subchannel_attr_group);
2190 + return 0;
2191 +diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c
2192 +index b9613d7..13b703a 100644
2193 +--- a/drivers/s390/cio/device_fsm.c
2194 ++++ b/drivers/s390/cio/device_fsm.c
2195 +@@ -1080,14 +1080,14 @@ void ccw_device_trigger_reprobe(struct ccw_device *cdev)
2196 + ccw_device_start_id(cdev, 0);
2197 + }
2198 +
2199 +-static void
2200 +-ccw_device_offline_irq(struct ccw_device *cdev, enum dev_event dev_event)
2201 ++static void ccw_device_disabled_irq(struct ccw_device *cdev,
2202 ++ enum dev_event dev_event)
2203 + {
2204 + struct subchannel *sch;
2205 +
2206 + sch = to_subchannel(cdev->dev.parent);
2207 + /*
2208 +- * An interrupt in state offline means a previous disable was not
2209 ++ * An interrupt in a disabled state means a previous disable was not
2210 + * successful - should not happen, but we try to disable again.
2211 + */
2212 + cio_disable_subchannel(sch);
2213 +@@ -1150,25 +1150,12 @@ ccw_device_nop(struct ccw_device *cdev, enum dev_event dev_event)
2214 + }
2215 +
2216 + /*
2217 +- * Bug operation action.
2218 +- */
2219 +-static void
2220 +-ccw_device_bug(struct ccw_device *cdev, enum dev_event dev_event)
2221 +-{
2222 +- CIO_MSG_EVENT(0, "Internal state [%i][%i] not handled for device "
2223 +- "0.%x.%04x\n", cdev->private->state, dev_event,
2224 +- cdev->private->dev_id.ssid,
2225 +- cdev->private->dev_id.devno);
2226 +- BUG();
2227 +-}
2228 +-
2229 +-/*
2230 + * device statemachine
2231 + */
2232 + fsm_func_t *dev_jumptable[NR_DEV_STATES][NR_DEV_EVENTS] = {
2233 + [DEV_STATE_NOT_OPER] = {
2234 + [DEV_EVENT_NOTOPER] = ccw_device_nop,
2235 +- [DEV_EVENT_INTERRUPT] = ccw_device_bug,
2236 ++ [DEV_EVENT_INTERRUPT] = ccw_device_disabled_irq,
2237 + [DEV_EVENT_TIMEOUT] = ccw_device_nop,
2238 + [DEV_EVENT_VERIFY] = ccw_device_nop,
2239 + },
2240 +@@ -1186,7 +1173,7 @@ fsm_func_t *dev_jumptable[NR_DEV_STATES][NR_DEV_EVENTS] = {
2241 + },
2242 + [DEV_STATE_OFFLINE] = {
2243 + [DEV_EVENT_NOTOPER] = ccw_device_generic_notoper,
2244 +- [DEV_EVENT_INTERRUPT] = ccw_device_offline_irq,
2245 ++ [DEV_EVENT_INTERRUPT] = ccw_device_disabled_irq,
2246 + [DEV_EVENT_TIMEOUT] = ccw_device_nop,
2247 + [DEV_EVENT_VERIFY] = ccw_device_offline_verify,
2248 + },
2249 +@@ -1243,7 +1230,7 @@ fsm_func_t *dev_jumptable[NR_DEV_STATES][NR_DEV_EVENTS] = {
2250 + [DEV_STATE_DISCONNECTED] = {
2251 + [DEV_EVENT_NOTOPER] = ccw_device_nop,
2252 + [DEV_EVENT_INTERRUPT] = ccw_device_start_id,
2253 +- [DEV_EVENT_TIMEOUT] = ccw_device_bug,
2254 ++ [DEV_EVENT_TIMEOUT] = ccw_device_nop,
2255 + [DEV_EVENT_VERIFY] = ccw_device_start_id,
2256 + },
2257 + [DEV_STATE_DISCONNECTED_SENSE_ID] = {
2258 +diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
2259 +index c84eadd..395c04c 100644
2260 +--- a/drivers/s390/net/netiucv.c
2261 ++++ b/drivers/s390/net/netiucv.c
2262 +@@ -741,13 +741,13 @@ static void conn_action_txdone(fsm_instance *fi, int event, void *arg)
2263 + if (single_flag) {
2264 + if ((skb = skb_dequeue(&conn->commit_queue))) {
2265 + atomic_dec(&skb->users);
2266 +- dev_kfree_skb_any(skb);
2267 + if (privptr) {
2268 + privptr->stats.tx_packets++;
2269 + privptr->stats.tx_bytes +=
2270 + (skb->len - NETIUCV_HDRLEN
2271 +- - NETIUCV_HDRLEN);
2272 ++ - NETIUCV_HDRLEN);
2273 + }
2274 ++ dev_kfree_skb_any(skb);
2275 + }
2276 + }
2277 + conn->tx_buff->data = conn->tx_buff->head;
2278 +diff --git a/drivers/scsi/device_handler/scsi_dh.c b/drivers/scsi/device_handler/scsi_dh.c
2279 +index 3ee1cbc..bfec4fa 100644
2280 +--- a/drivers/scsi/device_handler/scsi_dh.c
2281 ++++ b/drivers/scsi/device_handler/scsi_dh.c
2282 +@@ -304,18 +304,15 @@ static int scsi_dh_notifier(struct notifier_block *nb,
2283 + sdev = to_scsi_device(dev);
2284 +
2285 + if (action == BUS_NOTIFY_ADD_DEVICE) {
2286 ++ err = device_create_file(dev, &scsi_dh_state_attr);
2287 ++ /* don't care about err */
2288 + devinfo = device_handler_match(NULL, sdev);
2289 +- if (!devinfo)
2290 +- goto out;
2291 +-
2292 +- err = scsi_dh_handler_attach(sdev, devinfo);
2293 +- if (!err)
2294 +- err = device_create_file(dev, &scsi_dh_state_attr);
2295 ++ if (devinfo)
2296 ++ err = scsi_dh_handler_attach(sdev, devinfo);
2297 + } else if (action == BUS_NOTIFY_DEL_DEVICE) {
2298 + device_remove_file(dev, &scsi_dh_state_attr);
2299 + scsi_dh_handler_detach(sdev, NULL);
2300 + }
2301 +-out:
2302 + return err;
2303 + }
2304 +
2305 +diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
2306 +index 704b8e0..70ab5d0 100644
2307 +--- a/drivers/scsi/fcoe/fcoe.c
2308 ++++ b/drivers/scsi/fcoe/fcoe.c
2309 +@@ -137,7 +137,7 @@ static struct scsi_host_template fcoe_shost_template = {
2310 + .change_queue_depth = fc_change_queue_depth,
2311 + .change_queue_type = fc_change_queue_type,
2312 + .this_id = -1,
2313 +- .cmd_per_lun = 32,
2314 ++ .cmd_per_lun = 3,
2315 + .can_queue = FCOE_MAX_OUTSTANDING_COMMANDS,
2316 + .use_clustering = ENABLE_CLUSTERING,
2317 + .sg_tablesize = SG_ALL,
2318 +@@ -160,6 +160,7 @@ static int fcoe_interface_setup(struct fcoe_interface *fcoe,
2319 + {
2320 + struct fcoe_ctlr *fip = &fcoe->ctlr;
2321 + struct netdev_hw_addr *ha;
2322 ++ struct net_device *real_dev;
2323 + u8 flogi_maddr[ETH_ALEN];
2324 +
2325 + fcoe->netdev = netdev;
2326 +@@ -173,10 +174,12 @@ static int fcoe_interface_setup(struct fcoe_interface *fcoe,
2327 +
2328 + /* look for SAN MAC address, if multiple SAN MACs exist, only
2329 + * use the first one for SPMA */
2330 ++ real_dev = (netdev->priv_flags & IFF_802_1Q_VLAN) ?
2331 ++ vlan_dev_real_dev(netdev) : netdev;
2332 + rcu_read_lock();
2333 +- for_each_dev_addr(netdev, ha) {
2334 ++ for_each_dev_addr(real_dev, ha) {
2335 + if ((ha->type == NETDEV_HW_ADDR_T_SAN) &&
2336 +- (is_valid_ether_addr(fip->ctl_src_addr))) {
2337 ++ (is_valid_ether_addr(ha->addr))) {
2338 + memcpy(fip->ctl_src_addr, ha->addr, ETH_ALEN);
2339 + fip->spma = 1;
2340 + break;
2341 +@@ -664,7 +667,7 @@ static int fcoe_ddp_setup(struct fc_lport *lp, u16 xid,
2342 + {
2343 + struct net_device *n = fcoe_netdev(lp);
2344 +
2345 +- if (n->netdev_ops && n->netdev_ops->ndo_fcoe_ddp_setup)
2346 ++ if (n->netdev_ops->ndo_fcoe_ddp_setup)
2347 + return n->netdev_ops->ndo_fcoe_ddp_setup(n, xid, sgl, sgc);
2348 +
2349 + return 0;
2350 +@@ -681,7 +684,7 @@ static int fcoe_ddp_done(struct fc_lport *lp, u16 xid)
2351 + {
2352 + struct net_device *n = fcoe_netdev(lp);
2353 +
2354 +- if (n->netdev_ops && n->netdev_ops->ndo_fcoe_ddp_done)
2355 ++ if (n->netdev_ops->ndo_fcoe_ddp_done)
2356 + return n->netdev_ops->ndo_fcoe_ddp_done(n, xid);
2357 + return 0;
2358 + }
2359 +@@ -1631,7 +1634,7 @@ static int fcoe_destroy(const char *buffer, struct kernel_param *kp)
2360 + {
2361 + struct fcoe_interface *fcoe;
2362 + struct net_device *netdev;
2363 +- int rc;
2364 ++ int rc = 0;
2365 +
2366 + mutex_lock(&fcoe_config_mutex);
2367 + #ifdef CONFIG_FCOE_MODULE
2368 +diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
2369 +index c48799e..d4cb3f9 100644
2370 +--- a/drivers/scsi/libfc/fc_disc.c
2371 ++++ b/drivers/scsi/libfc/fc_disc.c
2372 +@@ -371,7 +371,7 @@ static void fc_disc_gpn_ft_req(struct fc_disc *disc)
2373 + disc, lport->e_d_tov))
2374 + return;
2375 + err:
2376 +- fc_disc_error(disc, fp);
2377 ++ fc_disc_error(disc, NULL);
2378 + }
2379 +
2380 + /**
2381 +diff --git a/drivers/scsi/libfc/fc_elsct.c b/drivers/scsi/libfc/fc_elsct.c
2382 +index 5cfa687..9298458 100644
2383 +--- a/drivers/scsi/libfc/fc_elsct.c
2384 ++++ b/drivers/scsi/libfc/fc_elsct.c
2385 +@@ -53,8 +53,10 @@ static struct fc_seq *fc_elsct_send(struct fc_lport *lport,
2386 + did = FC_FID_DIR_SERV;
2387 + }
2388 +
2389 +- if (rc)
2390 ++ if (rc) {
2391 ++ fc_frame_free(fp);
2392 + return NULL;
2393 ++ }
2394 +
2395 + fc_fill_fc_hdr(fp, r_ctl, did, fc_host_port_id(lport->host), fh_type,
2396 + FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0);
2397 +diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
2398 +index 59a4408..7a14402 100644
2399 +--- a/drivers/scsi/libfc/fc_fcp.c
2400 ++++ b/drivers/scsi/libfc/fc_fcp.c
2401 +@@ -302,10 +302,13 @@ static void fc_fcp_ddp_done(struct fc_fcp_pkt *fsp)
2402 + if (!fsp)
2403 + return;
2404 +
2405 ++ if (fsp->xfer_ddp == FC_XID_UNKNOWN)
2406 ++ return;
2407 ++
2408 + lp = fsp->lp;
2409 +- if (fsp->xfer_ddp && lp->tt.ddp_done) {
2410 ++ if (lp->tt.ddp_done) {
2411 + fsp->xfer_len = lp->tt.ddp_done(lp, fsp->xfer_ddp);
2412 +- fsp->xfer_ddp = 0;
2413 ++ fsp->xfer_ddp = FC_XID_UNKNOWN;
2414 + }
2415 + }
2416 +
2417 +@@ -572,7 +575,8 @@ static int fc_fcp_send_data(struct fc_fcp_pkt *fsp, struct fc_seq *seq,
2418 + tlen -= sg_bytes;
2419 + remaining -= sg_bytes;
2420 +
2421 +- if (tlen)
2422 ++ if ((skb_shinfo(fp_skb(fp))->nr_frags < FC_FRAME_SG_LEN) &&
2423 ++ (tlen))
2424 + continue;
2425 +
2426 + /*
2427 +@@ -1048,7 +1052,6 @@ static int fc_fcp_cmd_send(struct fc_lport *lp, struct fc_fcp_pkt *fsp,
2428 +
2429 + seq = lp->tt.exch_seq_send(lp, fp, resp, fc_fcp_pkt_destroy, fsp, 0);
2430 + if (!seq) {
2431 +- fc_frame_free(fp);
2432 + rc = -1;
2433 + goto unlock;
2434 + }
2435 +@@ -1313,7 +1316,6 @@ static void fc_fcp_rec(struct fc_fcp_pkt *fsp)
2436 + fc_fcp_pkt_hold(fsp); /* hold while REC outstanding */
2437 + return;
2438 + }
2439 +- fc_frame_free(fp);
2440 + retry:
2441 + if (fsp->recov_retry++ < FC_MAX_RECOV_RETRY)
2442 + fc_fcp_timer_set(fsp, FC_SCSI_REC_TOV);
2443 +@@ -1561,10 +1563,9 @@ static void fc_fcp_srr(struct fc_fcp_pkt *fsp, enum fc_rctl r_ctl, u32 offset)
2444 +
2445 + seq = lp->tt.exch_seq_send(lp, fp, fc_fcp_srr_resp, NULL,
2446 + fsp, jiffies_to_msecs(FC_SCSI_REC_TOV));
2447 +- if (!seq) {
2448 +- fc_frame_free(fp);
2449 ++ if (!seq)
2450 + goto retry;
2451 +- }
2452 ++
2453 + fsp->recov_seq = seq;
2454 + fsp->xfer_len = offset;
2455 + fsp->xfer_contig_end = offset;
2456 +@@ -1708,6 +1709,7 @@ int fc_queuecommand(struct scsi_cmnd *sc_cmd, void (*done)(struct scsi_cmnd *))
2457 + fsp->cmd = sc_cmd; /* save the cmd */
2458 + fsp->lp = lp; /* save the softc ptr */
2459 + fsp->rport = rport; /* set the remote port ptr */
2460 ++ fsp->xfer_ddp = FC_XID_UNKNOWN;
2461 + sc_cmd->scsi_done = done;
2462 +
2463 + /*
2464 +@@ -1846,7 +1848,8 @@ static void fc_io_compl(struct fc_fcp_pkt *fsp)
2465 + * scsi status is good but transport level
2466 + * underrun.
2467 + */
2468 +- sc_cmd->result = DID_OK << 16;
2469 ++ sc_cmd->result = (fsp->state & FC_SRB_RCV_STATUS ?
2470 ++ DID_OK : DID_ERROR) << 16;
2471 + } else {
2472 + /*
2473 + * scsi got underrun, this is an error
2474 +@@ -2046,18 +2049,16 @@ EXPORT_SYMBOL(fc_eh_host_reset);
2475 + int fc_slave_alloc(struct scsi_device *sdev)
2476 + {
2477 + struct fc_rport *rport = starget_to_rport(scsi_target(sdev));
2478 +- int queue_depth;
2479 +
2480 + if (!rport || fc_remote_port_chkready(rport))
2481 + return -ENXIO;
2482 +
2483 +- if (sdev->tagged_supported) {
2484 +- if (sdev->host->hostt->cmd_per_lun)
2485 +- queue_depth = sdev->host->hostt->cmd_per_lun;
2486 +- else
2487 +- queue_depth = FC_FCP_DFLT_QUEUE_DEPTH;
2488 +- scsi_activate_tcq(sdev, queue_depth);
2489 +- }
2490 ++ if (sdev->tagged_supported)
2491 ++ scsi_activate_tcq(sdev, FC_FCP_DFLT_QUEUE_DEPTH);
2492 ++ else
2493 ++ scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev),
2494 ++ FC_FCP_DFLT_QUEUE_DEPTH);
2495 ++
2496 + return 0;
2497 + }
2498 + EXPORT_SYMBOL(fc_slave_alloc);
2499 +diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
2500 +index bd2f771..536492a 100644
2501 +--- a/drivers/scsi/libfc/fc_lport.c
2502 ++++ b/drivers/scsi/libfc/fc_lport.c
2503 +@@ -329,7 +329,7 @@ static void fc_lport_add_fc4_type(struct fc_lport *lport, enum fc_fh_type type)
2504 + * @sp: current sequence in the RLIR exchange
2505 + * @fp: RLIR request frame
2506 + *
2507 +- * Locking Note: The lport lock is exected to be held before calling
2508 ++ * Locking Note: The lport lock is expected to be held before calling
2509 + * this function.
2510 + */
2511 + static void fc_lport_recv_rlir_req(struct fc_seq *sp, struct fc_frame *fp,
2512 +@@ -348,7 +348,7 @@ static void fc_lport_recv_rlir_req(struct fc_seq *sp, struct fc_frame *fp,
2513 + * @sp: current sequence in the ECHO exchange
2514 + * @fp: ECHO request frame
2515 + *
2516 +- * Locking Note: The lport lock is exected to be held before calling
2517 ++ * Locking Note: The lport lock is expected to be held before calling
2518 + * this function.
2519 + */
2520 + static void fc_lport_recv_echo_req(struct fc_seq *sp, struct fc_frame *in_fp,
2521 +@@ -361,7 +361,7 @@ static void fc_lport_recv_echo_req(struct fc_seq *sp, struct fc_frame *in_fp,
2522 + void *dp;
2523 + u32 f_ctl;
2524 +
2525 +- FC_LPORT_DBG(lport, "Received RLIR request while in state %s\n",
2526 ++ FC_LPORT_DBG(lport, "Received ECHO request while in state %s\n",
2527 + fc_lport_state(lport));
2528 +
2529 + len = fr_len(in_fp) - sizeof(struct fc_frame_header);
2530 +@@ -374,7 +374,7 @@ static void fc_lport_recv_echo_req(struct fc_seq *sp, struct fc_frame *in_fp,
2531 + if (fp) {
2532 + dp = fc_frame_payload_get(fp, len);
2533 + memcpy(dp, pp, len);
2534 +- *((u32 *)dp) = htonl(ELS_LS_ACC << 24);
2535 ++ *((__be32 *)dp) = htonl(ELS_LS_ACC << 24);
2536 + sp = lport->tt.seq_start_next(sp);
2537 + f_ctl = FC_FC_EX_CTX | FC_FC_LAST_SEQ | FC_FC_END_SEQ;
2538 + fc_fill_fc_hdr(fp, FC_RCTL_ELS_REP, ep->did, ep->sid,
2539 +@@ -385,12 +385,12 @@ static void fc_lport_recv_echo_req(struct fc_seq *sp, struct fc_frame *in_fp,
2540 + }
2541 +
2542 + /**
2543 +- * fc_lport_recv_echo_req() - Handle received Request Node ID data request
2544 +- * @lport: Fibre Channel local port recieving the RNID
2545 +- * @sp: current sequence in the RNID exchange
2546 +- * @fp: RNID request frame
2547 ++ * fc_lport_recv_rnid_req() - Handle received Request Node ID data request
2548 ++ * @sp: The sequence in the RNID exchange
2549 ++ * @fp: The RNID request frame
2550 ++ * @lport: The local port recieving the RNID
2551 + *
2552 +- * Locking Note: The lport lock is exected to be held before calling
2553 ++ * Locking Note: The lport lock is expected to be held before calling
2554 + * this function.
2555 + */
2556 + static void fc_lport_recv_rnid_req(struct fc_seq *sp, struct fc_frame *in_fp,
2557 +@@ -667,7 +667,7 @@ static void fc_lport_enter_ready(struct fc_lport *lport)
2558 + * Accept it with the common service parameters indicating our N port.
2559 + * Set up to do a PLOGI if we have the higher-number WWPN.
2560 + *
2561 +- * Locking Note: The lport lock is exected to be held before calling
2562 ++ * Locking Note: The lport lock is expected to be held before calling
2563 + * this function.
2564 + */
2565 + static void fc_lport_recv_flogi_req(struct fc_seq *sp_in,
2566 +@@ -1115,7 +1115,7 @@ static void fc_lport_enter_scr(struct fc_lport *lport)
2567 +
2568 + if (!lport->tt.elsct_send(lport, FC_FID_FCTRL, fp, ELS_SCR,
2569 + fc_lport_scr_resp, lport, lport->e_d_tov))
2570 +- fc_lport_error(lport, fp);
2571 ++ fc_lport_error(lport, NULL);
2572 + }
2573 +
2574 + /**
2575 +@@ -1186,7 +1186,7 @@ static void fc_lport_enter_rpn_id(struct fc_lport *lport)
2576 + if (!lport->tt.elsct_send(lport, FC_FID_DIR_SERV, fp, FC_NS_RPN_ID,
2577 + fc_lport_rpn_id_resp,
2578 + lport, lport->e_d_tov))
2579 +- fc_lport_error(lport, fp);
2580 ++ fc_lport_error(lport, NULL);
2581 + }
2582 +
2583 + static struct fc_rport_operations fc_lport_rport_ops = {
2584 +@@ -1237,10 +1237,13 @@ static void fc_lport_timeout(struct work_struct *work)
2585 +
2586 + switch (lport->state) {
2587 + case LPORT_ST_DISABLED:
2588 ++ WARN_ON(1);
2589 ++ break;
2590 + case LPORT_ST_READY:
2591 +- case LPORT_ST_RESET:
2592 + WARN_ON(1);
2593 + break;
2594 ++ case LPORT_ST_RESET:
2595 ++ break;
2596 + case LPORT_ST_FLOGI:
2597 + fc_lport_enter_flogi(lport);
2598 + break;
2599 +@@ -1337,7 +1340,7 @@ static void fc_lport_enter_logo(struct fc_lport *lport)
2600 +
2601 + if (!lport->tt.elsct_send(lport, FC_FID_FLOGI, fp, ELS_LOGO,
2602 + fc_lport_logo_resp, lport, lport->e_d_tov))
2603 +- fc_lport_error(lport, fp);
2604 ++ fc_lport_error(lport, NULL);
2605 + }
2606 +
2607 + /**
2608 +@@ -1453,7 +1456,7 @@ void fc_lport_enter_flogi(struct fc_lport *lport)
2609 +
2610 + if (!lport->tt.elsct_send(lport, FC_FID_FLOGI, fp, ELS_FLOGI,
2611 + fc_lport_flogi_resp, lport, lport->e_d_tov))
2612 +- fc_lport_error(lport, fp);
2613 ++ fc_lport_error(lport, NULL);
2614 + }
2615 +
2616 + /* Configure a fc_lport */
2617 +diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
2618 +index 03ea674..ff558a6 100644
2619 +--- a/drivers/scsi/libfc/fc_rport.c
2620 ++++ b/drivers/scsi/libfc/fc_rport.c
2621 +@@ -86,6 +86,7 @@ static const char *fc_rport_state_names[] = {
2622 + [RPORT_ST_LOGO] = "LOGO",
2623 + [RPORT_ST_ADISC] = "ADISC",
2624 + [RPORT_ST_DELETE] = "Delete",
2625 ++ [RPORT_ST_RESTART] = "Restart",
2626 + };
2627 +
2628 + /**
2629 +@@ -99,8 +100,7 @@ static struct fc_rport_priv *fc_rport_lookup(const struct fc_lport *lport,
2630 + struct fc_rport_priv *rdata;
2631 +
2632 + list_for_each_entry(rdata, &lport->disc.rports, peers)
2633 +- if (rdata->ids.port_id == port_id &&
2634 +- rdata->rp_state != RPORT_ST_DELETE)
2635 ++ if (rdata->ids.port_id == port_id)
2636 + return rdata;
2637 + return NULL;
2638 + }
2639 +@@ -235,6 +235,7 @@ static void fc_rport_work(struct work_struct *work)
2640 + struct fc_rport_operations *rport_ops;
2641 + struct fc_rport_identifiers ids;
2642 + struct fc_rport *rport;
2643 ++ int restart = 0;
2644 +
2645 + mutex_lock(&rdata->rp_mutex);
2646 + event = rdata->event;
2647 +@@ -287,8 +288,20 @@ static void fc_rport_work(struct work_struct *work)
2648 + mutex_unlock(&rdata->rp_mutex);
2649 +
2650 + if (port_id != FC_FID_DIR_SERV) {
2651 ++ /*
2652 ++ * We must drop rp_mutex before taking disc_mutex.
2653 ++ * Re-evaluate state to allow for restart.
2654 ++ * A transition to RESTART state must only happen
2655 ++ * while disc_mutex is held and rdata is on the list.
2656 ++ */
2657 + mutex_lock(&lport->disc.disc_mutex);
2658 +- list_del(&rdata->peers);
2659 ++ mutex_lock(&rdata->rp_mutex);
2660 ++ if (rdata->rp_state == RPORT_ST_RESTART)
2661 ++ restart = 1;
2662 ++ else
2663 ++ list_del(&rdata->peers);
2664 ++ rdata->event = RPORT_EV_NONE;
2665 ++ mutex_unlock(&rdata->rp_mutex);
2666 + mutex_unlock(&lport->disc.disc_mutex);
2667 + }
2668 +
2669 +@@ -312,7 +325,13 @@ static void fc_rport_work(struct work_struct *work)
2670 + mutex_unlock(&rdata->rp_mutex);
2671 + fc_remote_port_delete(rport);
2672 + }
2673 +- kref_put(&rdata->kref, lport->tt.rport_destroy);
2674 ++ if (restart) {
2675 ++ mutex_lock(&rdata->rp_mutex);
2676 ++ FC_RPORT_DBG(rdata, "work restart\n");
2677 ++ fc_rport_enter_plogi(rdata);
2678 ++ mutex_unlock(&rdata->rp_mutex);
2679 ++ } else
2680 ++ kref_put(&rdata->kref, lport->tt.rport_destroy);
2681 + break;
2682 +
2683 + default:
2684 +@@ -342,6 +361,12 @@ int fc_rport_login(struct fc_rport_priv *rdata)
2685 + FC_RPORT_DBG(rdata, "ADISC port\n");
2686 + fc_rport_enter_adisc(rdata);
2687 + break;
2688 ++ case RPORT_ST_RESTART:
2689 ++ break;
2690 ++ case RPORT_ST_DELETE:
2691 ++ FC_RPORT_DBG(rdata, "Restart deleted port\n");
2692 ++ fc_rport_state_enter(rdata, RPORT_ST_RESTART);
2693 ++ break;
2694 + default:
2695 + FC_RPORT_DBG(rdata, "Login to port\n");
2696 + fc_rport_enter_plogi(rdata);
2697 +@@ -397,20 +422,21 @@ int fc_rport_logoff(struct fc_rport_priv *rdata)
2698 +
2699 + if (rdata->rp_state == RPORT_ST_DELETE) {
2700 + FC_RPORT_DBG(rdata, "Port in Delete state, not removing\n");
2701 +- mutex_unlock(&rdata->rp_mutex);
2702 + goto out;
2703 + }
2704 +
2705 +- fc_rport_enter_logo(rdata);
2706 ++ if (rdata->rp_state == RPORT_ST_RESTART)
2707 ++ FC_RPORT_DBG(rdata, "Port in Restart state, deleting\n");
2708 ++ else
2709 ++ fc_rport_enter_logo(rdata);
2710 +
2711 + /*
2712 + * Change the state to Delete so that we discard
2713 + * the response.
2714 + */
2715 + fc_rport_enter_delete(rdata, RPORT_EV_STOP);
2716 +- mutex_unlock(&rdata->rp_mutex);
2717 +-
2718 + out:
2719 ++ mutex_unlock(&rdata->rp_mutex);
2720 + return 0;
2721 + }
2722 +
2723 +@@ -466,6 +492,7 @@ static void fc_rport_timeout(struct work_struct *work)
2724 + case RPORT_ST_READY:
2725 + case RPORT_ST_INIT:
2726 + case RPORT_ST_DELETE:
2727 ++ case RPORT_ST_RESTART:
2728 + break;
2729 + }
2730 +
2731 +@@ -499,6 +526,7 @@ static void fc_rport_error(struct fc_rport_priv *rdata, struct fc_frame *fp)
2732 + fc_rport_enter_logo(rdata);
2733 + break;
2734 + case RPORT_ST_DELETE:
2735 ++ case RPORT_ST_RESTART:
2736 + case RPORT_ST_READY:
2737 + case RPORT_ST_INIT:
2738 + break;
2739 +@@ -632,7 +660,7 @@ static void fc_rport_enter_plogi(struct fc_rport_priv *rdata)
2740 +
2741 + if (!lport->tt.elsct_send(lport, rdata->ids.port_id, fp, ELS_PLOGI,
2742 + fc_rport_plogi_resp, rdata, lport->e_d_tov))
2743 +- fc_rport_error_retry(rdata, fp);
2744 ++ fc_rport_error_retry(rdata, NULL);
2745 + else
2746 + kref_get(&rdata->kref);
2747 + }
2748 +@@ -793,7 +821,7 @@ static void fc_rport_enter_prli(struct fc_rport_priv *rdata)
2749 +
2750 + if (!lport->tt.elsct_send(lport, rdata->ids.port_id, fp, ELS_PRLI,
2751 + fc_rport_prli_resp, rdata, lport->e_d_tov))
2752 +- fc_rport_error_retry(rdata, fp);
2753 ++ fc_rport_error_retry(rdata, NULL);
2754 + else
2755 + kref_get(&rdata->kref);
2756 + }
2757 +@@ -889,7 +917,7 @@ static void fc_rport_enter_rtv(struct fc_rport_priv *rdata)
2758 +
2759 + if (!lport->tt.elsct_send(lport, rdata->ids.port_id, fp, ELS_RTV,
2760 + fc_rport_rtv_resp, rdata, lport->e_d_tov))
2761 +- fc_rport_error_retry(rdata, fp);
2762 ++ fc_rport_error_retry(rdata, NULL);
2763 + else
2764 + kref_get(&rdata->kref);
2765 + }
2766 +@@ -919,7 +947,7 @@ static void fc_rport_enter_logo(struct fc_rport_priv *rdata)
2767 +
2768 + if (!lport->tt.elsct_send(lport, rdata->ids.port_id, fp, ELS_LOGO,
2769 + fc_rport_logo_resp, rdata, lport->e_d_tov))
2770 +- fc_rport_error_retry(rdata, fp);
2771 ++ fc_rport_error_retry(rdata, NULL);
2772 + else
2773 + kref_get(&rdata->kref);
2774 + }
2775 +@@ -1006,7 +1034,7 @@ static void fc_rport_enter_adisc(struct fc_rport_priv *rdata)
2776 + }
2777 + if (!lport->tt.elsct_send(lport, rdata->ids.port_id, fp, ELS_ADISC,
2778 + fc_rport_adisc_resp, rdata, lport->e_d_tov))
2779 +- fc_rport_error_retry(rdata, fp);
2780 ++ fc_rport_error_retry(rdata, NULL);
2781 + else
2782 + kref_get(&rdata->kref);
2783 + }
2784 +@@ -1248,6 +1276,7 @@ static void fc_rport_recv_plogi_req(struct fc_lport *lport,
2785 + }
2786 + break;
2787 + case RPORT_ST_PRLI:
2788 ++ case RPORT_ST_RTV:
2789 + case RPORT_ST_READY:
2790 + case RPORT_ST_ADISC:
2791 + FC_RPORT_DBG(rdata, "Received PLOGI in logged-in state %d "
2792 +@@ -1255,11 +1284,14 @@ static void fc_rport_recv_plogi_req(struct fc_lport *lport,
2793 + /* XXX TBD - should reset */
2794 + break;
2795 + case RPORT_ST_DELETE:
2796 +- default:
2797 +- FC_RPORT_DBG(rdata, "Received PLOGI in unexpected state %d\n",
2798 +- rdata->rp_state);
2799 +- fc_frame_free(rx_fp);
2800 +- goto out;
2801 ++ case RPORT_ST_LOGO:
2802 ++ case RPORT_ST_RESTART:
2803 ++ FC_RPORT_DBG(rdata, "Received PLOGI in state %s - send busy\n",
2804 ++ fc_rport_state(rdata));
2805 ++ mutex_unlock(&rdata->rp_mutex);
2806 ++ rjt_data.reason = ELS_RJT_BUSY;
2807 ++ rjt_data.explan = ELS_EXPL_NONE;
2808 ++ goto reject;
2809 + }
2810 +
2811 + /*
2812 +@@ -1402,7 +1434,7 @@ static void fc_rport_recv_prli_req(struct fc_rport_priv *rdata,
2813 + break;
2814 + case FC_TYPE_FCP:
2815 + fcp_parm = ntohl(rspp->spp_params);
2816 +- if (fcp_parm * FCP_SPPF_RETRY)
2817 ++ if (fcp_parm & FCP_SPPF_RETRY)
2818 + rdata->flags |= FC_RP_FLAGS_RETRY;
2819 + rdata->supported_classes = FC_COS_CLASS3;
2820 + if (fcp_parm & FCP_SPPF_INIT_FCN)
2821 +@@ -1510,14 +1542,14 @@ static void fc_rport_recv_logo_req(struct fc_lport *lport,
2822 + FC_RPORT_DBG(rdata, "Received LOGO request while in state %s\n",
2823 + fc_rport_state(rdata));
2824 +
2825 ++ fc_rport_enter_delete(rdata, RPORT_EV_LOGO);
2826 ++
2827 + /*
2828 +- * If the remote port was created due to discovery,
2829 +- * log back in. It may have seen a stale RSCN about us.
2830 ++ * If the remote port was created due to discovery, set state
2831 ++ * to log back in. It may have seen a stale RSCN about us.
2832 + */
2833 +- if (rdata->rp_state != RPORT_ST_DELETE && rdata->disc_id)
2834 +- fc_rport_enter_plogi(rdata);
2835 +- else
2836 +- fc_rport_enter_delete(rdata, RPORT_EV_LOGO);
2837 ++ if (rdata->disc_id)
2838 ++ fc_rport_state_enter(rdata, RPORT_ST_RESTART);
2839 + mutex_unlock(&rdata->rp_mutex);
2840 + } else
2841 + FC_RPORT_ID_DBG(lport, sid,
2842 +diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
2843 +index f913f1e..549bc7d 100644
2844 +--- a/drivers/scsi/lpfc/lpfc_init.c
2845 ++++ b/drivers/scsi/lpfc/lpfc_init.c
2846 +@@ -4384,9 +4384,13 @@ lpfc_sli_pci_mem_setup(struct lpfc_hba *phba)
2847 + pdev = phba->pcidev;
2848 +
2849 + /* Set the device DMA mask size */
2850 +- if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) != 0)
2851 +- if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) != 0)
2852 ++ if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) != 0
2853 ++ || pci_set_consistent_dma_mask(pdev,DMA_BIT_MASK(64)) != 0) {
2854 ++ if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) != 0
2855 ++ || pci_set_consistent_dma_mask(pdev,DMA_BIT_MASK(32)) != 0) {
2856 + return error;
2857 ++ }
2858 ++ }
2859 +
2860 + /* Get the bus address of Bar0 and Bar2 and the number of bytes
2861 + * required by each mapping.
2862 +@@ -5940,9 +5944,13 @@ lpfc_sli4_pci_mem_setup(struct lpfc_hba *phba)
2863 + pdev = phba->pcidev;
2864 +
2865 + /* Set the device DMA mask size */
2866 +- if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) != 0)
2867 +- if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) != 0)
2868 ++ if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) != 0
2869 ++ || pci_set_consistent_dma_mask(pdev,DMA_BIT_MASK(64)) != 0) {
2870 ++ if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) != 0
2871 ++ || pci_set_consistent_dma_mask(pdev,DMA_BIT_MASK(32)) != 0) {
2872 + return error;
2873 ++ }
2874 ++ }
2875 +
2876 + /* Get the bus address of SLI4 device Bar0, Bar1, and Bar2 and the
2877 + * number of bytes required by each mapping. They are actually
2878 +diff --git a/drivers/scsi/mpt2sas/mpi/mpi2_cnfg.h b/drivers/scsi/mpt2sas/mpi/mpi2_cnfg.h
2879 +index ab47c46..5af66db 100644
2880 +--- a/drivers/scsi/mpt2sas/mpi/mpi2_cnfg.h
2881 ++++ b/drivers/scsi/mpt2sas/mpi/mpi2_cnfg.h
2882 +@@ -348,6 +348,14 @@ typedef struct _MPI2_CONFIG_REPLY
2883 + #define MPI2_MFGPAGE_DEVID_SAS2108_3 (0x0077)
2884 + #define MPI2_MFGPAGE_DEVID_SAS2116_1 (0x0064)
2885 + #define MPI2_MFGPAGE_DEVID_SAS2116_2 (0x0065)
2886 ++#define MPI2_MFGPAGE_DEVID_SAS2208_1 (0x0080)
2887 ++#define MPI2_MFGPAGE_DEVID_SAS2208_2 (0x0081)
2888 ++#define MPI2_MFGPAGE_DEVID_SAS2208_3 (0x0082)
2889 ++#define MPI2_MFGPAGE_DEVID_SAS2208_4 (0x0083)
2890 ++#define MPI2_MFGPAGE_DEVID_SAS2208_5 (0x0084)
2891 ++#define MPI2_MFGPAGE_DEVID_SAS2208_6 (0x0085)
2892 ++#define MPI2_MFGPAGE_DEVID_SAS2208_7 (0x0086)
2893 ++#define MPI2_MFGPAGE_DEVID_SAS2208_8 (0x0087)
2894 +
2895 +
2896 + /* Manufacturing Page 0 */
2897 +diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
2898 +index 86ab32d..1743640 100644
2899 +--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
2900 ++++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
2901 +@@ -196,10 +196,28 @@ static struct pci_device_id scsih_pci_table[] = {
2902 + PCI_ANY_ID, PCI_ANY_ID },
2903 + { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2108_3,
2904 + PCI_ANY_ID, PCI_ANY_ID },
2905 ++ /* Meteor ~ 2116 */
2906 + { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2116_1,
2907 + PCI_ANY_ID, PCI_ANY_ID },
2908 + { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2116_2,
2909 + PCI_ANY_ID, PCI_ANY_ID },
2910 ++ /* Thunderbolt ~ 2208 */
2911 ++ { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2208_1,
2912 ++ PCI_ANY_ID, PCI_ANY_ID },
2913 ++ { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2208_2,
2914 ++ PCI_ANY_ID, PCI_ANY_ID },
2915 ++ { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2208_3,
2916 ++ PCI_ANY_ID, PCI_ANY_ID },
2917 ++ { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2208_4,
2918 ++ PCI_ANY_ID, PCI_ANY_ID },
2919 ++ { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2208_5,
2920 ++ PCI_ANY_ID, PCI_ANY_ID },
2921 ++ { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2208_6,
2922 ++ PCI_ANY_ID, PCI_ANY_ID },
2923 ++ { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2208_7,
2924 ++ PCI_ANY_ID, PCI_ANY_ID },
2925 ++ { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2208_8,
2926 ++ PCI_ANY_ID, PCI_ANY_ID },
2927 + {0} /* Terminating entry */
2928 + };
2929 + MODULE_DEVICE_TABLE(pci, scsih_pci_table);
2930 +diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
2931 +index 93c2622..802e91c 100644
2932 +--- a/drivers/scsi/scsi_devinfo.c
2933 ++++ b/drivers/scsi/scsi_devinfo.c
2934 +@@ -168,11 +168,10 @@ static struct {
2935 + {"Generic", "USB SD Reader", "1.00", BLIST_FORCELUN | BLIST_INQUIRY_36},
2936 + {"Generic", "USB Storage-SMC", "0180", BLIST_FORCELUN | BLIST_INQUIRY_36},
2937 + {"Generic", "USB Storage-SMC", "0207", BLIST_FORCELUN | BLIST_INQUIRY_36},
2938 +- {"HITACHI", "DF400", "*", BLIST_SPARSELUN},
2939 +- {"HITACHI", "DF500", "*", BLIST_SPARSELUN},
2940 +- {"HITACHI", "DF600", "*", BLIST_SPARSELUN},
2941 +- {"HITACHI", "DISK-SUBSYSTEM", "*", BLIST_ATTACH_PQ3 | BLIST_SPARSELUN | BLIST_LARGELUN},
2942 +- {"HITACHI", "OPEN-E", "*", BLIST_ATTACH_PQ3 | BLIST_SPARSELUN | BLIST_LARGELUN},
2943 ++ {"HITACHI", "DF400", "*", BLIST_REPORTLUN2},
2944 ++ {"HITACHI", "DF500", "*", BLIST_REPORTLUN2},
2945 ++ {"HITACHI", "DISK-SUBSYSTEM", "*", BLIST_REPORTLUN2},
2946 ++ {"HITACHI", "OPEN-", "*", BLIST_REPORTLUN2},
2947 + {"HITACHI", "OP-C-", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
2948 + {"HITACHI", "3380-", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
2949 + {"HITACHI", "3390-", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
2950 +diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
2951 +index 45be82f..bf52dec 100644
2952 +--- a/drivers/scsi/scsi_transport_fc.c
2953 ++++ b/drivers/scsi/scsi_transport_fc.c
2954 +@@ -2395,6 +2395,7 @@ fc_rport_final_delete(struct work_struct *work)
2955 + struct Scsi_Host *shost = rport_to_shost(rport);
2956 + struct fc_internal *i = to_fc_internal(shost->transportt);
2957 + unsigned long flags;
2958 ++ int do_callback = 0;
2959 +
2960 + /*
2961 + * if a scan is pending, flush the SCSI Host work_q so that
2962 +@@ -2433,8 +2434,15 @@ fc_rport_final_delete(struct work_struct *work)
2963 + * Avoid this call if we already called it when we preserved the
2964 + * rport for the binding.
2965 + */
2966 ++ spin_lock_irqsave(shost->host_lock, flags);
2967 + if (!(rport->flags & FC_RPORT_DEVLOSS_CALLBK_DONE) &&
2968 +- (i->f->dev_loss_tmo_callbk))
2969 ++ (i->f->dev_loss_tmo_callbk)) {
2970 ++ rport->flags |= FC_RPORT_DEVLOSS_CALLBK_DONE;
2971 ++ do_callback = 1;
2972 ++ }
2973 ++ spin_unlock_irqrestore(shost->host_lock, flags);
2974 ++
2975 ++ if (do_callback)
2976 + i->f->dev_loss_tmo_callbk(rport);
2977 +
2978 + fc_bsg_remove(rport->rqst_q);
2979 +@@ -2981,6 +2989,7 @@ fc_timeout_deleted_rport(struct work_struct *work)
2980 + struct fc_internal *i = to_fc_internal(shost->transportt);
2981 + struct fc_host_attrs *fc_host = shost_to_fc_host(shost);
2982 + unsigned long flags;
2983 ++ int do_callback = 0;
2984 +
2985 + spin_lock_irqsave(shost->host_lock, flags);
2986 +
2987 +@@ -3046,7 +3055,6 @@ fc_timeout_deleted_rport(struct work_struct *work)
2988 + rport->roles = FC_PORT_ROLE_UNKNOWN;
2989 + rport->port_state = FC_PORTSTATE_NOTPRESENT;
2990 + rport->flags &= ~FC_RPORT_FAST_FAIL_TIMEDOUT;
2991 +- rport->flags |= FC_RPORT_DEVLOSS_CALLBK_DONE;
2992 +
2993 + /*
2994 + * Pre-emptively kill I/O rather than waiting for the work queue
2995 +@@ -3056,32 +3064,40 @@ fc_timeout_deleted_rport(struct work_struct *work)
2996 + spin_unlock_irqrestore(shost->host_lock, flags);
2997 + fc_terminate_rport_io(rport);
2998 +
2999 +- BUG_ON(rport->port_state != FC_PORTSTATE_NOTPRESENT);
3000 ++ spin_lock_irqsave(shost->host_lock, flags);
3001 +
3002 +- /* remove the identifiers that aren't used in the consisting binding */
3003 +- switch (fc_host->tgtid_bind_type) {
3004 +- case FC_TGTID_BIND_BY_WWPN:
3005 +- rport->node_name = -1;
3006 +- rport->port_id = -1;
3007 +- break;
3008 +- case FC_TGTID_BIND_BY_WWNN:
3009 +- rport->port_name = -1;
3010 +- rport->port_id = -1;
3011 +- break;
3012 +- case FC_TGTID_BIND_BY_ID:
3013 +- rport->node_name = -1;
3014 +- rport->port_name = -1;
3015 +- break;
3016 +- case FC_TGTID_BIND_NONE: /* to keep compiler happy */
3017 +- break;
3018 ++ if (rport->port_state == FC_PORTSTATE_NOTPRESENT) { /* still missing */
3019 ++
3020 ++ /* remove the identifiers that aren't used in the consisting binding */
3021 ++ switch (fc_host->tgtid_bind_type) {
3022 ++ case FC_TGTID_BIND_BY_WWPN:
3023 ++ rport->node_name = -1;
3024 ++ rport->port_id = -1;
3025 ++ break;
3026 ++ case FC_TGTID_BIND_BY_WWNN:
3027 ++ rport->port_name = -1;
3028 ++ rport->port_id = -1;
3029 ++ break;
3030 ++ case FC_TGTID_BIND_BY_ID:
3031 ++ rport->node_name = -1;
3032 ++ rport->port_name = -1;
3033 ++ break;
3034 ++ case FC_TGTID_BIND_NONE: /* to keep compiler happy */
3035 ++ break;
3036 ++ }
3037 ++
3038 ++ /*
3039 ++ * As this only occurs if the remote port (scsi target)
3040 ++ * went away and didn't come back - we'll remove
3041 ++ * all attached scsi devices.
3042 ++ */
3043 ++ rport->flags |= FC_RPORT_DEVLOSS_CALLBK_DONE;
3044 ++ fc_queue_work(shost, &rport->stgt_delete_work);
3045 ++
3046 ++ do_callback = 1;
3047 + }
3048 +
3049 +- /*
3050 +- * As this only occurs if the remote port (scsi target)
3051 +- * went away and didn't come back - we'll remove
3052 +- * all attached scsi devices.
3053 +- */
3054 +- fc_queue_work(shost, &rport->stgt_delete_work);
3055 ++ spin_unlock_irqrestore(shost->host_lock, flags);
3056 +
3057 + /*
3058 + * Notify the driver that the rport is now dead. The LLDD will
3059 +@@ -3089,7 +3105,7 @@ fc_timeout_deleted_rport(struct work_struct *work)
3060 + *
3061 + * Note: we set the CALLBK_DONE flag above to correspond
3062 + */
3063 +- if (i->f->dev_loss_tmo_callbk)
3064 ++ if (do_callback && i->f->dev_loss_tmo_callbk)
3065 + i->f->dev_loss_tmo_callbk(rport);
3066 + }
3067 +
3068 +diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
3069 +index ad897df..de2f8c4 100644
3070 +--- a/drivers/scsi/scsi_transport_iscsi.c
3071 ++++ b/drivers/scsi/scsi_transport_iscsi.c
3072 +@@ -627,8 +627,10 @@ static void __iscsi_block_session(struct work_struct *work)
3073 + spin_unlock_irqrestore(&session->lock, flags);
3074 + scsi_target_block(&session->dev);
3075 + ISCSI_DBG_TRANS_SESSION(session, "Completed SCSI target blocking\n");
3076 +- queue_delayed_work(iscsi_eh_timer_workq, &session->recovery_work,
3077 +- session->recovery_tmo * HZ);
3078 ++ if (session->recovery_tmo >= 0)
3079 ++ queue_delayed_work(iscsi_eh_timer_workq,
3080 ++ &session->recovery_work,
3081 ++ session->recovery_tmo * HZ);
3082 + }
3083 +
3084 + void iscsi_block_session(struct iscsi_cls_session *session)
3085 +@@ -1348,8 +1350,7 @@ iscsi_set_param(struct iscsi_transport *transport, struct iscsi_uevent *ev)
3086 + switch (ev->u.set_param.param) {
3087 + case ISCSI_PARAM_SESS_RECOVERY_TMO:
3088 + sscanf(data, "%d", &value);
3089 +- if (value != 0)
3090 +- session->recovery_tmo = value;
3091 ++ session->recovery_tmo = value;
3092 + break;
3093 + default:
3094 + err = transport->set_param(conn, ev->u.set_param.param,
3095 +diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
3096 +index ebcc6d0..13a1b39 100644
3097 +--- a/drivers/usb/serial/ftdi_sio.c
3098 ++++ b/drivers/usb/serial/ftdi_sio.c
3099 +@@ -598,6 +598,20 @@ static struct usb_device_id id_table_combined [] = {
3100 + { USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) },
3101 + { USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) },
3102 + { USB_DEVICE(BANDB_VID, BANDB_USO9ML2_PID) },
3103 ++ { USB_DEVICE(BANDB_VID, BANDB_USOPTL4_PID) },
3104 ++ { USB_DEVICE(BANDB_VID, BANDB_USPTL4_PID) },
3105 ++ { USB_DEVICE(BANDB_VID, BANDB_USO9ML2DR_2_PID) },
3106 ++ { USB_DEVICE(BANDB_VID, BANDB_USO9ML2DR_PID) },
3107 ++ { USB_DEVICE(BANDB_VID, BANDB_USOPTL4DR2_PID) },
3108 ++ { USB_DEVICE(BANDB_VID, BANDB_USOPTL4DR_PID) },
3109 ++ { USB_DEVICE(BANDB_VID, BANDB_485USB9F_2W_PID) },
3110 ++ { USB_DEVICE(BANDB_VID, BANDB_485USB9F_4W_PID) },
3111 ++ { USB_DEVICE(BANDB_VID, BANDB_232USB9M_PID) },
3112 ++ { USB_DEVICE(BANDB_VID, BANDB_485USBTB_2W_PID) },
3113 ++ { USB_DEVICE(BANDB_VID, BANDB_485USBTB_4W_PID) },
3114 ++ { USB_DEVICE(BANDB_VID, BANDB_TTL5USB9M_PID) },
3115 ++ { USB_DEVICE(BANDB_VID, BANDB_TTL3USB9M_PID) },
3116 ++ { USB_DEVICE(BANDB_VID, BANDB_ZZ_PROG1_USB_PID) },
3117 + { USB_DEVICE(FTDI_VID, EVER_ECO_PRO_CDS) },
3118 + { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_1_PID) },
3119 + { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_2_PID) },
3120 +diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
3121 +index 6f31e0d..4586a24 100644
3122 +--- a/drivers/usb/serial/ftdi_sio.h
3123 ++++ b/drivers/usb/serial/ftdi_sio.h
3124 +@@ -662,6 +662,20 @@
3125 + #define BANDB_USOTL4_PID 0xAC01 /* USOTL4 Isolated RS-485 Converter */
3126 + #define BANDB_USTL4_PID 0xAC02 /* USTL4 RS-485 Converter */
3127 + #define BANDB_USO9ML2_PID 0xAC03 /* USO9ML2 Isolated RS-232 Converter */
3128 ++#define BANDB_USOPTL4_PID 0xAC11
3129 ++#define BANDB_USPTL4_PID 0xAC12
3130 ++#define BANDB_USO9ML2DR_2_PID 0xAC16
3131 ++#define BANDB_USO9ML2DR_PID 0xAC17
3132 ++#define BANDB_USOPTL4DR2_PID 0xAC18 /* USOPTL4R-2 2-port Isolated RS-232 Converter */
3133 ++#define BANDB_USOPTL4DR_PID 0xAC19
3134 ++#define BANDB_485USB9F_2W_PID 0xAC25
3135 ++#define BANDB_485USB9F_4W_PID 0xAC26
3136 ++#define BANDB_232USB9M_PID 0xAC27
3137 ++#define BANDB_485USBTB_2W_PID 0xAC33
3138 ++#define BANDB_485USBTB_4W_PID 0xAC34
3139 ++#define BANDB_TTL5USB9M_PID 0xAC49
3140 ++#define BANDB_TTL3USB9M_PID 0xAC50
3141 ++#define BANDB_ZZ_PROG1_USB_PID 0xBA02
3142 +
3143 + /*
3144 + * RM Michaelides CANview USB (http://www.rmcan.com)
3145 +diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
3146 +index f11abf5..485fa9c 100644
3147 +--- a/drivers/usb/serial/mos7840.c
3148 ++++ b/drivers/usb/serial/mos7840.c
3149 +@@ -121,8 +121,14 @@
3150 + * moschip_id_table_combined
3151 + */
3152 + #define USB_VENDOR_ID_BANDB 0x0856
3153 +-#define BANDB_DEVICE_ID_USOPTL4_4 0xAC44
3154 ++#define BANDB_DEVICE_ID_USO9ML2_2 0xAC22
3155 ++#define BANDB_DEVICE_ID_USO9ML2_4 0xAC24
3156 ++#define BANDB_DEVICE_ID_US9ML2_2 0xAC29
3157 ++#define BANDB_DEVICE_ID_US9ML2_4 0xAC30
3158 ++#define BANDB_DEVICE_ID_USPTL4_2 0xAC31
3159 ++#define BANDB_DEVICE_ID_USPTL4_4 0xAC32
3160 + #define BANDB_DEVICE_ID_USOPTL4_2 0xAC42
3161 ++#define BANDB_DEVICE_ID_USOPTL4_4 0xAC44
3162 +
3163 + /* This driver also supports
3164 + * ATEN UC2324 device using Moschip MCS7840
3165 +@@ -177,8 +183,14 @@
3166 + static struct usb_device_id moschip_port_id_table[] = {
3167 + {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)},
3168 + {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)},
3169 +- {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)},
3170 ++ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2)},
3171 ++ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_4)},
3172 ++ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_2)},
3173 ++ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_4)},
3174 ++ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_2)},
3175 ++ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_4)},
3176 + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)},
3177 ++ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)},
3178 + {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)},
3179 + {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)},
3180 + {} /* terminating entry */
3181 +@@ -187,8 +199,14 @@ static struct usb_device_id moschip_port_id_table[] = {
3182 + static __devinitdata struct usb_device_id moschip_id_table_combined[] = {
3183 + {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)},
3184 + {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)},
3185 +- {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)},
3186 ++ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2)},
3187 ++ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_4)},
3188 ++ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_2)},
3189 ++ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_4)},
3190 ++ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_2)},
3191 ++ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_4)},
3192 + {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)},
3193 ++ {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)},
3194 + {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)},
3195 + {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)},
3196 + {} /* terminating entry */
3197 +diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c
3198 +index 6a51edd..4bdb7f1 100644
3199 +--- a/drivers/watchdog/iTCO_wdt.c
3200 ++++ b/drivers/watchdog/iTCO_wdt.c
3201 +@@ -1,5 +1,5 @@
3202 + /*
3203 +- * intel TCO Watchdog Driver (Used in i82801 and i63xxESB chipsets)
3204 ++ * intel TCO Watchdog Driver
3205 + *
3206 + * (c) Copyright 2006-2009 Wim Van Sebroeck <wim@××××××.be>.
3207 + *
3208 +@@ -14,47 +14,24 @@
3209 + *
3210 + * The TCO watchdog is implemented in the following I/O controller hubs:
3211 + * (See the intel documentation on http://developer.intel.com.)
3212 +- * 82801AA (ICH) : document number 290655-003, 290677-014,
3213 +- * 82801AB (ICHO) : document number 290655-003, 290677-014,
3214 +- * 82801BA (ICH2) : document number 290687-002, 298242-027,
3215 +- * 82801BAM (ICH2-M) : document number 290687-002, 298242-027,
3216 +- * 82801CA (ICH3-S) : document number 290733-003, 290739-013,
3217 +- * 82801CAM (ICH3-M) : document number 290716-001, 290718-007,
3218 +- * 82801DB (ICH4) : document number 290744-001, 290745-025,
3219 +- * 82801DBM (ICH4-M) : document number 252337-001, 252663-008,
3220 +- * 82801E (C-ICH) : document number 273599-001, 273645-002,
3221 +- * 82801EB (ICH5) : document number 252516-001, 252517-028,
3222 +- * 82801ER (ICH5R) : document number 252516-001, 252517-028,
3223 +- * 6300ESB (6300ESB) : document number 300641-004, 300884-013,
3224 +- * 82801FB (ICH6) : document number 301473-002, 301474-026,
3225 +- * 82801FR (ICH6R) : document number 301473-002, 301474-026,
3226 +- * 82801FBM (ICH6-M) : document number 301473-002, 301474-026,
3227 +- * 82801FW (ICH6W) : document number 301473-001, 301474-026,
3228 +- * 82801FRW (ICH6RW) : document number 301473-001, 301474-026,
3229 +- * 631xESB (631xESB) : document number 313082-001, 313075-006,
3230 +- * 632xESB (632xESB) : document number 313082-001, 313075-006,
3231 +- * 82801GB (ICH7) : document number 307013-003, 307014-024,
3232 +- * 82801GR (ICH7R) : document number 307013-003, 307014-024,
3233 +- * 82801GDH (ICH7DH) : document number 307013-003, 307014-024,
3234 +- * 82801GBM (ICH7-M) : document number 307013-003, 307014-024,
3235 +- * 82801GHM (ICH7-M DH) : document number 307013-003, 307014-024,
3236 +- * 82801GU (ICH7-U) : document number 307013-003, 307014-024,
3237 +- * 82801HB (ICH8) : document number 313056-003, 313057-017,
3238 +- * 82801HR (ICH8R) : document number 313056-003, 313057-017,
3239 +- * 82801HBM (ICH8M) : document number 313056-003, 313057-017,
3240 +- * 82801HH (ICH8DH) : document number 313056-003, 313057-017,
3241 +- * 82801HO (ICH8DO) : document number 313056-003, 313057-017,
3242 +- * 82801HEM (ICH8M-E) : document number 313056-003, 313057-017,
3243 +- * 82801IB (ICH9) : document number 316972-004, 316973-012,
3244 +- * 82801IR (ICH9R) : document number 316972-004, 316973-012,
3245 +- * 82801IH (ICH9DH) : document number 316972-004, 316973-012,
3246 +- * 82801IO (ICH9DO) : document number 316972-004, 316973-012,
3247 +- * 82801IBM (ICH9M) : document number 316972-004, 316973-012,
3248 +- * 82801IEM (ICH9M-E) : document number 316972-004, 316973-012,
3249 +- * 82801JIB (ICH10) : document number 319973-002, 319974-002,
3250 +- * 82801JIR (ICH10R) : document number 319973-002, 319974-002,
3251 +- * 82801JD (ICH10D) : document number 319973-002, 319974-002,
3252 +- * 82801JDO (ICH10DO) : document number 319973-002, 319974-002
3253 ++ * document number 290655-003, 290677-014: 82801AA (ICH), 82801AB (ICHO)
3254 ++ * document number 290687-002, 298242-027: 82801BA (ICH2)
3255 ++ * document number 290733-003, 290739-013: 82801CA (ICH3-S)
3256 ++ * document number 290716-001, 290718-007: 82801CAM (ICH3-M)
3257 ++ * document number 290744-001, 290745-025: 82801DB (ICH4)
3258 ++ * document number 252337-001, 252663-008: 82801DBM (ICH4-M)
3259 ++ * document number 273599-001, 273645-002: 82801E (C-ICH)
3260 ++ * document number 252516-001, 252517-028: 82801EB (ICH5), 82801ER (ICH5R)
3261 ++ * document number 300641-004, 300884-013: 6300ESB
3262 ++ * document number 301473-002, 301474-026: 82801F (ICH6)
3263 ++ * document number 313082-001, 313075-006: 631xESB, 632xESB
3264 ++ * document number 307013-003, 307014-024: 82801G (ICH7)
3265 ++ * document number 313056-003, 313057-017: 82801H (ICH8)
3266 ++ * document number 316972-004, 316973-012: 82801I (ICH9)
3267 ++ * document number 319973-002, 319974-002: 82801J (ICH10)
3268 ++ * document number 322169-001, 322170-003: 5 Series, 3400 Series (PCH)
3269 ++ * document number 320066-003, 320257-008: EP80597 (IICH)
3270 ++ * document number TBD : Cougar Point (CPT)
3271 + */
3272 +
3273 + /*
3274 +@@ -122,6 +99,24 @@ enum iTCO_chipsets {
3275 + TCO_ICH10R, /* ICH10R */
3276 + TCO_ICH10D, /* ICH10D */
3277 + TCO_ICH10DO, /* ICH10DO */
3278 ++ TCO_PCH, /* PCH Desktop Full Featured */
3279 ++ TCO_PCHM, /* PCH Mobile Full Featured */
3280 ++ TCO_P55, /* P55 */
3281 ++ TCO_PM55, /* PM55 */
3282 ++ TCO_H55, /* H55 */
3283 ++ TCO_QM57, /* QM57 */
3284 ++ TCO_H57, /* H57 */
3285 ++ TCO_HM55, /* HM55 */
3286 ++ TCO_Q57, /* Q57 */
3287 ++ TCO_HM57, /* HM57 */
3288 ++ TCO_PCHMSFF, /* PCH Mobile SFF Full Featured */
3289 ++ TCO_QS57, /* QS57 */
3290 ++ TCO_3400, /* 3400 */
3291 ++ TCO_3420, /* 3420 */
3292 ++ TCO_3450, /* 3450 */
3293 ++ TCO_EP80579, /* EP80579 */
3294 ++ TCO_CPTD, /* CPT Desktop */
3295 ++ TCO_CPTM, /* CPT Mobile */
3296 + };
3297 +
3298 + static struct {
3299 +@@ -162,6 +157,24 @@ static struct {
3300 + {"ICH10R", 2},
3301 + {"ICH10D", 2},
3302 + {"ICH10DO", 2},
3303 ++ {"PCH Desktop Full Featured", 2},
3304 ++ {"PCH Mobile Full Featured", 2},
3305 ++ {"P55", 2},
3306 ++ {"PM55", 2},
3307 ++ {"H55", 2},
3308 ++ {"QM57", 2},
3309 ++ {"H57", 2},
3310 ++ {"HM55", 2},
3311 ++ {"Q57", 2},
3312 ++ {"HM57", 2},
3313 ++ {"PCH Mobile SFF Full Featured", 2},
3314 ++ {"QS57", 2},
3315 ++ {"3400", 2},
3316 ++ {"3420", 2},
3317 ++ {"3450", 2},
3318 ++ {"EP80579", 2},
3319 ++ {"CPT Desktop", 2},
3320 ++ {"CPT Mobile", 2},
3321 + {NULL, 0}
3322 + };
3323 +
3324 +@@ -230,6 +243,24 @@ static struct pci_device_id iTCO_wdt_pci_tbl[] = {
3325 + { ITCO_PCI_DEVICE(0x3a16, TCO_ICH10R)},
3326 + { ITCO_PCI_DEVICE(0x3a1a, TCO_ICH10D)},
3327 + { ITCO_PCI_DEVICE(0x3a14, TCO_ICH10DO)},
3328 ++ { ITCO_PCI_DEVICE(0x3b00, TCO_PCH)},
3329 ++ { ITCO_PCI_DEVICE(0x3b01, TCO_PCHM)},
3330 ++ { ITCO_PCI_DEVICE(0x3b02, TCO_P55)},
3331 ++ { ITCO_PCI_DEVICE(0x3b03, TCO_PM55)},
3332 ++ { ITCO_PCI_DEVICE(0x3b06, TCO_H55)},
3333 ++ { ITCO_PCI_DEVICE(0x3b07, TCO_QM57)},
3334 ++ { ITCO_PCI_DEVICE(0x3b08, TCO_H57)},
3335 ++ { ITCO_PCI_DEVICE(0x3b09, TCO_HM55)},
3336 ++ { ITCO_PCI_DEVICE(0x3b0a, TCO_Q57)},
3337 ++ { ITCO_PCI_DEVICE(0x3b0b, TCO_HM57)},
3338 ++ { ITCO_PCI_DEVICE(0x3b0d, TCO_PCHMSFF)},
3339 ++ { ITCO_PCI_DEVICE(0x3b0f, TCO_QS57)},
3340 ++ { ITCO_PCI_DEVICE(0x3b12, TCO_3400)},
3341 ++ { ITCO_PCI_DEVICE(0x3b14, TCO_3420)},
3342 ++ { ITCO_PCI_DEVICE(0x3b16, TCO_3450)},
3343 ++ { ITCO_PCI_DEVICE(0x5031, TCO_EP80579)},
3344 ++ { ITCO_PCI_DEVICE(0x1c42, TCO_CPTD)},
3345 ++ { ITCO_PCI_DEVICE(0x1c43, TCO_CPTM)},
3346 + { 0, }, /* End of list */
3347 + };
3348 + MODULE_DEVICE_TABLE(pci, iTCO_wdt_pci_tbl);
3349 +diff --git a/fs/fcntl.c b/fs/fcntl.c
3350 +index 97e01dc..5ef953e 100644
3351 +--- a/fs/fcntl.c
3352 ++++ b/fs/fcntl.c
3353 +@@ -199,7 +199,9 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
3354 + static void f_modown(struct file *filp, struct pid *pid, enum pid_type type,
3355 + int force)
3356 + {
3357 +- write_lock_irq(&filp->f_owner.lock);
3358 ++ unsigned long flags;
3359 ++
3360 ++ write_lock_irqsave(&filp->f_owner.lock, flags);
3361 + if (force || !filp->f_owner.pid) {
3362 + put_pid(filp->f_owner.pid);
3363 + filp->f_owner.pid = get_pid(pid);
3364 +@@ -211,7 +213,7 @@ static void f_modown(struct file *filp, struct pid *pid, enum pid_type type,
3365 + filp->f_owner.euid = cred->euid;
3366 + }
3367 + }
3368 +- write_unlock_irq(&filp->f_owner.lock);
3369 ++ write_unlock_irqrestore(&filp->f_owner.lock, flags);
3370 + }
3371 +
3372 + int __f_setown(struct file *filp, struct pid *pid, enum pid_type type,
3373 +diff --git a/fs/nfs/super.c b/fs/nfs/super.c
3374 +index 90be551..e71f0fd 100644
3375 +--- a/fs/nfs/super.c
3376 ++++ b/fs/nfs/super.c
3377 +@@ -734,8 +734,6 @@ static struct nfs_parsed_mount_data *nfs_alloc_parsed_mount_data(unsigned int ve
3378 +
3379 + data = kzalloc(sizeof(*data), GFP_KERNEL);
3380 + if (data) {
3381 +- data->rsize = NFS_MAX_FILE_IO_SIZE;
3382 +- data->wsize = NFS_MAX_FILE_IO_SIZE;
3383 + data->acregmin = NFS_DEF_ACREGMIN;
3384 + data->acregmax = NFS_DEF_ACREGMAX;
3385 + data->acdirmin = NFS_DEF_ACDIRMIN;
3386 +diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c
3387 +index 725d02f..6d9c6aa 100644
3388 +--- a/fs/nfsd/nfs4acl.c
3389 ++++ b/fs/nfsd/nfs4acl.c
3390 +@@ -389,7 +389,7 @@ sort_pacl(struct posix_acl *pacl)
3391 + sort_pacl_range(pacl, 1, i-1);
3392 +
3393 + BUG_ON(pacl->a_entries[i].e_tag != ACL_GROUP_OBJ);
3394 +- j = i++;
3395 ++ j = ++i;
3396 + while (pacl->a_entries[j].e_tag == ACL_GROUP)
3397 + j++;
3398 + sort_pacl_range(pacl, i, j-1);
3399 +diff --git a/fs/partitions/efi.c b/fs/partitions/efi.c
3400 +index 038a602..49cfd5f 100644
3401 +--- a/fs/partitions/efi.c
3402 ++++ b/fs/partitions/efi.c
3403 +@@ -1,7 +1,9 @@
3404 + /************************************************************
3405 + * EFI GUID Partition Table handling
3406 +- * Per Intel EFI Specification v1.02
3407 +- * http://developer.intel.com/technology/efi/efi.htm
3408 ++ *
3409 ++ * http://www.uefi.org/specs/
3410 ++ * http://www.intel.com/technology/efi/
3411 ++ *
3412 + * efi.[ch] by Matt Domsch <Matt_Domsch@××××.com>
3413 + * Copyright 2000,2001,2002,2004 Dell Inc.
3414 + *
3415 +@@ -92,6 +94,7 @@
3416 + *
3417 + ************************************************************/
3418 + #include <linux/crc32.h>
3419 ++#include <linux/math64.h>
3420 + #include "check.h"
3421 + #include "efi.h"
3422 +
3423 +@@ -141,7 +144,8 @@ last_lba(struct block_device *bdev)
3424 + {
3425 + if (!bdev || !bdev->bd_inode)
3426 + return 0;
3427 +- return (bdev->bd_inode->i_size >> 9) - 1ULL;
3428 ++ return div_u64(bdev->bd_inode->i_size,
3429 ++ bdev_logical_block_size(bdev)) - 1ULL;
3430 + }
3431 +
3432 + static inline int
3433 +@@ -188,6 +192,7 @@ static size_t
3434 + read_lba(struct block_device *bdev, u64 lba, u8 * buffer, size_t count)
3435 + {
3436 + size_t totalreadcount = 0;
3437 ++ sector_t n = lba * (bdev_logical_block_size(bdev) / 512);
3438 +
3439 + if (!bdev || !buffer || lba > last_lba(bdev))
3440 + return 0;
3441 +@@ -195,7 +200,7 @@ read_lba(struct block_device *bdev, u64 lba, u8 * buffer, size_t count)
3442 + while (count) {
3443 + int copied = 512;
3444 + Sector sect;
3445 +- unsigned char *data = read_dev_sector(bdev, lba++, &sect);
3446 ++ unsigned char *data = read_dev_sector(bdev, n++, &sect);
3447 + if (!data)
3448 + break;
3449 + if (copied > count)
3450 +@@ -257,15 +262,16 @@ static gpt_header *
3451 + alloc_read_gpt_header(struct block_device *bdev, u64 lba)
3452 + {
3453 + gpt_header *gpt;
3454 ++ unsigned ssz = bdev_logical_block_size(bdev);
3455 ++
3456 + if (!bdev)
3457 + return NULL;
3458 +
3459 +- gpt = kzalloc(sizeof (gpt_header), GFP_KERNEL);
3460 ++ gpt = kzalloc(ssz, GFP_KERNEL);
3461 + if (!gpt)
3462 + return NULL;
3463 +
3464 +- if (read_lba(bdev, lba, (u8 *) gpt,
3465 +- sizeof (gpt_header)) < sizeof (gpt_header)) {
3466 ++ if (read_lba(bdev, lba, (u8 *) gpt, ssz) < ssz) {
3467 + kfree(gpt);
3468 + gpt=NULL;
3469 + return NULL;
3470 +@@ -601,6 +607,7 @@ efi_partition(struct parsed_partitions *state, struct block_device *bdev)
3471 + gpt_header *gpt = NULL;
3472 + gpt_entry *ptes = NULL;
3473 + u32 i;
3474 ++ unsigned ssz = bdev_logical_block_size(bdev) / 512;
3475 +
3476 + if (!find_valid_gpt(bdev, &gpt, &ptes) || !gpt || !ptes) {
3477 + kfree(gpt);
3478 +@@ -611,13 +618,14 @@ efi_partition(struct parsed_partitions *state, struct block_device *bdev)
3479 + pr_debug("GUID Partition Table is valid! Yea!\n");
3480 +
3481 + for (i = 0; i < le32_to_cpu(gpt->num_partition_entries) && i < state->limit-1; i++) {
3482 ++ u64 start = le64_to_cpu(ptes[i].starting_lba);
3483 ++ u64 size = le64_to_cpu(ptes[i].ending_lba) -
3484 ++ le64_to_cpu(ptes[i].starting_lba) + 1ULL;
3485 ++
3486 + if (!is_pte_valid(&ptes[i], last_lba(bdev)))
3487 + continue;
3488 +
3489 +- put_partition(state, i+1, le64_to_cpu(ptes[i].starting_lba),
3490 +- (le64_to_cpu(ptes[i].ending_lba) -
3491 +- le64_to_cpu(ptes[i].starting_lba) +
3492 +- 1ULL));
3493 ++ put_partition(state, i+1, start * ssz, size * ssz);
3494 +
3495 + /* If this is a RAID volume, tell md */
3496 + if (!efi_guidcmp(ptes[i].partition_type_guid,
3497 +diff --git a/fs/partitions/efi.h b/fs/partitions/efi.h
3498 +index 2cc89d0..6998b58 100644
3499 +--- a/fs/partitions/efi.h
3500 ++++ b/fs/partitions/efi.h
3501 +@@ -37,7 +37,6 @@
3502 + #define EFI_PMBR_OSTYPE_EFI 0xEF
3503 + #define EFI_PMBR_OSTYPE_EFI_GPT 0xEE
3504 +
3505 +-#define GPT_BLOCK_SIZE 512
3506 + #define GPT_HEADER_SIGNATURE 0x5452415020494645ULL
3507 + #define GPT_HEADER_REVISION_V1 0x00010000
3508 + #define GPT_PRIMARY_PARTITION_TABLE_LBA 1
3509 +@@ -79,7 +78,12 @@ typedef struct _gpt_header {
3510 + __le32 num_partition_entries;
3511 + __le32 sizeof_partition_entry;
3512 + __le32 partition_entry_array_crc32;
3513 +- u8 reserved2[GPT_BLOCK_SIZE - 92];
3514 ++
3515 ++ /* The rest of the logical block is reserved by UEFI and must be zero.
3516 ++ * EFI standard handles this by:
3517 ++ *
3518 ++ * uint8_t reserved2[ BlockSize - 92 ];
3519 ++ */
3520 + } __attribute__ ((packed)) gpt_header;
3521 +
3522 + typedef struct _gpt_entry_attributes {
3523 +diff --git a/fs/super.c b/fs/super.c
3524 +index 19eb70b..aff046b 100644
3525 +--- a/fs/super.c
3526 ++++ b/fs/super.c
3527 +@@ -901,8 +901,9 @@ int get_sb_single(struct file_system_type *fs_type,
3528 + return error;
3529 + }
3530 + s->s_flags |= MS_ACTIVE;
3531 ++ } else {
3532 ++ do_remount_sb(s, flags, data, 0);
3533 + }
3534 +- do_remount_sb(s, flags, data, 0);
3535 + simple_set_mnt(mnt, s);
3536 + return 0;
3537 + }
3538 +diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
3539 +index 9d7febd..0946997 100644
3540 +--- a/include/acpi/platform/aclinux.h
3541 ++++ b/include/acpi/platform/aclinux.h
3542 +@@ -152,7 +152,7 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
3543 + #include <linux/hardirq.h>
3544 + #define ACPI_PREEMPTION_POINT() \
3545 + do { \
3546 +- if (!in_atomic_preempt_off()) \
3547 ++ if (!in_atomic_preempt_off() && !irqs_disabled()) \
3548 + cond_resched(); \
3549 + } while (0)
3550 +
3551 +diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
3552 +index 83d2fbd..64b1a4c 100644
3553 +--- a/include/linux/clocksource.h
3554 ++++ b/include/linux/clocksource.h
3555 +@@ -151,6 +151,7 @@ extern u64 timecounter_cyc2time(struct timecounter *tc,
3556 + * subtraction of non 64 bit counters
3557 + * @mult: cycle to nanosecond multiplier
3558 + * @shift: cycle to nanosecond divisor (power of two)
3559 ++ * @max_idle_ns: max idle time permitted by the clocksource (nsecs)
3560 + * @flags: flags describing special properties
3561 + * @vread: vsyscall based read
3562 + * @resume: resume function for the clocksource, if necessary
3563 +@@ -168,6 +169,7 @@ struct clocksource {
3564 + cycle_t mask;
3565 + u32 mult;
3566 + u32 shift;
3567 ++ u64 max_idle_ns;
3568 + unsigned long flags;
3569 + cycle_t (*vread)(void);
3570 + void (*resume)(void);
3571 +diff --git a/include/linux/hid.h b/include/linux/hid.h
3572 +index 10f6284..8709365 100644
3573 +--- a/include/linux/hid.h
3574 ++++ b/include/linux/hid.h
3575 +@@ -312,6 +312,7 @@ struct hid_item {
3576 + #define HID_QUIRK_MULTI_INPUT 0x00000040
3577 + #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000
3578 + #define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000
3579 ++#define HID_QUIRK_NO_INIT_REPORTS 0x20000000
3580 +
3581 + /*
3582 + * This is the global environment of the parser. This information is
3583 +diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
3584 +index 84cf1f3..1b7f2a7 100644
3585 +--- a/include/linux/pci_ids.h
3586 ++++ b/include/linux/pci_ids.h
3587 +@@ -2290,6 +2290,20 @@
3588 + #define PCI_DEVICE_ID_MPC8536 0x0051
3589 + #define PCI_DEVICE_ID_P2020E 0x0070
3590 + #define PCI_DEVICE_ID_P2020 0x0071
3591 ++#define PCI_DEVICE_ID_P2010E 0x0078
3592 ++#define PCI_DEVICE_ID_P2010 0x0079
3593 ++#define PCI_DEVICE_ID_P1020E 0x0100
3594 ++#define PCI_DEVICE_ID_P1020 0x0101
3595 ++#define PCI_DEVICE_ID_P1011E 0x0108
3596 ++#define PCI_DEVICE_ID_P1011 0x0109
3597 ++#define PCI_DEVICE_ID_P1022E 0x0110
3598 ++#define PCI_DEVICE_ID_P1022 0x0111
3599 ++#define PCI_DEVICE_ID_P1013E 0x0118
3600 ++#define PCI_DEVICE_ID_P1013 0x0119
3601 ++#define PCI_DEVICE_ID_P4080E 0x0400
3602 ++#define PCI_DEVICE_ID_P4080 0x0401
3603 ++#define PCI_DEVICE_ID_P4040E 0x0408
3604 ++#define PCI_DEVICE_ID_P4040 0x0409
3605 + #define PCI_DEVICE_ID_MPC8641 0x7010
3606 + #define PCI_DEVICE_ID_MPC8641D 0x7011
3607 + #define PCI_DEVICE_ID_MPC8610 0x7018
3608 +diff --git a/include/linux/time.h b/include/linux/time.h
3609 +index fe04e5e..6e026e4 100644
3610 +--- a/include/linux/time.h
3611 ++++ b/include/linux/time.h
3612 +@@ -148,6 +148,7 @@ extern void monotonic_to_bootbased(struct timespec *ts);
3613 +
3614 + extern struct timespec timespec_trunc(struct timespec t, unsigned gran);
3615 + extern int timekeeping_valid_for_hres(void);
3616 ++extern u64 timekeeping_max_deferment(void);
3617 + extern void update_wall_time(void);
3618 + extern void update_xtime_cache(u64 nsec);
3619 + extern void timekeeping_leap_insert(int leapsecond);
3620 +diff --git a/include/scsi/fc_frame.h b/include/scsi/fc_frame.h
3621 +index c35d238..148126d 100644
3622 +--- a/include/scsi/fc_frame.h
3623 ++++ b/include/scsi/fc_frame.h
3624 +@@ -37,6 +37,9 @@
3625 + #define FC_FRAME_HEADROOM 32 /* headroom for VLAN + FCoE headers */
3626 + #define FC_FRAME_TAILROOM 8 /* trailer space for FCoE */
3627 +
3628 ++/* Max number of skb frags allowed, reserving one for fcoe_crc_eof page */
3629 ++#define FC_FRAME_SG_LEN (MAX_SKB_FRAGS - 1)
3630 ++
3631 + #define fp_skb(fp) (&((fp)->skb))
3632 + #define fr_hdr(fp) ((fp)->skb.data)
3633 + #define fr_len(fp) ((fp)->skb.len)
3634 +diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
3635 +index 65dc9aa..09a124b 100644
3636 +--- a/include/scsi/libfc.h
3637 ++++ b/include/scsi/libfc.h
3638 +@@ -145,6 +145,7 @@ enum fc_rport_state {
3639 + RPORT_ST_LOGO, /* port logout sent */
3640 + RPORT_ST_ADISC, /* Discover Address sent */
3641 + RPORT_ST_DELETE, /* port being deleted */
3642 ++ RPORT_ST_RESTART, /* remote port being deleted and will restart */
3643 + };
3644 +
3645 + /**
3646 +diff --git a/init/calibrate.c b/init/calibrate.c
3647 +index a379c90..6eb48e5 100644
3648 +--- a/init/calibrate.c
3649 ++++ b/init/calibrate.c
3650 +@@ -123,23 +123,26 @@ void __cpuinit calibrate_delay(void)
3651 + {
3652 + unsigned long ticks, loopbit;
3653 + int lps_precision = LPS_PREC;
3654 ++ static bool printed;
3655 +
3656 + if (preset_lpj) {
3657 + loops_per_jiffy = preset_lpj;
3658 +- printk(KERN_INFO
3659 +- "Calibrating delay loop (skipped) preset value.. ");
3660 +- } else if ((smp_processor_id() == 0) && lpj_fine) {
3661 ++ if (!printed)
3662 ++ pr_info("Calibrating delay loop (skipped) "
3663 ++ "preset value.. ");
3664 ++ } else if ((!printed) && lpj_fine) {
3665 + loops_per_jiffy = lpj_fine;
3666 +- printk(KERN_INFO
3667 +- "Calibrating delay loop (skipped), "
3668 ++ pr_info("Calibrating delay loop (skipped), "
3669 + "value calculated using timer frequency.. ");
3670 + } else if ((loops_per_jiffy = calibrate_delay_direct()) != 0) {
3671 +- printk(KERN_INFO
3672 +- "Calibrating delay using timer specific routine.. ");
3673 ++ if (!printed)
3674 ++ pr_info("Calibrating delay using timer "
3675 ++ "specific routine.. ");
3676 + } else {
3677 + loops_per_jiffy = (1<<12);
3678 +
3679 +- printk(KERN_INFO "Calibrating delay loop... ");
3680 ++ if (!printed)
3681 ++ pr_info("Calibrating delay loop... ");
3682 + while ((loops_per_jiffy <<= 1) != 0) {
3683 + /* wait for "start of" clock tick */
3684 + ticks = jiffies;
3685 +@@ -170,7 +173,10 @@ void __cpuinit calibrate_delay(void)
3686 + loops_per_jiffy &= ~loopbit;
3687 + }
3688 + }
3689 +- printk(KERN_CONT "%lu.%02lu BogoMIPS (lpj=%lu)\n",
3690 ++ if (!printed)
3691 ++ pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n",
3692 + loops_per_jiffy/(500000/HZ),
3693 + (loops_per_jiffy/(5000/HZ)) % 100, loops_per_jiffy);
3694 ++
3695 ++ printed = true;
3696 + }
3697 +diff --git a/ipc/msg.c b/ipc/msg.c
3698 +index 2ceab7f..779f762 100644
3699 +--- a/ipc/msg.c
3700 ++++ b/ipc/msg.c
3701 +@@ -125,6 +125,7 @@ void msg_init_ns(struct ipc_namespace *ns)
3702 + void msg_exit_ns(struct ipc_namespace *ns)
3703 + {
3704 + free_ipcs(ns, &msg_ids(ns), freeque);
3705 ++ idr_destroy(&ns->ids[IPC_MSG_IDS].ipcs_idr);
3706 + }
3707 + #endif
3708 +
3709 +diff --git a/ipc/sem.c b/ipc/sem.c
3710 +index 87c2b64..2f2a479 100644
3711 +--- a/ipc/sem.c
3712 ++++ b/ipc/sem.c
3713 +@@ -129,6 +129,7 @@ void sem_init_ns(struct ipc_namespace *ns)
3714 + void sem_exit_ns(struct ipc_namespace *ns)
3715 + {
3716 + free_ipcs(ns, &sem_ids(ns), freeary);
3717 ++ idr_destroy(&ns->ids[IPC_SEM_IDS].ipcs_idr);
3718 + }
3719 + #endif
3720 +
3721 +diff --git a/ipc/shm.c b/ipc/shm.c
3722 +index 11bec62..e9b039f 100644
3723 +--- a/ipc/shm.c
3724 ++++ b/ipc/shm.c
3725 +@@ -101,6 +101,7 @@ static void do_shm_rmid(struct ipc_namespace *ns, struct kern_ipc_perm *ipcp)
3726 + void shm_exit_ns(struct ipc_namespace *ns)
3727 + {
3728 + free_ipcs(ns, &shm_ids(ns), do_shm_rmid);
3729 ++ idr_destroy(&ns->ids[IPC_SHM_IDS].ipcs_idr);
3730 + }
3731 + #endif
3732 +
3733 +diff --git a/kernel/cpu.c b/kernel/cpu.c
3734 +index b216886..291ac58 100644
3735 +--- a/kernel/cpu.c
3736 ++++ b/kernel/cpu.c
3737 +@@ -400,10 +400,9 @@ int disable_nonboot_cpus(void)
3738 + if (cpu == first_cpu)
3739 + continue;
3740 + error = _cpu_down(cpu, 1);
3741 +- if (!error) {
3742 ++ if (!error)
3743 + cpumask_set_cpu(cpu, frozen_cpus);
3744 +- printk("CPU%d is down\n", cpu);
3745 +- } else {
3746 ++ else {
3747 + printk(KERN_ERR "Error taking CPU%d down: %d\n",
3748 + cpu, error);
3749 + break;
3750 +diff --git a/kernel/sched.c b/kernel/sched.c
3751 +index bf841d8..60d74cc 100644
3752 +--- a/kernel/sched.c
3753 ++++ b/kernel/sched.c
3754 +@@ -816,6 +816,7 @@ const_debug unsigned int sysctl_sched_nr_migrate = 32;
3755 + * default: 0.25ms
3756 + */
3757 + unsigned int sysctl_sched_shares_ratelimit = 250000;
3758 ++unsigned int normalized_sysctl_sched_shares_ratelimit = 250000;
3759 +
3760 + /*
3761 + * Inject some fuzzyness into changing the per-cpu group shares
3762 +@@ -1812,6 +1813,7 @@ static void cfs_rq_set_shares(struct cfs_rq *cfs_rq, unsigned long shares)
3763 + #endif
3764 +
3765 + static void calc_load_account_active(struct rq *this_rq);
3766 ++static void update_sysctl(void);
3767 +
3768 + #include "sched_stats.h"
3769 + #include "sched_idletask.c"
3770 +@@ -7018,22 +7020,23 @@ cpumask_var_t nohz_cpu_mask;
3771 + *
3772 + * This idea comes from the SD scheduler of Con Kolivas:
3773 + */
3774 +-static inline void sched_init_granularity(void)
3775 ++static void update_sysctl(void)
3776 + {
3777 +- unsigned int factor = 1 + ilog2(num_online_cpus());
3778 +- const unsigned long limit = 200000000;
3779 +-
3780 +- sysctl_sched_min_granularity *= factor;
3781 +- if (sysctl_sched_min_granularity > limit)
3782 +- sysctl_sched_min_granularity = limit;
3783 +-
3784 +- sysctl_sched_latency *= factor;
3785 +- if (sysctl_sched_latency > limit)
3786 +- sysctl_sched_latency = limit;
3787 ++ unsigned int cpus = min(num_online_cpus(), 8U);
3788 ++ unsigned int factor = 1 + ilog2(cpus);
3789 +
3790 +- sysctl_sched_wakeup_granularity *= factor;
3791 ++#define SET_SYSCTL(name) \
3792 ++ (sysctl_##name = (factor) * normalized_sysctl_##name)
3793 ++ SET_SYSCTL(sched_min_granularity);
3794 ++ SET_SYSCTL(sched_latency);
3795 ++ SET_SYSCTL(sched_wakeup_granularity);
3796 ++ SET_SYSCTL(sched_shares_ratelimit);
3797 ++#undef SET_SYSCTL
3798 ++}
3799 +
3800 +- sysctl_sched_shares_ratelimit *= factor;
3801 ++static inline void sched_init_granularity(void)
3802 ++{
3803 ++ update_sysctl();
3804 + }
3805 +
3806 + #ifdef CONFIG_SMP
3807 +@@ -8061,6 +8064,7 @@ static cpumask_var_t cpu_isolated_map;
3808 + /* Setup the mask of cpus configured for isolated domains */
3809 + static int __init isolated_cpu_setup(char *str)
3810 + {
3811 ++ alloc_bootmem_cpumask_var(&cpu_isolated_map);
3812 + cpulist_parse(str, cpu_isolated_map);
3813 + return 1;
3814 + }
3815 +@@ -9591,7 +9595,9 @@ void __init sched_init(void)
3816 + zalloc_cpumask_var(&nohz.cpu_mask, GFP_NOWAIT);
3817 + alloc_cpumask_var(&nohz.ilb_grp_nohz_mask, GFP_NOWAIT);
3818 + #endif
3819 +- zalloc_cpumask_var(&cpu_isolated_map, GFP_NOWAIT);
3820 ++ /* May be allocated at isolcpus cmdline parse time */
3821 ++ if (cpu_isolated_map == NULL)
3822 ++ zalloc_cpumask_var(&cpu_isolated_map, GFP_NOWAIT);
3823 + #endif /* SMP */
3824 +
3825 + perf_event_init();
3826 +diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
3827 +index 199228b..d80812d 100644
3828 +--- a/kernel/sched_fair.c
3829 ++++ b/kernel/sched_fair.c
3830 +@@ -35,12 +35,14 @@
3831 + * run vmstat and monitor the context-switches (cs) field)
3832 + */
3833 + unsigned int sysctl_sched_latency = 5000000ULL;
3834 ++unsigned int normalized_sysctl_sched_latency = 5000000ULL;
3835 +
3836 + /*
3837 + * Minimal preemption granularity for CPU-bound tasks:
3838 + * (default: 1 msec * (1 + ilog(ncpus)), units: nanoseconds)
3839 + */
3840 + unsigned int sysctl_sched_min_granularity = 1000000ULL;
3841 ++unsigned int normalized_sysctl_sched_min_granularity = 1000000ULL;
3842 +
3843 + /*
3844 + * is kept at sysctl_sched_latency / sysctl_sched_min_granularity
3845 +@@ -70,6 +72,7 @@ unsigned int __read_mostly sysctl_sched_compat_yield;
3846 + * have immediate wakeup/sleep latencies.
3847 + */
3848 + unsigned int sysctl_sched_wakeup_granularity = 1000000UL;
3849 ++unsigned int normalized_sysctl_sched_wakeup_granularity = 1000000UL;
3850 +
3851 + const_debug unsigned int sysctl_sched_migration_cost = 500000UL;
3852 +
3853 +@@ -1880,6 +1883,17 @@ move_one_task_fair(struct rq *this_rq, int this_cpu, struct rq *busiest,
3854 +
3855 + return 0;
3856 + }
3857 ++
3858 ++static void rq_online_fair(struct rq *rq)
3859 ++{
3860 ++ update_sysctl();
3861 ++}
3862 ++
3863 ++static void rq_offline_fair(struct rq *rq)
3864 ++{
3865 ++ update_sysctl();
3866 ++}
3867 ++
3868 + #endif /* CONFIG_SMP */
3869 +
3870 + /*
3871 +@@ -2027,6 +2041,8 @@ static const struct sched_class fair_sched_class = {
3872 +
3873 + .load_balance = load_balance_fair,
3874 + .move_one_task = move_one_task_fair,
3875 ++ .rq_online = rq_online_fair,
3876 ++ .rq_offline = rq_offline_fair,
3877 + #endif
3878 +
3879 + .set_curr_task = set_curr_task_fair,
3880 +diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
3881 +index 9484be4..0d809ae 100644
3882 +--- a/kernel/time/clockevents.c
3883 ++++ b/kernel/time/clockevents.c
3884 +@@ -20,6 +20,8 @@
3885 + #include <linux/sysdev.h>
3886 + #include <linux/tick.h>
3887 +
3888 ++#include "tick-internal.h"
3889 ++
3890 + /* The registered clock event devices */
3891 + static LIST_HEAD(clockevent_devices);
3892 + static LIST_HEAD(clockevents_released);
3893 +@@ -258,7 +260,8 @@ void clockevents_notify(unsigned long reason, void *arg)
3894 + cpu = *((int *)arg);
3895 + list_for_each_entry_safe(dev, tmp, &clockevent_devices, list) {
3896 + if (cpumask_test_cpu(cpu, dev->cpumask) &&
3897 +- cpumask_weight(dev->cpumask) == 1) {
3898 ++ cpumask_weight(dev->cpumask) == 1 &&
3899 ++ !tick_is_broadcast_device(dev)) {
3900 + BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED);
3901 + list_del(&dev->list);
3902 + }
3903 +diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
3904 +index 5e18c6a..5155dc3 100644
3905 +--- a/kernel/time/clocksource.c
3906 ++++ b/kernel/time/clocksource.c
3907 +@@ -416,6 +416,47 @@ void clocksource_touch_watchdog(void)
3908 + #ifdef CONFIG_GENERIC_TIME
3909 +
3910 + /**
3911 ++ * clocksource_max_deferment - Returns max time the clocksource can be deferred
3912 ++ * @cs: Pointer to clocksource
3913 ++ *
3914 ++ */
3915 ++static u64 clocksource_max_deferment(struct clocksource *cs)
3916 ++{
3917 ++ u64 max_nsecs, max_cycles;
3918 ++
3919 ++ /*
3920 ++ * Calculate the maximum number of cycles that we can pass to the
3921 ++ * cyc2ns function without overflowing a 64-bit signed result. The
3922 ++ * maximum number of cycles is equal to ULLONG_MAX/cs->mult which
3923 ++ * is equivalent to the below.
3924 ++ * max_cycles < (2^63)/cs->mult
3925 ++ * max_cycles < 2^(log2((2^63)/cs->mult))
3926 ++ * max_cycles < 2^(log2(2^63) - log2(cs->mult))
3927 ++ * max_cycles < 2^(63 - log2(cs->mult))
3928 ++ * max_cycles < 1 << (63 - log2(cs->mult))
3929 ++ * Please note that we add 1 to the result of the log2 to account for
3930 ++ * any rounding errors, ensure the above inequality is satisfied and
3931 ++ * no overflow will occur.
3932 ++ */
3933 ++ max_cycles = 1ULL << (63 - (ilog2(cs->mult) + 1));
3934 ++
3935 ++ /*
3936 ++ * The actual maximum number of cycles we can defer the clocksource is
3937 ++ * determined by the minimum of max_cycles and cs->mask.
3938 ++ */
3939 ++ max_cycles = min_t(u64, max_cycles, (u64) cs->mask);
3940 ++ max_nsecs = clocksource_cyc2ns(max_cycles, cs->mult, cs->shift);
3941 ++
3942 ++ /*
3943 ++ * To ensure that the clocksource does not wrap whilst we are idle,
3944 ++ * limit the time the clocksource can be deferred by 12.5%. Please
3945 ++ * note a margin of 12.5% is used because this can be computed with
3946 ++ * a shift, versus say 10% which would require division.
3947 ++ */
3948 ++ return max_nsecs - (max_nsecs >> 5);
3949 ++}
3950 ++
3951 ++/**
3952 + * clocksource_select - Select the best clocksource available
3953 + *
3954 + * Private function. Must hold clocksource_mutex when called.
3955 +@@ -511,6 +552,9 @@ static void clocksource_enqueue(struct clocksource *cs)
3956 + */
3957 + int clocksource_register(struct clocksource *cs)
3958 + {
3959 ++ /* calculate max idle time permitted for this clocksource */
3960 ++ cs->max_idle_ns = clocksource_max_deferment(cs);
3961 ++
3962 + mutex_lock(&clocksource_mutex);
3963 + clocksource_enqueue(cs);
3964 + clocksource_select();
3965 +diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
3966 +index 89aed59..44320b1 100644
3967 +--- a/kernel/time/tick-sched.c
3968 ++++ b/kernel/time/tick-sched.c
3969 +@@ -216,6 +216,7 @@ void tick_nohz_stop_sched_tick(int inidle)
3970 + struct tick_sched *ts;
3971 + ktime_t last_update, expires, now;
3972 + struct clock_event_device *dev = __get_cpu_var(tick_cpu_device).evtdev;
3973 ++ u64 time_delta;
3974 + int cpu;
3975 +
3976 + local_irq_save(flags);
3977 +@@ -275,6 +276,17 @@ void tick_nohz_stop_sched_tick(int inidle)
3978 + seq = read_seqbegin(&xtime_lock);
3979 + last_update = last_jiffies_update;
3980 + last_jiffies = jiffies;
3981 ++
3982 ++ /*
3983 ++ * On SMP we really should only care for the CPU which
3984 ++ * has the do_timer duty assigned. All other CPUs can
3985 ++ * sleep as long as they want.
3986 ++ */
3987 ++ if (cpu == tick_do_timer_cpu ||
3988 ++ tick_do_timer_cpu == TICK_DO_TIMER_NONE)
3989 ++ time_delta = timekeeping_max_deferment();
3990 ++ else
3991 ++ time_delta = KTIME_MAX;
3992 + } while (read_seqretry(&xtime_lock, seq));
3993 +
3994 + /* Get the next timer wheel timer */
3995 +@@ -294,11 +306,26 @@ void tick_nohz_stop_sched_tick(int inidle)
3996 + if ((long)delta_jiffies >= 1) {
3997 +
3998 + /*
3999 +- * calculate the expiry time for the next timer wheel
4000 +- * timer
4001 +- */
4002 +- expires = ktime_add_ns(last_update, tick_period.tv64 *
4003 +- delta_jiffies);
4004 ++ * calculate the expiry time for the next timer wheel
4005 ++ * timer. delta_jiffies >= NEXT_TIMER_MAX_DELTA signals
4006 ++ * that there is no timer pending or at least extremely
4007 ++ * far into the future (12 days for HZ=1000). In this
4008 ++ * case we set the expiry to the end of time.
4009 ++ */
4010 ++ if (likely(delta_jiffies < NEXT_TIMER_MAX_DELTA)) {
4011 ++ /*
4012 ++ * Calculate the time delta for the next timer event.
4013 ++ * If the time delta exceeds the maximum time delta
4014 ++ * permitted by the current clocksource then adjust
4015 ++ * the time delta accordingly to ensure the
4016 ++ * clocksource does not wrap.
4017 ++ */
4018 ++ time_delta = min_t(u64, time_delta,
4019 ++ tick_period.tv64 * delta_jiffies);
4020 ++ expires = ktime_add_ns(last_update, time_delta);
4021 ++ } else {
4022 ++ expires.tv64 = KTIME_MAX;
4023 ++ }
4024 +
4025 + /*
4026 + * If this cpu is the one which updates jiffies, then
4027 +@@ -342,22 +369,19 @@ void tick_nohz_stop_sched_tick(int inidle)
4028 +
4029 + ts->idle_sleeps++;
4030 +
4031 ++ /* Mark expires */
4032 ++ ts->idle_expires = expires;
4033 ++
4034 + /*
4035 +- * delta_jiffies >= NEXT_TIMER_MAX_DELTA signals that
4036 +- * there is no timer pending or at least extremly far
4037 +- * into the future (12 days for HZ=1000). In this case
4038 +- * we simply stop the tick timer:
4039 ++ * If the expiration time == KTIME_MAX, then
4040 ++ * in this case we simply stop the tick timer.
4041 + */
4042 +- if (unlikely(delta_jiffies >= NEXT_TIMER_MAX_DELTA)) {
4043 +- ts->idle_expires.tv64 = KTIME_MAX;
4044 ++ if (unlikely(expires.tv64 == KTIME_MAX)) {
4045 + if (ts->nohz_mode == NOHZ_MODE_HIGHRES)
4046 + hrtimer_cancel(&ts->sched_timer);
4047 + goto out;
4048 + }
4049 +
4050 +- /* Mark expiries */
4051 +- ts->idle_expires = expires;
4052 +-
4053 + if (ts->nohz_mode == NOHZ_MODE_HIGHRES) {
4054 + hrtimer_start(&ts->sched_timer, expires,
4055 + HRTIMER_MODE_ABS_PINNED);
4056 +diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
4057 +index c3a4e29..66d090e 100644
4058 +--- a/kernel/time/timekeeping.c
4059 ++++ b/kernel/time/timekeeping.c
4060 +@@ -488,6 +488,17 @@ int timekeeping_valid_for_hres(void)
4061 + }
4062 +
4063 + /**
4064 ++ * timekeeping_max_deferment - Returns max time the clocksource can be deferred
4065 ++ *
4066 ++ * Caller must observe xtime_lock via read_seqbegin/read_seqretry to
4067 ++ * ensure that the clocksource does not change!
4068 ++ */
4069 ++u64 timekeeping_max_deferment(void)
4070 ++{
4071 ++ return timekeeper.clock->max_idle_ns;
4072 ++}
4073 ++
4074 ++/**
4075 + * read_persistent_clock - Return time from the persistent clock.
4076 + *
4077 + * Weak dummy function for arches that do not yet support it.
4078 +diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
4079 +index cca675e..fe2d3f8 100644
4080 +--- a/net/mac80211/cfg.c
4081 ++++ b/net/mac80211/cfg.c
4082 +@@ -1306,6 +1306,9 @@ static int ieee80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
4083 + struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
4084 + struct ieee80211_conf *conf = &local->hw.conf;
4085 +
4086 ++ if (sdata->vif.type != NL80211_IFTYPE_STATION)
4087 ++ return -EOPNOTSUPP;
4088 ++
4089 + if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_PS))
4090 + return -EOPNOTSUPP;
4091 +
4092 +diff --git a/net/netfilter/xt_conntrack.c b/net/netfilter/xt_conntrack.c
4093 +index 6dc4652..ae66305 100644
4094 +--- a/net/netfilter/xt_conntrack.c
4095 ++++ b/net/netfilter/xt_conntrack.c
4096 +@@ -113,7 +113,8 @@ ct_proto_port_check(const struct xt_conntrack_mtinfo2 *info,
4097 + }
4098 +
4099 + static bool
4100 +-conntrack_mt(const struct sk_buff *skb, const struct xt_match_param *par)
4101 ++conntrack_mt(const struct sk_buff *skb, const struct xt_match_param *par,
4102 ++ u16 state_mask, u16 status_mask)
4103 + {
4104 + const struct xt_conntrack_mtinfo2 *info = par->matchinfo;
4105 + enum ip_conntrack_info ctinfo;
4106 +@@ -136,7 +137,7 @@ conntrack_mt(const struct sk_buff *skb, const struct xt_match_param *par)
4107 + if (test_bit(IPS_DST_NAT_BIT, &ct->status))
4108 + statebit |= XT_CONNTRACK_STATE_DNAT;
4109 + }
4110 +- if (!!(info->state_mask & statebit) ^
4111 ++ if (!!(state_mask & statebit) ^
4112 + !(info->invert_flags & XT_CONNTRACK_STATE))
4113 + return false;
4114 + }
4115 +@@ -172,7 +173,7 @@ conntrack_mt(const struct sk_buff *skb, const struct xt_match_param *par)
4116 + return false;
4117 +
4118 + if ((info->match_flags & XT_CONNTRACK_STATUS) &&
4119 +- (!!(info->status_mask & ct->status) ^
4120 ++ (!!(status_mask & ct->status) ^
4121 + !(info->invert_flags & XT_CONNTRACK_STATUS)))
4122 + return false;
4123 +
4124 +@@ -192,11 +193,17 @@ conntrack_mt(const struct sk_buff *skb, const struct xt_match_param *par)
4125 + static bool
4126 + conntrack_mt_v1(const struct sk_buff *skb, const struct xt_match_param *par)
4127 + {
4128 +- const struct xt_conntrack_mtinfo2 *const *info = par->matchinfo;
4129 +- struct xt_match_param newpar = *par;
4130 ++ const struct xt_conntrack_mtinfo1 *info = par->matchinfo;
4131 +
4132 +- newpar.matchinfo = *info;
4133 +- return conntrack_mt(skb, &newpar);
4134 ++ return conntrack_mt(skb, par, info->state_mask, info->status_mask);
4135 ++}
4136 ++
4137 ++static bool
4138 ++conntrack_mt_v2(const struct sk_buff *skb, const struct xt_match_param *par)
4139 ++{
4140 ++ const struct xt_conntrack_mtinfo2 *info = par->matchinfo;
4141 ++
4142 ++ return conntrack_mt(skb, par, info->state_mask, info->status_mask);
4143 + }
4144 +
4145 + static bool conntrack_mt_check(const struct xt_mtchk_param *par)
4146 +@@ -209,45 +216,11 @@ static bool conntrack_mt_check(const struct xt_mtchk_param *par)
4147 + return true;
4148 + }
4149 +
4150 +-static bool conntrack_mt_check_v1(const struct xt_mtchk_param *par)
4151 +-{
4152 +- struct xt_conntrack_mtinfo1 *info = par->matchinfo;
4153 +- struct xt_conntrack_mtinfo2 *up;
4154 +- int ret = conntrack_mt_check(par);
4155 +-
4156 +- if (ret < 0)
4157 +- return ret;
4158 +-
4159 +- up = kmalloc(sizeof(*up), GFP_KERNEL);
4160 +- if (up == NULL) {
4161 +- nf_ct_l3proto_module_put(par->family);
4162 +- return -ENOMEM;
4163 +- }
4164 +-
4165 +- /*
4166 +- * The strategy here is to minimize the overhead of v1 matching,
4167 +- * by prebuilding a v2 struct and putting the pointer into the
4168 +- * v1 dataspace.
4169 +- */
4170 +- memcpy(up, info, offsetof(typeof(*info), state_mask));
4171 +- up->state_mask = info->state_mask;
4172 +- up->status_mask = info->status_mask;
4173 +- *(void **)info = up;
4174 +- return true;
4175 +-}
4176 +-
4177 + static void conntrack_mt_destroy(const struct xt_mtdtor_param *par)
4178 + {
4179 + nf_ct_l3proto_module_put(par->family);
4180 + }
4181 +
4182 +-static void conntrack_mt_destroy_v1(const struct xt_mtdtor_param *par)
4183 +-{
4184 +- struct xt_conntrack_mtinfo2 **info = par->matchinfo;
4185 +- kfree(*info);
4186 +- conntrack_mt_destroy(par);
4187 +-}
4188 +-
4189 + static struct xt_match conntrack_mt_reg[] __read_mostly = {
4190 + {
4191 + .name = "conntrack",
4192 +@@ -255,8 +228,8 @@ static struct xt_match conntrack_mt_reg[] __read_mostly = {
4193 + .family = NFPROTO_UNSPEC,
4194 + .matchsize = sizeof(struct xt_conntrack_mtinfo1),
4195 + .match = conntrack_mt_v1,
4196 +- .checkentry = conntrack_mt_check_v1,
4197 +- .destroy = conntrack_mt_destroy_v1,
4198 ++ .checkentry = conntrack_mt_check,
4199 ++ .destroy = conntrack_mt_destroy,
4200 + .me = THIS_MODULE,
4201 + },
4202 + {
4203 +@@ -264,7 +237,7 @@ static struct xt_match conntrack_mt_reg[] __read_mostly = {
4204 + .revision = 2,
4205 + .family = NFPROTO_UNSPEC,
4206 + .matchsize = sizeof(struct xt_conntrack_mtinfo2),
4207 +- .match = conntrack_mt,
4208 ++ .match = conntrack_mt_v2,
4209 + .checkentry = conntrack_mt_check,
4210 + .destroy = conntrack_mt_destroy,
4211 + .me = THIS_MODULE,
4212 +diff --git a/net/wireless/sme.c b/net/wireless/sme.c
4213 +index 9f0b280..b2930e3 100644
4214 +--- a/net/wireless/sme.c
4215 ++++ b/net/wireless/sme.c
4216 +@@ -655,6 +655,7 @@ void __cfg80211_disconnected(struct net_device *dev, const u8 *ie,
4217 + memset(&wrqu, 0, sizeof(wrqu));
4218 + wrqu.ap_addr.sa_family = ARPHRD_ETHER;
4219 + wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL);
4220 ++ wdev->wext.connect.ssid_len = 0;
4221 + #endif
4222 + }
4223 +
4224 +diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
4225 +index 7e4ee4e..03784da 100644
4226 +--- a/sound/pci/hda/hda_intel.c
4227 ++++ b/sound/pci/hda/hda_intel.c
4228 +@@ -2694,6 +2694,9 @@ static struct pci_device_id azx_ids[] = {
4229 + { PCI_DEVICE(0x10de, 0x0ac1), .driver_data = AZX_DRIVER_NVIDIA },
4230 + { PCI_DEVICE(0x10de, 0x0ac2), .driver_data = AZX_DRIVER_NVIDIA },
4231 + { PCI_DEVICE(0x10de, 0x0ac3), .driver_data = AZX_DRIVER_NVIDIA },
4232 ++ { PCI_DEVICE(0x10de, 0x0be2), .driver_data = AZX_DRIVER_NVIDIA },
4233 ++ { PCI_DEVICE(0x10de, 0x0be3), .driver_data = AZX_DRIVER_NVIDIA },
4234 ++ { PCI_DEVICE(0x10de, 0x0be4), .driver_data = AZX_DRIVER_NVIDIA },
4235 + { PCI_DEVICE(0x10de, 0x0d94), .driver_data = AZX_DRIVER_NVIDIA },
4236 + { PCI_DEVICE(0x10de, 0x0d95), .driver_data = AZX_DRIVER_NVIDIA },
4237 + { PCI_DEVICE(0x10de, 0x0d96), .driver_data = AZX_DRIVER_NVIDIA },
4238 +diff --git a/sound/pci/hda/patch_intelhdmi.c b/sound/pci/hda/patch_intelhdmi.c
4239 +index 01a18ed..7c23016 100644
4240 +--- a/sound/pci/hda/patch_intelhdmi.c
4241 ++++ b/sound/pci/hda/patch_intelhdmi.c
4242 +@@ -684,7 +684,7 @@ static struct hda_codec_preset snd_hda_preset_intelhdmi[] = {
4243 + { .id = 0x80862801, .name = "G45 DEVBLC", .patch = patch_intel_hdmi },
4244 + { .id = 0x80862802, .name = "G45 DEVCTG", .patch = patch_intel_hdmi },
4245 + { .id = 0x80862803, .name = "G45 DEVELK", .patch = patch_intel_hdmi },
4246 +- { .id = 0x80862804, .name = "G45 DEVIBX", .patch = patch_intel_hdmi },
4247 ++ { .id = 0x80862804, .name = "G45 DEVIBX", .patch = patch_intel_hdmi_ibexpeak },
4248 + { .id = 0x80860054, .name = "Q57 DEVIBX", .patch = patch_intel_hdmi_ibexpeak },
4249 + { .id = 0x10951392, .name = "SiI1392 HDMI", .patch = patch_intel_hdmi },
4250 + {} /* terminator */
4251 +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
4252 +index 075c3a6..c2e9370 100644
4253 +--- a/sound/pci/hda/patch_realtek.c
4254 ++++ b/sound/pci/hda/patch_realtek.c
4255 +@@ -2401,6 +2401,8 @@ static const char *alc_slave_sws[] = {
4256 + "Speaker Playback Switch",
4257 + "Mono Playback Switch",
4258 + "IEC958 Playback Switch",
4259 ++ "Line-Out Playback Switch",
4260 ++ "PCM Playback Switch",
4261 + NULL,
4262 + };
4263 +
4264 +@@ -8839,7 +8841,7 @@ static struct snd_pci_quirk alc882_cfg_tbl[] = {
4265 + SND_PCI_QUIRK(0x1462, 0x040d, "MSI", ALC883_TARGA_2ch_DIG),
4266 + SND_PCI_QUIRK(0x1462, 0x0579, "MSI", ALC883_TARGA_2ch_DIG),
4267 + SND_PCI_QUIRK(0x1462, 0x28fb, "Targa T8", ALC882_TARGA), /* MSI-1049 T8 */
4268 +- SND_PCI_QUIRK(0x1462, 0x2fb3, "MSI", ALC883_TARGA_2ch_DIG),
4269 ++ SND_PCI_QUIRK(0x1462, 0x2fb3, "MSI", ALC882_AUTO),
4270 + SND_PCI_QUIRK(0x1462, 0x6668, "MSI", ALC882_6ST_DIG),
4271 + SND_PCI_QUIRK(0x1462, 0x3729, "MSI S420", ALC883_TARGA_DIG),
4272 + SND_PCI_QUIRK(0x1462, 0x3783, "NEC S970", ALC883_TARGA_DIG),
4273 +@@ -10152,7 +10154,7 @@ static void alc262_hp_t5735_setup(struct hda_codec *codec)
4274 + struct alc_spec *spec = codec->spec;
4275 +
4276 + spec->autocfg.hp_pins[0] = 0x15;
4277 +- spec->autocfg.speaker_pins[0] = 0x0c; /* HACK: not actually a pin */
4278 ++ spec->autocfg.speaker_pins[0] = 0x14;
4279 + }
4280 +
4281 + static struct snd_kcontrol_new alc262_hp_t5735_mixer[] = {
4282 +@@ -11586,9 +11588,9 @@ static struct alc_config_preset alc262_presets[] = {
4283 + .num_channel_mode = ARRAY_SIZE(alc262_modes),
4284 + .channel_mode = alc262_modes,
4285 + .input_mux = &alc262_capture_source,
4286 +- .unsol_event = alc_automute_amp_unsol_event,
4287 ++ .unsol_event = alc_sku_unsol_event,
4288 + .setup = alc262_hp_t5735_setup,
4289 +- .init_hook = alc_automute_amp,
4290 ++ .init_hook = alc_inithook,
4291 + },
4292 + [ALC262_HP_RP5700] = {
4293 + .mixers = { alc262_hp_rp5700_mixer },
4294 +diff --git a/sound/pci/ice1712/juli.c b/sound/pci/ice1712/juli.c
4295 +index fd948bf..f5020ad 100644
4296 +--- a/sound/pci/ice1712/juli.c
4297 ++++ b/sound/pci/ice1712/juli.c
4298 +@@ -504,6 +504,31 @@ static int __devinit juli_add_controls(struct snd_ice1712 *ice)
4299 + }
4300 +
4301 + /*
4302 ++ * suspend/resume
4303 ++ * */
4304 ++
4305 ++#ifdef CONFIG_PM
4306 ++static int juli_resume(struct snd_ice1712 *ice)
4307 ++{
4308 ++ struct snd_akm4xxx *ak = ice->akm;
4309 ++ struct juli_spec *spec = ice->spec;
4310 ++ /* akm4358 un-reset, un-mute */
4311 ++ snd_akm4xxx_reset(ak, 0);
4312 ++ /* reinit ak4114 */
4313 ++ snd_ak4114_reinit(spec->ak4114);
4314 ++ return 0;
4315 ++}
4316 ++
4317 ++static int juli_suspend(struct snd_ice1712 *ice)
4318 ++{
4319 ++ struct snd_akm4xxx *ak = ice->akm;
4320 ++ /* akm4358 reset and soft-mute */
4321 ++ snd_akm4xxx_reset(ak, 1);
4322 ++ return 0;
4323 ++}
4324 ++#endif
4325 ++
4326 ++/*
4327 + * initialize the chip
4328 + */
4329 +
4330 +@@ -646,6 +671,13 @@ static int __devinit juli_init(struct snd_ice1712 *ice)
4331 + ice->set_spdif_clock = juli_set_spdif_clock;
4332 +
4333 + ice->spdif.ops.open = juli_spdif_in_open;
4334 ++
4335 ++#ifdef CONFIG_PM
4336 ++ ice->pm_resume = juli_resume;
4337 ++ ice->pm_suspend = juli_suspend;
4338 ++ ice->pm_suspend_enabled = 1;
4339 ++#endif
4340 ++
4341 + return 0;
4342 + }
4343 +
4344 +diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
4345 +index fe1307b..eedf33c 100644
4346 +--- a/sound/soc/codecs/wm8903.c
4347 ++++ b/sound/soc/codecs/wm8903.c
4348 +@@ -1506,7 +1506,7 @@ static int wm8903_resume(struct platform_device *pdev)
4349 + struct i2c_client *i2c = codec->control_data;
4350 + int i;
4351 + u16 *reg_cache = codec->reg_cache;
4352 +- u16 *tmp_cache = kmemdup(codec->reg_cache, sizeof(wm8903_reg_defaults),
4353 ++ u16 *tmp_cache = kmemdup(reg_cache, sizeof(wm8903_reg_defaults),
4354 + GFP_KERNEL);
4355 +
4356 + /* Bring the codec back up to standby first to minimise pop/clicks */
4357 +@@ -1518,6 +1518,7 @@ static int wm8903_resume(struct platform_device *pdev)
4358 + for (i = 2; i < ARRAY_SIZE(wm8903_reg_defaults); i++)
4359 + if (tmp_cache[i] != reg_cache[i])
4360 + snd_soc_write(codec, i, tmp_cache[i]);
4361 ++ kfree(tmp_cache);
4362 + } else {
4363 + dev_err(&i2c->dev, "Failed to allocate temporary cache\n");
4364 + }
4365 +diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
4366 +index bb4ebd8..251282c 100644
4367 +--- a/virt/kvm/eventfd.c
4368 ++++ b/virt/kvm/eventfd.c
4369 +@@ -168,7 +168,7 @@ irqfd_ptable_queue_proc(struct file *file, wait_queue_head_t *wqh,
4370 + static int
4371 + kvm_irqfd_assign(struct kvm *kvm, int fd, int gsi)
4372 + {
4373 +- struct _irqfd *irqfd;
4374 ++ struct _irqfd *irqfd, *tmp;
4375 + struct file *file = NULL;
4376 + struct eventfd_ctx *eventfd = NULL;
4377 + int ret;
4378 +@@ -205,9 +205,20 @@ kvm_irqfd_assign(struct kvm *kvm, int fd, int gsi)
4379 + init_waitqueue_func_entry(&irqfd->wait, irqfd_wakeup);
4380 + init_poll_funcptr(&irqfd->pt, irqfd_ptable_queue_proc);
4381 +
4382 ++ spin_lock_irq(&kvm->irqfds.lock);
4383 ++
4384 ++ ret = 0;
4385 ++ list_for_each_entry(tmp, &kvm->irqfds.items, list) {
4386 ++ if (irqfd->eventfd != tmp->eventfd)
4387 ++ continue;
4388 ++ /* This fd is used for another irq already. */
4389 ++ ret = -EBUSY;
4390 ++ spin_unlock_irq(&kvm->irqfds.lock);
4391 ++ goto fail;
4392 ++ }
4393 ++
4394 + events = file->f_op->poll(file, &irqfd->pt);
4395 +
4396 +- spin_lock_irq(&kvm->irqfds.lock);
4397 + list_add_tail(&irqfd->list, &kvm->irqfds.items);
4398 + spin_unlock_irq(&kvm->irqfds.lock);
4399 +
4400 +diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c
4401 +index 03e5b21..5288885 100644
4402 +--- a/virt/kvm/irq_comm.c
4403 ++++ b/virt/kvm/irq_comm.c
4404 +@@ -209,11 +209,13 @@ int kvm_request_irq_source_id(struct kvm *kvm)
4405 +
4406 + if (irq_source_id >= BITS_PER_LONG) {
4407 + printk(KERN_WARNING "kvm: exhaust allocatable IRQ sources!\n");
4408 +- return -EFAULT;
4409 ++ irq_source_id = -EFAULT;
4410 ++ goto unlock;
4411 + }
4412 +
4413 + ASSERT(irq_source_id != KVM_USERSPACE_IRQ_SOURCE_ID);
4414 + set_bit(irq_source_id, bitmap);
4415 ++unlock:
4416 + mutex_unlock(&kvm->irq_lock);
4417 +
4418 + return irq_source_id;
4419 +@@ -229,11 +231,15 @@ void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id)
4420 + if (irq_source_id < 0 ||
4421 + irq_source_id >= BITS_PER_LONG) {
4422 + printk(KERN_ERR "kvm: IRQ source ID out of range!\n");
4423 +- return;
4424 ++ goto unlock;
4425 + }
4426 ++ clear_bit(irq_source_id, &kvm->arch.irq_sources_bitmap);
4427 ++ if (!irqchip_in_kernel(kvm))
4428 ++ goto unlock;
4429 ++
4430 + for (i = 0; i < KVM_IOAPIC_NUM_PINS; i++)
4431 + clear_bit(irq_source_id, &kvm->arch.irq_states[i]);
4432 +- clear_bit(irq_source_id, &kvm->arch.irq_sources_bitmap);
4433 ++unlock:
4434 + mutex_unlock(&kvm->irq_lock);
4435 + }
4436 +
4437
4438 Deleted: genpatches-2.6/trunk/2.6.32/1900_EFI-GPT-header-read-fix.patch
4439 ===================================================================
4440 --- genpatches-2.6/trunk/2.6.32/1900_EFI-GPT-header-read-fix.patch 2010-01-26 02:13:25 UTC (rev 1658)
4441 +++ genpatches-2.6/trunk/2.6.32/1900_EFI-GPT-header-read-fix.patch 2010-01-29 00:10:52 UTC (rev 1659)
4442 @@ -1,75 +0,0 @@
4443 -From: Karel Zak <kzak@××××××.com>
4444 -Date: Mon, 23 Nov 2009 08:29:58 +0000 (+0100)
4445 -Subject: partitions: read whole sector with EFI GPT header
4446 -X-Git-Tag: v2.6.33-rc1~379^2~53
4447 -X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=87038c2d5bda2418fda8b1456a0ae81cc3ff5bd8
4448 -
4449 -partitions: read whole sector with EFI GPT header
4450 -
4451 -The size of EFI GPT header is not static, but whole sector is
4452 -allocated for the header. The HeaderSize field must be greater
4453 -than 92 (= sizeof(struct gpt_header) and must be less than or
4454 -equal to the logical block size.
4455 -
4456 -It means we have to read whole sector with the header, because the
4457 -header crc32 checksum is calculated according to HeaderSize.
4458 -
4459 -For more details see UEFI standard (version 2.3, May 2009):
4460 - - 5.3.1 GUID Format overview, page 93
4461 - - Table 13. GUID Partition Table Header, page 96
4462 -
4463 -Signed-off-by: Karel Zak <kzak@××××××.com>
4464 -Signed-off-by: Jens Axboe <jens.axboe@××××××.com>
4465 ----
4466 -
4467 -diff --git a/fs/partitions/efi.c b/fs/partitions/efi.c
4468 -index 80eeff5..49cfd5f 100644
4469 ---- a/fs/partitions/efi.c
4470 -+++ b/fs/partitions/efi.c
4471 -@@ -262,15 +262,16 @@ static gpt_header *
4472 - alloc_read_gpt_header(struct block_device *bdev, u64 lba)
4473 - {
4474 - gpt_header *gpt;
4475 -+ unsigned ssz = bdev_logical_block_size(bdev);
4476 -+
4477 - if (!bdev)
4478 - return NULL;
4479 -
4480 -- gpt = kzalloc(sizeof (gpt_header), GFP_KERNEL);
4481 -+ gpt = kzalloc(ssz, GFP_KERNEL);
4482 - if (!gpt)
4483 - return NULL;
4484 -
4485 -- if (read_lba(bdev, lba, (u8 *) gpt,
4486 -- sizeof (gpt_header)) < sizeof (gpt_header)) {
4487 -+ if (read_lba(bdev, lba, (u8 *) gpt, ssz) < ssz) {
4488 - kfree(gpt);
4489 - gpt=NULL;
4490 - return NULL;
4491 -diff --git a/fs/partitions/efi.h b/fs/partitions/efi.h
4492 -index 2cc89d0..6998b58 100644
4493 ---- a/fs/partitions/efi.h
4494 -+++ b/fs/partitions/efi.h
4495 -@@ -37,7 +37,6 @@
4496 - #define EFI_PMBR_OSTYPE_EFI 0xEF
4497 - #define EFI_PMBR_OSTYPE_EFI_GPT 0xEE
4498 -
4499 --#define GPT_BLOCK_SIZE 512
4500 - #define GPT_HEADER_SIGNATURE 0x5452415020494645ULL
4501 - #define GPT_HEADER_REVISION_V1 0x00010000
4502 - #define GPT_PRIMARY_PARTITION_TABLE_LBA 1
4503 -@@ -79,7 +78,12 @@ typedef struct _gpt_header {
4504 - __le32 num_partition_entries;
4505 - __le32 sizeof_partition_entry;
4506 - __le32 partition_entry_array_crc32;
4507 -- u8 reserved2[GPT_BLOCK_SIZE - 92];
4508 -+
4509 -+ /* The rest of the logical block is reserved by UEFI and must be zero.
4510 -+ * EFI standard handles this by:
4511 -+ *
4512 -+ * uint8_t reserved2[ BlockSize - 92 ];
4513 -+ */
4514 - } __attribute__ ((packed)) gpt_header;
4515 -
4516 - typedef struct _gpt_entry_attributes {
4517 -
4518
4519 Deleted: genpatches-2.6/trunk/2.6.32/1910_sector-size-for-EFI-GPT-fix.patch
4520 ===================================================================
4521 --- genpatches-2.6/trunk/2.6.32/1910_sector-size-for-EFI-GPT-fix.patch 2010-01-26 02:13:25 UTC (rev 1658)
4522 +++ genpatches-2.6/trunk/2.6.32/1910_sector-size-for-EFI-GPT-fix.patch 2010-01-29 00:10:52 UTC (rev 1659)
4523 @@ -1,125 +0,0 @@
4524 -From: Karel Zak <kzak@××××××.com>
4525 -Date: Mon, 23 Nov 2009 08:29:13 +0000 (+0100)
4526 -Subject: partitions: use sector size for EFI GPT
4527 -X-Git-Tag: v2.6.33-rc1~379^2~54
4528 -X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=7d13af3279985f554784a45cc961f706dbcdbdd1
4529 -
4530 -partitions: use sector size for EFI GPT
4531 -
4532 -Currently, kernel uses strictly 512-byte sectors for EFI GPT parsing.
4533 -That's wrong.
4534 -
4535 -UEFI standard (version 2.3, May 2009, 5.3.1 GUID Format overview, page
4536 -95) defines that LBA is always based on the logical block size. It
4537 -means bdev_logical_block_size() (aka BLKSSZGET) for Linux.
4538 -
4539 -This patch removes static sector size from EFI GPT parser.
4540 -
4541 -The problem is reproducible with the latest GNU Parted:
4542 -
4543 - # modprobe scsi_debug dev_size_mb=50 sector_size=4096
4544 -
4545 - # ./parted /dev/sdb print
4546 - Model: Linux scsi_debug (scsi)
4547 - Disk /dev/sdb: 52.4MB
4548 - Sector size (logical/physical): 4096B/4096B
4549 - Partition Table: gpt
4550 -
4551 - Number Start End Size File system Name Flags
4552 - 1 24.6kB 3002kB 2978kB primary
4553 - 2 3002kB 6001kB 2998kB primary
4554 - 3 6001kB 9003kB 3002kB primary
4555 -
4556 - # blockdev --rereadpt /dev/sdb
4557 - # dmesg | tail -1
4558 - sdb: unknown partition table <---- !!!
4559 -
4560 -with this patch:
4561 -
4562 - # blockdev --rereadpt /dev/sdb
4563 - # dmesg | tail -1
4564 - sdb: sdb1 sdb2 sdb3
4565 -
4566 -Signed-off-by: Karel Zak <kzak@××××××.com>
4567 -Signed-off-by: Jens Axboe <jens.axboe@××××××.com>
4568 ----
4569 -
4570 -diff --git a/fs/partitions/efi.c b/fs/partitions/efi.c
4571 -index 038a602..80eeff5 100644
4572 ---- a/fs/partitions/efi.c
4573 -+++ b/fs/partitions/efi.c
4574 -@@ -1,7 +1,9 @@
4575 - /************************************************************
4576 - * EFI GUID Partition Table handling
4577 -- * Per Intel EFI Specification v1.02
4578 -- * http://developer.intel.com/technology/efi/efi.htm
4579 -+ *
4580 -+ * http://www.uefi.org/specs/
4581 -+ * http://www.intel.com/technology/efi/
4582 -+ *
4583 - * efi.[ch] by Matt Domsch <Matt_Domsch@××××.com>
4584 - * Copyright 2000,2001,2002,2004 Dell Inc.
4585 - *
4586 -@@ -92,6 +94,7 @@
4587 - *
4588 - ************************************************************/
4589 - #include <linux/crc32.h>
4590 -+#include <linux/math64.h>
4591 - #include "check.h"
4592 - #include "efi.h"
4593 -
4594 -@@ -141,7 +144,8 @@ last_lba(struct block_device *bdev)
4595 - {
4596 - if (!bdev || !bdev->bd_inode)
4597 - return 0;
4598 -- return (bdev->bd_inode->i_size >> 9) - 1ULL;
4599 -+ return div_u64(bdev->bd_inode->i_size,
4600 -+ bdev_logical_block_size(bdev)) - 1ULL;
4601 - }
4602 -
4603 - static inline int
4604 -@@ -188,6 +192,7 @@ static size_t
4605 - read_lba(struct block_device *bdev, u64 lba, u8 * buffer, size_t count)
4606 - {
4607 - size_t totalreadcount = 0;
4608 -+ sector_t n = lba * (bdev_logical_block_size(bdev) / 512);
4609 -
4610 - if (!bdev || !buffer || lba > last_lba(bdev))
4611 - return 0;
4612 -@@ -195,7 +200,7 @@ read_lba(struct block_device *bdev, u64 lba, u8 * buffer, size_t count)
4613 - while (count) {
4614 - int copied = 512;
4615 - Sector sect;
4616 -- unsigned char *data = read_dev_sector(bdev, lba++, &sect);
4617 -+ unsigned char *data = read_dev_sector(bdev, n++, &sect);
4618 - if (!data)
4619 - break;
4620 - if (copied > count)
4621 -@@ -601,6 +606,7 @@ efi_partition(struct parsed_partitions *state, struct block_device *bdev)
4622 - gpt_header *gpt = NULL;
4623 - gpt_entry *ptes = NULL;
4624 - u32 i;
4625 -+ unsigned ssz = bdev_logical_block_size(bdev) / 512;
4626 -
4627 - if (!find_valid_gpt(bdev, &gpt, &ptes) || !gpt || !ptes) {
4628 - kfree(gpt);
4629 -@@ -611,13 +617,14 @@ efi_partition(struct parsed_partitions *state, struct block_device *bdev)
4630 - pr_debug("GUID Partition Table is valid! Yea!\n");
4631 -
4632 - for (i = 0; i < le32_to_cpu(gpt->num_partition_entries) && i < state->limit-1; i++) {
4633 -+ u64 start = le64_to_cpu(ptes[i].starting_lba);
4634 -+ u64 size = le64_to_cpu(ptes[i].ending_lba) -
4635 -+ le64_to_cpu(ptes[i].starting_lba) + 1ULL;
4636 -+
4637 - if (!is_pte_valid(&ptes[i], last_lba(bdev)))
4638 - continue;
4639 -
4640 -- put_partition(state, i+1, le64_to_cpu(ptes[i].starting_lba),
4641 -- (le64_to_cpu(ptes[i].ending_lba) -
4642 -- le64_to_cpu(ptes[i].starting_lba) +
4643 -- 1ULL));
4644 -+ put_partition(state, i+1, start * ssz, size * ssz);
4645 -
4646 - /* If this is a RAID volume, tell md */
4647 - if (!efi_guidcmp(ptes[i].partition_type_guid,
4648 -