Gentoo Archives: gentoo-commits

From: "Mike Pagano (mpagano)" <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] linux-patches r1492 - genpatches-2.6/trunk/2.6.28
Date: Mon, 02 Feb 2009 20:17:56
Message-Id: E1LU5Es-0004x4-K5@stork.gentoo.org
1 Author: mpagano
2 Date: 2009-02-02 20:17:50 +0000 (Mon, 02 Feb 2009)
3 New Revision: 1492
4
5 Added:
6 genpatches-2.6/trunk/2.6.28/1002_linux-2.6.28.3.patch
7 Removed:
8 genpatches-2.6/trunk/2.6.28/1725_alpha-srm-compile-failure.patch
9 Modified:
10 genpatches-2.6/trunk/2.6.28/0000_README
11 Log:
12 Linux patch 2.6.28.3 and removal of duplicate alpha gcc 4.3 compiling patch
13
14 Modified: genpatches-2.6/trunk/2.6.28/0000_README
15 ===================================================================
16 --- genpatches-2.6/trunk/2.6.28/0000_README 2009-02-02 20:13:48 UTC (rev 1491)
17 +++ genpatches-2.6/trunk/2.6.28/0000_README 2009-02-02 20:17:50 UTC (rev 1492)
18 @@ -47,9 +47,9 @@
19 From: http://www.kernel.org
20 Desc: Linux 2.6.28.2
21
22 -Patch: 1725_alpha-srm-compile-failure.patch
23 -From: http://bugs.gentoo.org/254150
24 -Desc: Fix irq_srm compile failure on some Alpha platforms
25 +Patch: 1002_linux-2.6.28.3.patch
26 +From: http://www.kernel.org
27 +Desc: Linux 2.6.28.3
28
29 Patch: 2305_uninline-pci-ioremap-bar.patch
30 From: http://bugs.gentoo.org/252488
31
32 Added: genpatches-2.6/trunk/2.6.28/1002_linux-2.6.28.3.patch
33 ===================================================================
34 --- genpatches-2.6/trunk/2.6.28/1002_linux-2.6.28.3.patch (rev 0)
35 +++ genpatches-2.6/trunk/2.6.28/1002_linux-2.6.28.3.patch 2009-02-02 20:17:50 UTC (rev 1492)
36 @@ -0,0 +1,1651 @@
37 +diff --git a/arch/alpha/kernel/irq_srm.c b/arch/alpha/kernel/irq_srm.c
38 +index 3221201..a03fbca 100644
39 +--- a/arch/alpha/kernel/irq_srm.c
40 ++++ b/arch/alpha/kernel/irq_srm.c
41 +@@ -63,6 +63,8 @@ init_srm_irqs(long max, unsigned long ignore_mask)
42 + {
43 + long i;
44 +
45 ++ if (NR_IRQS <= 16)
46 ++ return;
47 + for (i = 16; i < max; ++i) {
48 + if (i < 64 && ((ignore_mask >> i) & 1))
49 + continue;
50 +diff --git a/arch/x86/include/asm/pgalloc.h b/arch/x86/include/asm/pgalloc.h
51 +index cb7c151..dd14c54 100644
52 +--- a/arch/x86/include/asm/pgalloc.h
53 ++++ b/arch/x86/include/asm/pgalloc.h
54 +@@ -42,6 +42,7 @@ static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
55 +
56 + static inline void pte_free(struct mm_struct *mm, struct page *pte)
57 + {
58 ++ pgtable_page_dtor(pte);
59 + __free_page(pte);
60 + }
61 +
62 +diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
63 +index e89d248..84ba748 100644
64 +--- a/arch/x86/mm/pageattr.c
65 ++++ b/arch/x86/mm/pageattr.c
66 +@@ -534,6 +534,36 @@ out_unlock:
67 + return 0;
68 + }
69 +
70 ++static int __cpa_process_fault(struct cpa_data *cpa, unsigned long vaddr,
71 ++ int primary)
72 ++{
73 ++ /*
74 ++ * Ignore all non primary paths.
75 ++ */
76 ++ if (!primary)
77 ++ return 0;
78 ++
79 ++ /*
80 ++ * Ignore the NULL PTE for kernel identity mapping, as it is expected
81 ++ * to have holes.
82 ++ * Also set numpages to '1' indicating that we processed cpa req for
83 ++ * one virtual address page and its pfn. TBD: numpages can be set based
84 ++ * on the initial value and the level returned by lookup_address().
85 ++ */
86 ++ if (within(vaddr, PAGE_OFFSET,
87 ++ PAGE_OFFSET + (max_pfn_mapped << PAGE_SHIFT))) {
88 ++ cpa->numpages = 1;
89 ++ cpa->pfn = __pa(vaddr) >> PAGE_SHIFT;
90 ++ return 0;
91 ++ } else {
92 ++ WARN(1, KERN_WARNING "CPA: called for zero pte. "
93 ++ "vaddr = %lx cpa->vaddr = %lx\n", vaddr,
94 ++ *cpa->vaddr);
95 ++
96 ++ return -EFAULT;
97 ++ }
98 ++}
99 ++
100 + static int __change_page_attr(struct cpa_data *cpa, int primary)
101 + {
102 + unsigned long address;
103 +@@ -549,17 +579,11 @@ static int __change_page_attr(struct cpa_data *cpa, int primary)
104 + repeat:
105 + kpte = lookup_address(address, &level);
106 + if (!kpte)
107 +- return 0;
108 ++ return __cpa_process_fault(cpa, address, primary);
109 +
110 + old_pte = *kpte;
111 +- if (!pte_val(old_pte)) {
112 +- if (!primary)
113 +- return 0;
114 +- WARN(1, KERN_WARNING "CPA: called for zero pte. "
115 +- "vaddr = %lx cpa->vaddr = %lx\n", address,
116 +- *cpa->vaddr);
117 +- return -EINVAL;
118 +- }
119 ++ if (!pte_val(old_pte))
120 ++ return __cpa_process_fault(cpa, address, primary);
121 +
122 + if (level == PG_LEVEL_4K) {
123 + pte_t new_pte;
124 +@@ -657,12 +681,7 @@ static int cpa_process_alias(struct cpa_data *cpa)
125 + vaddr = *cpa->vaddr;
126 +
127 + if (!(within(vaddr, PAGE_OFFSET,
128 +- PAGE_OFFSET + (max_low_pfn_mapped << PAGE_SHIFT))
129 +-#ifdef CONFIG_X86_64
130 +- || within(vaddr, PAGE_OFFSET + (1UL<<32),
131 +- PAGE_OFFSET + (max_pfn_mapped << PAGE_SHIFT))
132 +-#endif
133 +- )) {
134 ++ PAGE_OFFSET + (max_pfn_mapped << PAGE_SHIFT)))) {
135 +
136 + alias_cpa = *cpa;
137 + temp_cpa_vaddr = (unsigned long) __va(cpa->pfn << PAGE_SHIFT);
138 +diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
139 +index eb1bf00..bd8bcce 100644
140 +--- a/arch/x86/mm/pat.c
141 ++++ b/arch/x86/mm/pat.c
142 +@@ -333,11 +333,23 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
143 + req_type & _PAGE_CACHE_MASK);
144 + }
145 +
146 +- is_range_ram = pagerange_is_ram(start, end);
147 +- if (is_range_ram == 1)
148 +- return reserve_ram_pages_type(start, end, req_type, new_type);
149 +- else if (is_range_ram < 0)
150 +- return -EINVAL;
151 ++ if (new_type)
152 ++ *new_type = actual_type;
153 ++
154 ++ /*
155 ++ * For legacy reasons, some parts of the physical address range in the
156 ++ * legacy 1MB region is treated as non-RAM (even when listed as RAM in
157 ++ * the e820 tables). So we will track the memory attributes of this
158 ++ * legacy 1MB region using the linear memtype_list always.
159 ++ */
160 ++ if (end >= ISA_END_ADDRESS) {
161 ++ is_range_ram = pagerange_is_ram(start, end);
162 ++ if (is_range_ram == 1)
163 ++ return reserve_ram_pages_type(start, end, req_type,
164 ++ new_type);
165 ++ else if (is_range_ram < 0)
166 ++ return -EINVAL;
167 ++ }
168 +
169 + new = kmalloc(sizeof(struct memtype), GFP_KERNEL);
170 + if (!new)
171 +@@ -347,9 +359,6 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type,
172 + new->end = end;
173 + new->type = actual_type;
174 +
175 +- if (new_type)
176 +- *new_type = actual_type;
177 +-
178 + spin_lock(&memtype_lock);
179 +
180 + if (cached_entry && start >= cached_start)
181 +@@ -437,11 +446,19 @@ int free_memtype(u64 start, u64 end)
182 + if (is_ISA_range(start, end - 1))
183 + return 0;
184 +
185 +- is_range_ram = pagerange_is_ram(start, end);
186 +- if (is_range_ram == 1)
187 +- return free_ram_pages_type(start, end);
188 +- else if (is_range_ram < 0)
189 +- return -EINVAL;
190 ++ /*
191 ++ * For legacy reasons, some parts of the physical address range in the
192 ++ * legacy 1MB region is treated as non-RAM (even when listed as RAM in
193 ++ * the e820 tables). So we will track the memory attributes of this
194 ++ * legacy 1MB region using the linear memtype_list always.
195 ++ */
196 ++ if (end >= ISA_END_ADDRESS) {
197 ++ is_range_ram = pagerange_is_ram(start, end);
198 ++ if (is_range_ram == 1)
199 ++ return free_ram_pages_type(start, end);
200 ++ else if (is_range_ram < 0)
201 ++ return -EINVAL;
202 ++ }
203 +
204 + spin_lock(&memtype_lock);
205 + list_for_each_entry(entry, &memtype_list, nd) {
206 +diff --git a/crypto/async_tx/async_tx.c b/crypto/async_tx/async_tx.c
207 +index dcbf1be..c5d71aa 100644
208 +--- a/crypto/async_tx/async_tx.c
209 ++++ b/crypto/async_tx/async_tx.c
210 +@@ -124,6 +124,8 @@ void async_tx_run_dependencies(struct dma_async_tx_descriptor *tx)
211 + if (!dep)
212 + return;
213 +
214 ++ /* we'll submit tx->next now, so clear the link */
215 ++ tx->next = NULL;
216 + chan = dep->chan;
217 +
218 + /* keep submitting up until a channel switch is detected
219 +diff --git a/crypto/authenc.c b/crypto/authenc.c
220 +index fd9f06c..0861dc2 100644
221 +--- a/crypto/authenc.c
222 ++++ b/crypto/authenc.c
223 +@@ -157,16 +157,19 @@ static int crypto_authenc_genicv(struct aead_request *req, u8 *iv,
224 + dstp = sg_page(dst);
225 + vdst = PageHighMem(dstp) ? NULL : page_address(dstp) + dst->offset;
226 +
227 +- sg_init_table(cipher, 2);
228 +- sg_set_buf(cipher, iv, ivsize);
229 +- authenc_chain(cipher, dst, vdst == iv + ivsize);
230 ++ if (ivsize) {
231 ++ sg_init_table(cipher, 2);
232 ++ sg_set_buf(cipher, iv, ivsize);
233 ++ authenc_chain(cipher, dst, vdst == iv + ivsize);
234 ++ dst = cipher;
235 ++ }
236 +
237 + cryptlen = req->cryptlen + ivsize;
238 +- hash = crypto_authenc_hash(req, flags, cipher, cryptlen);
239 ++ hash = crypto_authenc_hash(req, flags, dst, cryptlen);
240 + if (IS_ERR(hash))
241 + return PTR_ERR(hash);
242 +
243 +- scatterwalk_map_and_copy(hash, cipher, cryptlen,
244 ++ scatterwalk_map_and_copy(hash, dst, cryptlen,
245 + crypto_aead_authsize(authenc), 1);
246 + return 0;
247 + }
248 +@@ -284,11 +287,14 @@ static int crypto_authenc_iverify(struct aead_request *req, u8 *iv,
249 + srcp = sg_page(src);
250 + vsrc = PageHighMem(srcp) ? NULL : page_address(srcp) + src->offset;
251 +
252 +- sg_init_table(cipher, 2);
253 +- sg_set_buf(cipher, iv, ivsize);
254 +- authenc_chain(cipher, src, vsrc == iv + ivsize);
255 ++ if (ivsize) {
256 ++ sg_init_table(cipher, 2);
257 ++ sg_set_buf(cipher, iv, ivsize);
258 ++ authenc_chain(cipher, src, vsrc == iv + ivsize);
259 ++ src = cipher;
260 ++ }
261 +
262 +- return crypto_authenc_verify(req, cipher, cryptlen + ivsize);
263 ++ return crypto_authenc_verify(req, src, cryptlen + ivsize);
264 + }
265 +
266 + static int crypto_authenc_decrypt(struct aead_request *req)
267 +diff --git a/crypto/ccm.c b/crypto/ccm.c
268 +index 7cf7e5a..c36d654 100644
269 +--- a/crypto/ccm.c
270 ++++ b/crypto/ccm.c
271 +@@ -266,6 +266,8 @@ static int crypto_ccm_auth(struct aead_request *req, struct scatterlist *plain,
272 + if (assoclen) {
273 + pctx->ilen = format_adata(idata, assoclen);
274 + get_data_to_compute(cipher, pctx, req->assoc, req->assoclen);
275 ++ } else {
276 ++ pctx->ilen = 0;
277 + }
278 +
279 + /* compute plaintext into mac */
280 +diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
281 +index 681169c..79a6c9a 100644
282 +--- a/drivers/ata/pata_via.c
283 ++++ b/drivers/ata/pata_via.c
284 +@@ -86,6 +86,10 @@ enum {
285 + VIA_SATA_PATA = 0x800, /* SATA/PATA combined configuration */
286 + };
287 +
288 ++enum {
289 ++ VIA_IDFLAG_SINGLE = (1 << 0), /* single channel controller) */
290 ++};
291 ++
292 + /*
293 + * VIA SouthBridge chips.
294 + */
295 +@@ -97,8 +101,12 @@ static const struct via_isa_bridge {
296 + u8 rev_max;
297 + u16 flags;
298 + } via_isa_bridges[] = {
299 ++ { "vx855", PCI_DEVICE_ID_VIA_VX855, 0x00, 0x2f,
300 ++ VIA_UDMA_133 | VIA_BAD_AST | VIA_SATA_PATA },
301 + { "vx800", PCI_DEVICE_ID_VIA_VX800, 0x00, 0x2f, VIA_UDMA_133 |
302 + VIA_BAD_AST | VIA_SATA_PATA },
303 ++ { "vt8261", PCI_DEVICE_ID_VIA_8261, 0x00, 0x2f,
304 ++ VIA_UDMA_133 | VIA_BAD_AST },
305 + { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
306 + { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
307 + { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_SATA_PATA },
308 +@@ -122,6 +130,8 @@ static const struct via_isa_bridge {
309 + { "vt82c586", PCI_DEVICE_ID_VIA_82C586_0, 0x00, 0x0f, VIA_UDMA_NONE | VIA_SET_FIFO },
310 + { "vt82c576", PCI_DEVICE_ID_VIA_82C576, 0x00, 0x2f, VIA_UDMA_NONE | VIA_SET_FIFO | VIA_NO_UNMASK },
311 + { "vt82c576", PCI_DEVICE_ID_VIA_82C576, 0x00, 0x2f, VIA_UDMA_NONE | VIA_SET_FIFO | VIA_NO_UNMASK | VIA_BAD_ID },
312 ++ { "vtxxxx", PCI_DEVICE_ID_VIA_ANON, 0x00, 0x2f,
313 ++ VIA_UDMA_133 | VIA_BAD_AST },
314 + { NULL }
315 + };
316 +
317 +@@ -460,6 +470,7 @@ static int via_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
318 + static int printed_version;
319 + u8 enable;
320 + u32 timing;
321 ++ unsigned long flags = id->driver_data;
322 + int rc;
323 +
324 + if (!printed_version++)
325 +@@ -469,9 +480,13 @@ static int via_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
326 + if (rc)
327 + return rc;
328 +
329 ++ if (flags & VIA_IDFLAG_SINGLE)
330 ++ ppi[1] = &ata_dummy_port_info;
331 ++
332 + /* To find out how the IDE will behave and what features we
333 + actually have to look at the bridge not the IDE controller */
334 +- for (config = via_isa_bridges; config->id; config++)
335 ++ for (config = via_isa_bridges; config->id != PCI_DEVICE_ID_VIA_ANON;
336 ++ config++)
337 + if ((isa = pci_get_device(PCI_VENDOR_ID_VIA +
338 + !!(config->flags & VIA_BAD_ID),
339 + config->id, NULL))) {
340 +@@ -482,10 +497,6 @@ static int via_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
341 + pci_dev_put(isa);
342 + }
343 +
344 +- if (!config->id) {
345 +- printk(KERN_WARNING "via: Unknown VIA SouthBridge, disabling.\n");
346 +- return -ENODEV;
347 +- }
348 + pci_dev_put(isa);
349 +
350 + if (!(config->flags & VIA_NO_ENABLES)) {
351 +@@ -587,6 +598,7 @@ static const struct pci_device_id via[] = {
352 + { PCI_VDEVICE(VIA, 0x1571), },
353 + { PCI_VDEVICE(VIA, 0x3164), },
354 + { PCI_VDEVICE(VIA, 0x5324), },
355 ++ { PCI_VDEVICE(VIA, 0xC409), VIA_IDFLAG_SINGLE },
356 +
357 + { },
358 + };
359 +diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
360 +index 82020ab..a4424c8 100644
361 +--- a/drivers/gpio/gpiolib.c
362 ++++ b/drivers/gpio/gpiolib.c
363 +@@ -789,6 +789,7 @@ int gpio_request(unsigned gpio, const char *label)
364 + } else {
365 + status = -EBUSY;
366 + module_put(chip->owner);
367 ++ goto done;
368 + }
369 +
370 + if (chip->request) {
371 +diff --git a/drivers/gpu/drm/drm_agpsupport.c b/drivers/gpu/drm/drm_agpsupport.c
372 +index 3d33b82..1479659 100644
373 +--- a/drivers/gpu/drm/drm_agpsupport.c
374 ++++ b/drivers/gpu/drm/drm_agpsupport.c
375 +@@ -33,10 +33,11 @@
376 +
377 + #include "drmP.h"
378 + #include <linux/module.h>
379 +-#include <asm/agp.h>
380 +
381 + #if __OS_HAS_AGP
382 +
383 ++#include <asm/agp.h>
384 ++
385 + /**
386 + * Get AGP information.
387 + *
388 +diff --git a/drivers/ide/it821x.c b/drivers/ide/it821x.c
389 +index ef00408..011e6d6 100644
390 +--- a/drivers/ide/it821x.c
391 ++++ b/drivers/ide/it821x.c
392 +@@ -68,6 +68,8 @@
393 +
394 + #define DRV_NAME "it821x"
395 +
396 ++#define QUIRK_VORTEX86 1
397 ++
398 + struct it821x_dev
399 + {
400 + unsigned int smart:1, /* Are we in smart raid mode */
401 +@@ -79,6 +81,7 @@ struct it821x_dev
402 + u16 pio[2]; /* Cached PIO values */
403 + u16 mwdma[2]; /* Cached MWDMA values */
404 + u16 udma[2]; /* Cached UDMA values (per drive) */
405 ++ u16 quirks;
406 + };
407 +
408 + #define ATA_66 0
409 +@@ -580,6 +583,12 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif)
410 +
411 + hwif->ultra_mask = ATA_UDMA6;
412 + hwif->mwdma_mask = ATA_MWDMA2;
413 ++
414 ++ /* Vortex86SX quirk: prevent Ultra-DMA mode to fix BadCRC issue */
415 ++ if (idev->quirks & QUIRK_VORTEX86) {
416 ++ if (dev->revision == 0x11)
417 ++ hwif->ultra_mask = 0;
418 ++ }
419 + }
420 +
421 + static void it8212_disable_raid(struct pci_dev *dev)
422 +@@ -652,6 +661,8 @@ static int __devinit it821x_init_one(struct pci_dev *dev, const struct pci_devic
423 + return -ENOMEM;
424 + }
425 +
426 ++ itdevs->quirks = id->driver_data;
427 ++
428 + rc = ide_pci_init_one(dev, &it821x_chipset, itdevs);
429 + if (rc)
430 + kfree(itdevs);
431 +@@ -671,6 +682,7 @@ static void __devexit it821x_remove(struct pci_dev *dev)
432 + static const struct pci_device_id it821x_pci_tbl[] = {
433 + { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8211), 0 },
434 + { PCI_VDEVICE(ITE, PCI_DEVICE_ID_ITE_8212), 0 },
435 ++ { PCI_VDEVICE(RDC, PCI_DEVICE_ID_RDC_D1010), QUIRK_VORTEX86 },
436 + { 0, },
437 + };
438 +
439 +diff --git a/drivers/misc/sgi-xp/xpc_sn2.c b/drivers/misc/sgi-xp/xpc_sn2.c
440 +index d32c1ee..59ff816 100644
441 +--- a/drivers/misc/sgi-xp/xpc_sn2.c
442 ++++ b/drivers/misc/sgi-xp/xpc_sn2.c
443 +@@ -1841,6 +1841,7 @@ xpc_process_msg_chctl_flags_sn2(struct xpc_partition *part, int ch_number)
444 + */
445 + xpc_clear_remote_msgqueue_flags_sn2(ch);
446 +
447 ++ smp_wmb(); /* ensure flags have been cleared before bte_copy */
448 + ch_sn2->w_remote_GP.put = ch_sn2->remote_GP.put;
449 +
450 + dev_dbg(xpc_chan, "w_remote_GP.put changed to %ld, partid=%d, "
451 +@@ -1939,7 +1940,7 @@ xpc_get_deliverable_payload_sn2(struct xpc_channel *ch)
452 + break;
453 +
454 + get = ch_sn2->w_local_GP.get;
455 +- rmb(); /* guarantee that .get loads before .put */
456 ++ smp_rmb(); /* guarantee that .get loads before .put */
457 + if (get == ch_sn2->w_remote_GP.put)
458 + break;
459 +
460 +@@ -1961,11 +1962,13 @@ xpc_get_deliverable_payload_sn2(struct xpc_channel *ch)
461 +
462 + msg = xpc_pull_remote_msg_sn2(ch, get);
463 +
464 +- DBUG_ON(msg != NULL && msg->number != get);
465 +- DBUG_ON(msg != NULL && (msg->flags & XPC_M_SN2_DONE));
466 +- DBUG_ON(msg != NULL && !(msg->flags & XPC_M_SN2_READY));
467 ++ if (msg != NULL) {
468 ++ DBUG_ON(msg->number != get);
469 ++ DBUG_ON(msg->flags & XPC_M_SN2_DONE);
470 ++ DBUG_ON(!(msg->flags & XPC_M_SN2_READY));
471 +
472 +- payload = &msg->payload;
473 ++ payload = &msg->payload;
474 ++ }
475 + break;
476 + }
477 +
478 +@@ -2058,7 +2061,7 @@ xpc_allocate_msg_sn2(struct xpc_channel *ch, u32 flags,
479 + while (1) {
480 +
481 + put = ch_sn2->w_local_GP.put;
482 +- rmb(); /* guarantee that .put loads before .get */
483 ++ smp_rmb(); /* guarantee that .put loads before .get */
484 + if (put - ch_sn2->w_remote_GP.get < ch->local_nentries) {
485 +
486 + /* There are available message entries. We need to try
487 +@@ -2191,7 +2194,7 @@ xpc_send_payload_sn2(struct xpc_channel *ch, u32 flags, void *payload,
488 + * The preceding store of msg->flags must occur before the following
489 + * load of local_GP->put.
490 + */
491 +- mb();
492 ++ smp_mb();
493 +
494 + /* see if the message is next in line to be sent, if so send it */
495 +
496 +@@ -2292,7 +2295,7 @@ xpc_received_payload_sn2(struct xpc_channel *ch, void *payload)
497 + * The preceding store of msg->flags must occur before the following
498 + * load of local_GP->get.
499 + */
500 +- mb();
501 ++ smp_mb();
502 +
503 + /*
504 + * See if this message is next in line to be acknowledged as having
505 +diff --git a/drivers/misc/sgi-xp/xpc_uv.c b/drivers/misc/sgi-xp/xpc_uv.c
506 +index 1ac694c..b8f8d50 100644
507 +--- a/drivers/misc/sgi-xp/xpc_uv.c
508 ++++ b/drivers/misc/sgi-xp/xpc_uv.c
509 +@@ -1238,7 +1238,7 @@ xpc_send_payload_uv(struct xpc_channel *ch, u32 flags, void *payload,
510 + atomic_inc(&ch->n_to_notify);
511 +
512 + msg_slot->key = key;
513 +- wmb(); /* a non-NULL func must hit memory after the key */
514 ++ smp_wmb(); /* a non-NULL func must hit memory after the key */
515 + msg_slot->func = func;
516 +
517 + if (ch->flags & XPC_C_DISCONNECTING) {
518 +diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
519 +index 600210d..d672d40 100644
520 +--- a/drivers/net/bnx2x_main.c
521 ++++ b/drivers/net/bnx2x_main.c
522 +@@ -8079,6 +8079,9 @@ static int bnx2x_get_eeprom(struct net_device *dev,
523 + struct bnx2x *bp = netdev_priv(dev);
524 + int rc;
525 +
526 ++ if (!netif_running(dev))
527 ++ return -EAGAIN;
528 ++
529 + DP(BNX2X_MSG_NVM, "ethtool_eeprom: cmd %d\n"
530 + DP_LEVEL " magic 0x%x offset 0x%x (%d) len 0x%x (%d)\n",
531 + eeprom->cmd, eeprom->magic, eeprom->offset, eeprom->offset,
532 +diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
533 +index 2d14255..e521555 100644
534 +--- a/drivers/net/wireless/ath5k/base.c
535 ++++ b/drivers/net/wireless/ath5k/base.c
536 +@@ -2157,7 +2157,8 @@ ath5k_beacon_config(struct ath5k_softc *sc)
537 +
538 + if (sc->opmode == NL80211_IFTYPE_STATION) {
539 + sc->imask |= AR5K_INT_BMISS;
540 +- } else if (sc->opmode == NL80211_IFTYPE_ADHOC) {
541 ++ } else if (sc->opmode == NL80211_IFTYPE_ADHOC ||
542 ++ sc->opmode == NL80211_IFTYPE_MESH_POINT) {
543 + /*
544 + * In IBSS mode we use a self-linked tx descriptor and let the
545 + * hardware send the beacons automatically. We have to load it
546 +@@ -2748,6 +2749,7 @@ static int ath5k_add_interface(struct ieee80211_hw *hw,
547 + switch (conf->type) {
548 + case NL80211_IFTYPE_STATION:
549 + case NL80211_IFTYPE_ADHOC:
550 ++ case NL80211_IFTYPE_MESH_POINT:
551 + case NL80211_IFTYPE_MONITOR:
552 + sc->opmode = conf->type;
553 + break;
554 +@@ -2819,7 +2821,8 @@ ath5k_config_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
555 + }
556 +
557 + if (conf->changed & IEEE80211_IFCC_BEACON &&
558 +- vif->type == NL80211_IFTYPE_ADHOC) {
559 ++ (vif->type == NL80211_IFTYPE_ADHOC ||
560 ++ vif->type == NL80211_IFTYPE_MESH_POINT)) {
561 + struct sk_buff *beacon = ieee80211_beacon_get(hw, vif);
562 + if (!beacon) {
563 + ret = -ENOMEM;
564 +@@ -2951,6 +2954,9 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw,
565 + sc->opmode == NL80211_IFTYPE_ADHOC) {
566 + rfilt |= AR5K_RX_FILTER_BEACON;
567 + }
568 ++ if (sc->opmode == NL80211_IFTYPE_MESH_POINT)
569 ++ rfilt |= AR5K_RX_FILTER_CONTROL | AR5K_RX_FILTER_BEACON |
570 ++ AR5K_RX_FILTER_PROBEREQ | AR5K_RX_FILTER_PROM;
571 +
572 + /* Set filters */
573 + ath5k_hw_set_rx_filter(ah,rfilt);
574 +diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c
575 +index 69eb013..47c1c48 100644
576 +--- a/drivers/net/wireless/rtl8187_dev.c
577 ++++ b/drivers/net/wireless/rtl8187_dev.c
578 +@@ -263,6 +263,7 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
579 +
580 + usb_fill_bulk_urb(urb, priv->udev, usb_sndbulkpipe(priv->udev, ep),
581 + buf, skb->len, rtl8187_tx_cb, skb);
582 ++ urb->transfer_flags |= URB_ZERO_PACKET;
583 + rc = usb_submit_urb(urb, GFP_ATOMIC);
584 + if (rc < 0) {
585 + usb_free_urb(urb);
586 +diff --git a/drivers/net/wireless/rtl8187_rtl8225.c b/drivers/net/wireless/rtl8187_rtl8225.c
587 +index 1bae899..487593f 100644
588 +--- a/drivers/net/wireless/rtl8187_rtl8225.c
589 ++++ b/drivers/net/wireless/rtl8187_rtl8225.c
590 +@@ -287,7 +287,10 @@ static void rtl8225_rf_set_tx_power(struct ieee80211_hw *dev, int channel)
591 + ofdm_power = priv->channels[channel - 1].hw_value >> 4;
592 +
593 + cck_power = min(cck_power, (u8)11);
594 +- ofdm_power = min(ofdm_power, (u8)35);
595 ++ if (ofdm_power > (u8)15)
596 ++ ofdm_power = 25;
597 ++ else
598 ++ ofdm_power += 10;
599 +
600 + rtl818x_iowrite8(priv, &priv->map->TX_GAIN_CCK,
601 + rtl8225_tx_gain_cck_ofdm[cck_power / 6] >> 1);
602 +@@ -540,7 +543,10 @@ static void rtl8225z2_rf_set_tx_power(struct ieee80211_hw *dev, int channel)
603 + cck_power += priv->txpwr_base & 0xF;
604 + cck_power = min(cck_power, (u8)35);
605 +
606 +- ofdm_power = min(ofdm_power, (u8)15);
607 ++ if (ofdm_power > (u8)15)
608 ++ ofdm_power = 25;
609 ++ else
610 ++ ofdm_power += 10;
611 + ofdm_power += priv->txpwr_base >> 4;
612 + ofdm_power = min(ofdm_power, (u8)35);
613 +
614 +diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c
615 +index 39cf248..b2ecff4 100644
616 +--- a/drivers/pci/hotplug/pciehp_core.c
617 ++++ b/drivers/pci/hotplug/pciehp_core.c
618 +@@ -126,8 +126,10 @@ static int set_lock_status(struct hotplug_slot *hotplug_slot, u8 status)
619 + mutex_lock(&slot->ctrl->crit_sect);
620 +
621 + /* has it been >1 sec since our last toggle? */
622 +- if ((get_seconds() - slot->last_emi_toggle) < 1)
623 ++ if ((get_seconds() - slot->last_emi_toggle) < 1) {
624 ++ mutex_unlock(&slot->ctrl->crit_sect);
625 + return -EINVAL;
626 ++ }
627 +
628 + /* see what our current state is */
629 + retval = get_lock_status(hotplug_slot, &value);
630 +diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
631 +index 5450a0e..222cffa 100644
632 +--- a/drivers/serial/8250_pci.c
633 ++++ b/drivers/serial/8250_pci.c
634 +@@ -2271,6 +2271,9 @@ static struct pci_device_id serial_pci_tbl[] = {
635 + { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_COMM8,
636 + PCI_ANY_ID, PCI_ANY_ID, 0, 0,
637 + pbn_b2_8_115200 },
638 ++ { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_7803,
639 ++ PCI_ANY_ID, PCI_ANY_ID, 0, 0,
640 ++ pbn_b2_8_460800 },
641 + { PCI_VENDOR_ID_SEALEVEL, PCI_DEVICE_ID_SEALEVEL_UCOMM8,
642 + PCI_ANY_ID, PCI_ANY_ID, 0, 0,
643 + pbn_b2_8_115200 },
644 +diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
645 +index 2bccefe..c7e5339 100644
646 +--- a/drivers/usb/core/devio.c
647 ++++ b/drivers/usb/core/devio.c
648 +@@ -1703,7 +1703,7 @@ const struct file_operations usbdev_file_operations = {
649 + .release = usbdev_release,
650 + };
651 +
652 +-void usb_fs_classdev_common_remove(struct usb_device *udev)
653 ++static void usbdev_remove(struct usb_device *udev)
654 + {
655 + struct dev_state *ps;
656 + struct siginfo sinfo;
657 +@@ -1745,10 +1745,15 @@ static void usb_classdev_remove(struct usb_device *dev)
658 + {
659 + if (dev->usb_classdev)
660 + device_unregister(dev->usb_classdev);
661 +- usb_fs_classdev_common_remove(dev);
662 + }
663 +
664 +-static int usb_classdev_notify(struct notifier_block *self,
665 ++#else
666 ++#define usb_classdev_add(dev) 0
667 ++#define usb_classdev_remove(dev) do {} while (0)
668 ++
669 ++#endif
670 ++
671 ++static int usbdev_notify(struct notifier_block *self,
672 + unsigned long action, void *dev)
673 + {
674 + switch (action) {
675 +@@ -1758,15 +1763,15 @@ static int usb_classdev_notify(struct notifier_block *self,
676 + break;
677 + case USB_DEVICE_REMOVE:
678 + usb_classdev_remove(dev);
679 ++ usbdev_remove(dev);
680 + break;
681 + }
682 + return NOTIFY_OK;
683 + }
684 +
685 + static struct notifier_block usbdev_nb = {
686 +- .notifier_call = usb_classdev_notify,
687 ++ .notifier_call = usbdev_notify,
688 + };
689 +-#endif
690 +
691 + static struct cdev usb_device_cdev;
692 +
693 +@@ -1801,9 +1806,8 @@ int __init usb_devio_init(void)
694 + * to /sys/dev
695 + */
696 + usb_classdev_class->dev_kobj = NULL;
697 +-
698 +- usb_register_notify(&usbdev_nb);
699 + #endif
700 ++ usb_register_notify(&usbdev_nb);
701 + out:
702 + return retval;
703 +
704 +@@ -1814,8 +1818,8 @@ error_cdev:
705 +
706 + void usb_devio_cleanup(void)
707 + {
708 +-#ifdef CONFIG_USB_DEVICE_CLASS
709 + usb_unregister_notify(&usbdev_nb);
710 ++#ifdef CONFIG_USB_DEVICE_CLASS
711 + class_destroy(usb_classdev_class);
712 + #endif
713 + cdev_del(&usb_device_cdev);
714 +diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
715 +index 7c3710e..f9473fb 100644
716 +--- a/drivers/usb/core/driver.c
717 ++++ b/drivers/usb/core/driver.c
718 +@@ -269,7 +269,7 @@ static int usb_unbind_interface(struct device *dev)
719 + * supports "soft" unbinding.
720 + */
721 + if (!driver->soft_unbind)
722 +- usb_disable_interface(udev, intf);
723 ++ usb_disable_interface(udev, intf, false);
724 +
725 + driver->disconnect(intf);
726 +
727 +diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
728 +index 81eea42..da11baf 100644
729 +--- a/drivers/usb/core/hub.c
730 ++++ b/drivers/usb/core/hub.c
731 +@@ -2383,8 +2383,8 @@ static int hub_port_debounce(struct usb_hub *hub, int port1)
732 +
733 + void usb_ep0_reinit(struct usb_device *udev)
734 + {
735 +- usb_disable_endpoint(udev, 0 + USB_DIR_IN);
736 +- usb_disable_endpoint(udev, 0 + USB_DIR_OUT);
737 ++ usb_disable_endpoint(udev, 0 + USB_DIR_IN, true);
738 ++ usb_disable_endpoint(udev, 0 + USB_DIR_OUT, true);
739 + usb_enable_endpoint(udev, &udev->ep0, true);
740 + }
741 + EXPORT_SYMBOL_GPL(usb_ep0_reinit);
742 +diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c
743 +index 9463226..3181d7d 100644
744 +--- a/drivers/usb/core/inode.c
745 ++++ b/drivers/usb/core/inode.c
746 +@@ -718,7 +718,6 @@ static void usbfs_remove_device(struct usb_device *dev)
747 + fs_remove_file (dev->usbfs_dentry);
748 + dev->usbfs_dentry = NULL;
749 + }
750 +- usb_fs_classdev_common_remove(dev);
751 + }
752 +
753 + static int usbfs_notify(struct notifier_block *self, unsigned long action, void *dev)
754 +diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
755 +index bdcfe92..8497f63 100644
756 +--- a/drivers/usb/core/message.c
757 ++++ b/drivers/usb/core/message.c
758 +@@ -1009,14 +1009,15 @@ EXPORT_SYMBOL_GPL(usb_clear_halt);
759 + * @dev: the device whose endpoint is being disabled
760 + * @epaddr: the endpoint's address. Endpoint number for output,
761 + * endpoint number + USB_DIR_IN for input
762 ++ * @reset_hardware: flag to erase any endpoint state stored in the
763 ++ * controller hardware
764 + *
765 +- * Deallocates hcd/hardware state for this endpoint ... and nukes all
766 +- * pending urbs.
767 +- *
768 +- * If the HCD hasn't registered a disable() function, this sets the
769 +- * endpoint's maxpacket size to 0 to prevent further submissions.
770 ++ * Disables the endpoint for URB submission and nukes all pending URBs.
771 ++ * If @reset_hardware is set then also deallocates hcd/hardware state
772 ++ * for the endpoint.
773 + */
774 +-void usb_disable_endpoint(struct usb_device *dev, unsigned int epaddr)
775 ++void usb_disable_endpoint(struct usb_device *dev, unsigned int epaddr,
776 ++ bool reset_hardware)
777 + {
778 + unsigned int epnum = epaddr & USB_ENDPOINT_NUMBER_MASK;
779 + struct usb_host_endpoint *ep;
780 +@@ -1026,15 +1027,18 @@ void usb_disable_endpoint(struct usb_device *dev, unsigned int epaddr)
781 +
782 + if (usb_endpoint_out(epaddr)) {
783 + ep = dev->ep_out[epnum];
784 +- dev->ep_out[epnum] = NULL;
785 ++ if (reset_hardware)
786 ++ dev->ep_out[epnum] = NULL;
787 + } else {
788 + ep = dev->ep_in[epnum];
789 +- dev->ep_in[epnum] = NULL;
790 ++ if (reset_hardware)
791 ++ dev->ep_in[epnum] = NULL;
792 + }
793 + if (ep) {
794 + ep->enabled = 0;
795 + usb_hcd_flush_endpoint(dev, ep);
796 +- usb_hcd_disable_endpoint(dev, ep);
797 ++ if (reset_hardware)
798 ++ usb_hcd_disable_endpoint(dev, ep);
799 + }
800 + }
801 +
802 +@@ -1042,17 +1046,21 @@ void usb_disable_endpoint(struct usb_device *dev, unsigned int epaddr)
803 + * usb_disable_interface -- Disable all endpoints for an interface
804 + * @dev: the device whose interface is being disabled
805 + * @intf: pointer to the interface descriptor
806 ++ * @reset_hardware: flag to erase any endpoint state stored in the
807 ++ * controller hardware
808 + *
809 + * Disables all the endpoints for the interface's current altsetting.
810 + */
811 +-void usb_disable_interface(struct usb_device *dev, struct usb_interface *intf)
812 ++void usb_disable_interface(struct usb_device *dev, struct usb_interface *intf,
813 ++ bool reset_hardware)
814 + {
815 + struct usb_host_interface *alt = intf->cur_altsetting;
816 + int i;
817 +
818 + for (i = 0; i < alt->desc.bNumEndpoints; ++i) {
819 + usb_disable_endpoint(dev,
820 +- alt->endpoint[i].desc.bEndpointAddress);
821 ++ alt->endpoint[i].desc.bEndpointAddress,
822 ++ reset_hardware);
823 + }
824 + }
825 +
826 +@@ -1073,8 +1081,8 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
827 + dev_dbg(&dev->dev, "%s nuking %s URBs\n", __func__,
828 + skip_ep0 ? "non-ep0" : "all");
829 + for (i = skip_ep0; i < 16; ++i) {
830 +- usb_disable_endpoint(dev, i);
831 +- usb_disable_endpoint(dev, i + USB_DIR_IN);
832 ++ usb_disable_endpoint(dev, i, true);
833 ++ usb_disable_endpoint(dev, i + USB_DIR_IN, true);
834 + }
835 + dev->toggle[0] = dev->toggle[1] = 0;
836 +
837 +@@ -1242,7 +1250,7 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)
838 + /* prevent submissions using previous endpoint settings */
839 + if (iface->cur_altsetting != alt)
840 + usb_remove_sysfs_intf_files(iface);
841 +- usb_disable_interface(dev, iface);
842 ++ usb_disable_interface(dev, iface, true);
843 +
844 + iface->cur_altsetting = alt;
845 +
846 +@@ -1320,8 +1328,8 @@ int usb_reset_configuration(struct usb_device *dev)
847 + */
848 +
849 + for (i = 1; i < 16; ++i) {
850 +- usb_disable_endpoint(dev, i);
851 +- usb_disable_endpoint(dev, i + USB_DIR_IN);
852 ++ usb_disable_endpoint(dev, i, true);
853 ++ usb_disable_endpoint(dev, i + USB_DIR_IN, true);
854 + }
855 +
856 + config = dev->actconfig;
857 +diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
858 +index 1d450e9..6c90be1 100644
859 +--- a/drivers/usb/core/usb.h
860 ++++ b/drivers/usb/core/usb.h
861 +@@ -13,9 +13,10 @@ extern void usb_enable_endpoint(struct usb_device *dev,
862 + struct usb_host_endpoint *ep, bool reset_toggle);
863 + extern void usb_enable_interface(struct usb_device *dev,
864 + struct usb_interface *intf, bool reset_toggles);
865 +-extern void usb_disable_endpoint(struct usb_device *dev, unsigned int epaddr);
866 ++extern void usb_disable_endpoint(struct usb_device *dev, unsigned int epaddr,
867 ++ bool reset_hardware);
868 + extern void usb_disable_interface(struct usb_device *dev,
869 +- struct usb_interface *intf);
870 ++ struct usb_interface *intf, bool reset_hardware);
871 + extern void usb_release_interface_cache(struct kref *ref);
872 + extern void usb_disable_device(struct usb_device *dev, int skip_ep0);
873 + extern int usb_deauthorize_device(struct usb_device *);
874 +@@ -147,7 +148,6 @@ extern struct usb_driver usbfs_driver;
875 + extern const struct file_operations usbfs_devices_fops;
876 + extern const struct file_operations usbdev_file_operations;
877 + extern void usbfs_conn_disc_event(void);
878 +-extern void usb_fs_classdev_common_remove(struct usb_device *udev);
879 +
880 + extern int usb_devio_init(void);
881 + extern void usb_devio_cleanup(void);
882 +diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c
883 +index e06810a..4cf27c7 100644
884 +--- a/drivers/usb/mon/mon_bin.c
885 ++++ b/drivers/usb/mon/mon_bin.c
886 +@@ -37,6 +37,7 @@
887 + #define MON_IOCX_GET _IOW(MON_IOC_MAGIC, 6, struct mon_bin_get)
888 + #define MON_IOCX_MFETCH _IOWR(MON_IOC_MAGIC, 7, struct mon_bin_mfetch)
889 + #define MON_IOCH_MFLUSH _IO(MON_IOC_MAGIC, 8)
890 ++
891 + #ifdef CONFIG_COMPAT
892 + #define MON_IOCX_GET32 _IOW(MON_IOC_MAGIC, 6, struct mon_bin_get32)
893 + #define MON_IOCX_MFETCH32 _IOWR(MON_IOC_MAGIC, 7, struct mon_bin_mfetch32)
894 +@@ -921,21 +922,6 @@ static int mon_bin_ioctl(struct inode *inode, struct file *file,
895 + }
896 + break;
897 +
898 +-#ifdef CONFIG_COMPAT
899 +- case MON_IOCX_GET32: {
900 +- struct mon_bin_get32 getb;
901 +-
902 +- if (copy_from_user(&getb, (void __user *)arg,
903 +- sizeof(struct mon_bin_get32)))
904 +- return -EFAULT;
905 +-
906 +- ret = mon_bin_get_event(file, rp,
907 +- compat_ptr(getb.hdr32), compat_ptr(getb.data32),
908 +- getb.alloc32);
909 +- }
910 +- break;
911 +-#endif
912 +-
913 + case MON_IOCX_MFETCH:
914 + {
915 + struct mon_bin_mfetch mfetch;
916 +@@ -962,7 +948,57 @@ static int mon_bin_ioctl(struct inode *inode, struct file *file,
917 + }
918 + break;
919 +
920 ++ case MON_IOCG_STATS: {
921 ++ struct mon_bin_stats __user *sp;
922 ++ unsigned int nevents;
923 ++ unsigned int ndropped;
924 ++
925 ++ spin_lock_irqsave(&rp->b_lock, flags);
926 ++ ndropped = rp->cnt_lost;
927 ++ rp->cnt_lost = 0;
928 ++ spin_unlock_irqrestore(&rp->b_lock, flags);
929 ++ nevents = mon_bin_queued(rp);
930 ++
931 ++ sp = (struct mon_bin_stats __user *)arg;
932 ++ if (put_user(rp->cnt_lost, &sp->dropped))
933 ++ return -EFAULT;
934 ++ if (put_user(nevents, &sp->queued))
935 ++ return -EFAULT;
936 ++
937 ++ }
938 ++ break;
939 ++
940 ++ default:
941 ++ return -ENOTTY;
942 ++ }
943 ++
944 ++ return ret;
945 ++}
946 ++
947 + #ifdef CONFIG_COMPAT
948 ++static long mon_bin_compat_ioctl(struct file *file,
949 ++ unsigned int cmd, unsigned long arg)
950 ++{
951 ++ struct mon_reader_bin *rp = file->private_data;
952 ++ int ret;
953 ++
954 ++ switch (cmd) {
955 ++
956 ++ case MON_IOCX_GET32: {
957 ++ struct mon_bin_get32 getb;
958 ++
959 ++ if (copy_from_user(&getb, (void __user *)arg,
960 ++ sizeof(struct mon_bin_get32)))
961 ++ return -EFAULT;
962 ++
963 ++ ret = mon_bin_get_event(file, rp,
964 ++ compat_ptr(getb.hdr32), compat_ptr(getb.data32),
965 ++ getb.alloc32);
966 ++ if (ret < 0)
967 ++ return ret;
968 ++ }
969 ++ return 0;
970 ++
971 + case MON_IOCX_MFETCH32:
972 + {
973 + struct mon_bin_mfetch32 mfetch;
974 +@@ -986,37 +1022,25 @@ static int mon_bin_ioctl(struct inode *inode, struct file *file,
975 + return ret;
976 + if (put_user(ret, &uptr->nfetch32))
977 + return -EFAULT;
978 +- ret = 0;
979 + }
980 +- break;
981 +-#endif
982 +-
983 +- case MON_IOCG_STATS: {
984 +- struct mon_bin_stats __user *sp;
985 +- unsigned int nevents;
986 +- unsigned int ndropped;
987 +-
988 +- spin_lock_irqsave(&rp->b_lock, flags);
989 +- ndropped = rp->cnt_lost;
990 +- rp->cnt_lost = 0;
991 +- spin_unlock_irqrestore(&rp->b_lock, flags);
992 +- nevents = mon_bin_queued(rp);
993 ++ return 0;
994 +
995 +- sp = (struct mon_bin_stats __user *)arg;
996 +- if (put_user(rp->cnt_lost, &sp->dropped))
997 +- return -EFAULT;
998 +- if (put_user(nevents, &sp->queued))
999 +- return -EFAULT;
1000 ++ case MON_IOCG_STATS:
1001 ++ return mon_bin_ioctl(NULL, file, cmd,
1002 ++ (unsigned long) compat_ptr(arg));
1003 +
1004 +- }
1005 +- break;
1006 ++ case MON_IOCQ_URB_LEN:
1007 ++ case MON_IOCQ_RING_SIZE:
1008 ++ case MON_IOCT_RING_SIZE:
1009 ++ case MON_IOCH_MFLUSH:
1010 ++ return mon_bin_ioctl(NULL, file, cmd, arg);
1011 +
1012 + default:
1013 +- return -ENOTTY;
1014 ++ ;
1015 + }
1016 +-
1017 +- return ret;
1018 ++ return -ENOTTY;
1019 + }
1020 ++#endif /* CONFIG_COMPAT */
1021 +
1022 + static unsigned int
1023 + mon_bin_poll(struct file *file, struct poll_table_struct *wait)
1024 +@@ -1094,6 +1118,9 @@ static const struct file_operations mon_fops_binary = {
1025 + /* .write = mon_text_write, */
1026 + .poll = mon_bin_poll,
1027 + .ioctl = mon_bin_ioctl,
1028 ++#ifdef CONFIG_COMPAT
1029 ++ .compat_ioctl = mon_bin_compat_ioctl,
1030 ++#endif
1031 + .release = mon_bin_release,
1032 + .mmap = mon_bin_mmap,
1033 + };
1034 +diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
1035 +index ce7f746..443122f 100644
1036 +--- a/drivers/usb/storage/unusual_devs.h
1037 ++++ b/drivers/usb/storage/unusual_devs.h
1038 +@@ -1970,6 +1970,12 @@ UNUSUAL_DEV( 0x19d2, 0x2000, 0x0000, 0x0000,
1039 + US_SC_DEVICE, US_PR_DEVICE, NULL,
1040 + US_FL_IGNORE_DEVICE),
1041 +
1042 ++UNUSUAL_DEV( 0x2116, 0x0320, 0x0001, 0x0001,
1043 ++ "ST",
1044 ++ "2A",
1045 ++ US_SC_DEVICE, US_PR_DEVICE, NULL,
1046 ++ US_FL_FIX_CAPACITY),
1047 ++
1048 + /* patch submitted by Davide Perini <perini.davide@××××××××××.org>
1049 + * and Renato Perini <rperini@×××××.it>
1050 + */
1051 +diff --git a/fs/eventpoll.c b/fs/eventpoll.c
1052 +index ba2f9ec..011b9b8 100644
1053 +--- a/fs/eventpoll.c
1054 ++++ b/fs/eventpoll.c
1055 +@@ -234,8 +234,6 @@ struct ep_pqueue {
1056 + /*
1057 + * Configuration options available inside /proc/sys/fs/epoll/
1058 + */
1059 +-/* Maximum number of epoll devices, per user */
1060 +-static int max_user_instances __read_mostly;
1061 + /* Maximum number of epoll watched descriptors, per user */
1062 + static int max_user_watches __read_mostly;
1063 +
1064 +@@ -261,14 +259,6 @@ static int zero;
1065 +
1066 + ctl_table epoll_table[] = {
1067 + {
1068 +- .procname = "max_user_instances",
1069 +- .data = &max_user_instances,
1070 +- .maxlen = sizeof(int),
1071 +- .mode = 0644,
1072 +- .proc_handler = &proc_dointvec_minmax,
1073 +- .extra1 = &zero,
1074 +- },
1075 +- {
1076 + .procname = "max_user_watches",
1077 + .data = &max_user_watches,
1078 + .maxlen = sizeof(int),
1079 +@@ -491,7 +481,6 @@ static void ep_free(struct eventpoll *ep)
1080 +
1081 + mutex_unlock(&epmutex);
1082 + mutex_destroy(&ep->mtx);
1083 +- atomic_dec(&ep->user->epoll_devs);
1084 + free_uid(ep->user);
1085 + kfree(ep);
1086 + }
1087 +@@ -581,10 +570,6 @@ static int ep_alloc(struct eventpoll **pep)
1088 + struct eventpoll *ep;
1089 +
1090 + user = get_current_user();
1091 +- error = -EMFILE;
1092 +- if (unlikely(atomic_read(&user->epoll_devs) >=
1093 +- max_user_instances))
1094 +- goto free_uid;
1095 + error = -ENOMEM;
1096 + ep = kzalloc(sizeof(*ep), GFP_KERNEL);
1097 + if (unlikely(!ep))
1098 +@@ -1141,7 +1126,6 @@ SYSCALL_DEFINE1(epoll_create1, int, flags)
1099 + flags & O_CLOEXEC);
1100 + if (fd < 0)
1101 + ep_free(ep);
1102 +- atomic_inc(&ep->user->epoll_devs);
1103 +
1104 + error_return:
1105 + DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_create(%d) = %d\n",
1106 +@@ -1366,8 +1350,10 @@ static int __init eventpoll_init(void)
1107 + struct sysinfo si;
1108 +
1109 + si_meminfo(&si);
1110 +- max_user_instances = 128;
1111 +- max_user_watches = (((si.totalram - si.totalhigh) / 32) << PAGE_SHIFT) /
1112 ++ /*
1113 ++ * Allows top 4% of lomem to be allocated for epoll watches (per user).
1114 ++ */
1115 ++ max_user_watches = (((si.totalram - si.totalhigh) / 25) << PAGE_SHIFT) /
1116 + EP_ITEM_COST;
1117 +
1118 + /* Initialize the structure used to perform safe poll wait head wake ups */
1119 +diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c
1120 +index a48e965..83bd869 100644
1121 +--- a/fs/ext3/namei.c
1122 ++++ b/fs/ext3/namei.c
1123 +@@ -1357,7 +1357,7 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
1124 + struct fake_dirent *fde;
1125 +
1126 + blocksize = dir->i_sb->s_blocksize;
1127 +- dxtrace(printk("Creating index\n"));
1128 ++ dxtrace(printk(KERN_DEBUG "Creating index: inode %lu\n", dir->i_ino));
1129 + retval = ext3_journal_get_write_access(handle, bh);
1130 + if (retval) {
1131 + ext3_std_error(dir->i_sb, retval);
1132 +@@ -1366,6 +1366,19 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
1133 + }
1134 + root = (struct dx_root *) bh->b_data;
1135 +
1136 ++ /* The 0th block becomes the root, move the dirents out */
1137 ++ fde = &root->dotdot;
1138 ++ de = (struct ext3_dir_entry_2 *)((char *)fde +
1139 ++ ext3_rec_len_from_disk(fde->rec_len));
1140 ++ if ((char *) de >= (((char *) root) + blocksize)) {
1141 ++ ext3_error(dir->i_sb, __func__,
1142 ++ "invalid rec_len for '..' in inode %lu",
1143 ++ dir->i_ino);
1144 ++ brelse(bh);
1145 ++ return -EIO;
1146 ++ }
1147 ++ len = ((char *) root) + blocksize - (char *) de;
1148 ++
1149 + bh2 = ext3_append (handle, dir, &block, &retval);
1150 + if (!(bh2)) {
1151 + brelse(bh);
1152 +@@ -1374,11 +1387,6 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
1153 + EXT3_I(dir)->i_flags |= EXT3_INDEX_FL;
1154 + data1 = bh2->b_data;
1155 +
1156 +- /* The 0th block becomes the root, move the dirents out */
1157 +- fde = &root->dotdot;
1158 +- de = (struct ext3_dir_entry_2 *)((char *)fde +
1159 +- ext3_rec_len_from_disk(fde->rec_len));
1160 +- len = ((char *) root) + blocksize - (char *) de;
1161 + memcpy (data1, de, len);
1162 + de = (struct ext3_dir_entry_2 *) data1;
1163 + top = data1 + len;
1164 +diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
1165 +index b723614..2e37f14 100644
1166 +--- a/fs/fuse/dev.c
1167 ++++ b/fs/fuse/dev.c
1168 +@@ -281,7 +281,8 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req)
1169 + fc->blocked = 0;
1170 + wake_up_all(&fc->blocked_waitq);
1171 + }
1172 +- if (fc->num_background == FUSE_CONGESTION_THRESHOLD) {
1173 ++ if (fc->num_background == FUSE_CONGESTION_THRESHOLD &&
1174 ++ fc->connected) {
1175 + clear_bdi_congested(&fc->bdi, READ);
1176 + clear_bdi_congested(&fc->bdi, WRITE);
1177 + }
1178 +diff --git a/fs/fuse/file.c b/fs/fuse/file.c
1179 +index 4c9ee70..d8029d8 100644
1180 +--- a/fs/fuse/file.c
1181 ++++ b/fs/fuse/file.c
1182 +@@ -54,7 +54,7 @@ struct fuse_file *fuse_file_alloc(void)
1183 + ff->reserved_req = fuse_request_alloc();
1184 + if (!ff->reserved_req) {
1185 + kfree(ff);
1186 +- ff = NULL;
1187 ++ return NULL;
1188 + } else {
1189 + INIT_LIST_HEAD(&ff->write_entry);
1190 + atomic_set(&ff->count, 0);
1191 +diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
1192 +index 2e99f34..755fe24 100644
1193 +--- a/fs/fuse/inode.c
1194 ++++ b/fs/fuse/inode.c
1195 +@@ -292,6 +292,7 @@ static void fuse_put_super(struct super_block *sb)
1196 + list_del(&fc->entry);
1197 + fuse_ctl_remove_conn(fc);
1198 + mutex_unlock(&fuse_mutex);
1199 ++ bdi_destroy(&fc->bdi);
1200 + fuse_conn_put(fc);
1201 + }
1202 +
1203 +@@ -531,7 +532,6 @@ void fuse_conn_put(struct fuse_conn *fc)
1204 + if (fc->destroy_req)
1205 + fuse_request_free(fc->destroy_req);
1206 + mutex_destroy(&fc->inst_mutex);
1207 +- bdi_destroy(&fc->bdi);
1208 + kfree(fc);
1209 + }
1210 + }
1211 +@@ -825,12 +825,16 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
1212 + if (!file)
1213 + return -EINVAL;
1214 +
1215 +- if (file->f_op != &fuse_dev_operations)
1216 ++ if (file->f_op != &fuse_dev_operations) {
1217 ++ fput(file);
1218 + return -EINVAL;
1219 ++ }
1220 +
1221 + fc = new_conn(sb);
1222 +- if (!fc)
1223 ++ if (!fc) {
1224 ++ fput(file);
1225 + return -ENOMEM;
1226 ++ }
1227 +
1228 + fc->flags = d.flags;
1229 + fc->user_id = d.user_id;
1230 +diff --git a/fs/inotify_user.c b/fs/inotify_user.c
1231 +index a7aea80..12533a6 100644
1232 +--- a/fs/inotify_user.c
1233 ++++ b/fs/inotify_user.c
1234 +@@ -427,10 +427,61 @@ static unsigned int inotify_poll(struct file *file, poll_table *wait)
1235 + return ret;
1236 + }
1237 +
1238 ++/*
1239 ++ * Get an inotify_kernel_event if one exists and is small
1240 ++ * enough to fit in "count". Return an error pointer if
1241 ++ * not large enough.
1242 ++ *
1243 ++ * Called with the device ev_mutex held.
1244 ++ */
1245 ++static struct inotify_kernel_event *get_one_event(struct inotify_device *dev,
1246 ++ size_t count)
1247 ++{
1248 ++ size_t event_size = sizeof(struct inotify_event);
1249 ++ struct inotify_kernel_event *kevent;
1250 ++
1251 ++ if (list_empty(&dev->events))
1252 ++ return NULL;
1253 ++
1254 ++ kevent = inotify_dev_get_event(dev);
1255 ++ if (kevent->name)
1256 ++ event_size += kevent->event.len;
1257 ++
1258 ++ if (event_size > count)
1259 ++ return ERR_PTR(-EINVAL);
1260 ++
1261 ++ remove_kevent(dev, kevent);
1262 ++ return kevent;
1263 ++}
1264 ++
1265 ++/*
1266 ++ * Copy an event to user space, returning how much we copied.
1267 ++ *
1268 ++ * We already checked that the event size is smaller than the
1269 ++ * buffer we had in "get_one_event()" above.
1270 ++ */
1271 ++static ssize_t copy_event_to_user(struct inotify_kernel_event *kevent,
1272 ++ char __user *buf)
1273 ++{
1274 ++ size_t event_size = sizeof(struct inotify_event);
1275 ++
1276 ++ if (copy_to_user(buf, &kevent->event, event_size))
1277 ++ return -EFAULT;
1278 ++
1279 ++ if (kevent->name) {
1280 ++ buf += event_size;
1281 ++
1282 ++ if (copy_to_user(buf, kevent->name, kevent->event.len))
1283 ++ return -EFAULT;
1284 ++
1285 ++ event_size += kevent->event.len;
1286 ++ }
1287 ++ return event_size;
1288 ++}
1289 ++
1290 + static ssize_t inotify_read(struct file *file, char __user *buf,
1291 + size_t count, loff_t *pos)
1292 + {
1293 +- size_t event_size = sizeof (struct inotify_event);
1294 + struct inotify_device *dev;
1295 + char __user *start;
1296 + int ret;
1297 +@@ -440,81 +491,43 @@ static ssize_t inotify_read(struct file *file, char __user *buf,
1298 + dev = file->private_data;
1299 +
1300 + while (1) {
1301 ++ struct inotify_kernel_event *kevent;
1302 +
1303 + prepare_to_wait(&dev->wq, &wait, TASK_INTERRUPTIBLE);
1304 +
1305 + mutex_lock(&dev->ev_mutex);
1306 +- if (!list_empty(&dev->events)) {
1307 +- ret = 0;
1308 +- break;
1309 +- }
1310 ++ kevent = get_one_event(dev, count);
1311 + mutex_unlock(&dev->ev_mutex);
1312 +
1313 +- if (file->f_flags & O_NONBLOCK) {
1314 +- ret = -EAGAIN;
1315 +- break;
1316 +- }
1317 +-
1318 +- if (signal_pending(current)) {
1319 +- ret = -EINTR;
1320 +- break;
1321 ++ if (kevent) {
1322 ++ ret = PTR_ERR(kevent);
1323 ++ if (IS_ERR(kevent))
1324 ++ break;
1325 ++ ret = copy_event_to_user(kevent, buf);
1326 ++ free_kevent(kevent);
1327 ++ if (ret < 0)
1328 ++ break;
1329 ++ buf += ret;
1330 ++ count -= ret;
1331 ++ continue;
1332 + }
1333 +
1334 +- schedule();
1335 +- }
1336 +-
1337 +- finish_wait(&dev->wq, &wait);
1338 +- if (ret)
1339 +- return ret;
1340 +-
1341 +- while (1) {
1342 +- struct inotify_kernel_event *kevent;
1343 +-
1344 +- ret = buf - start;
1345 +- if (list_empty(&dev->events))
1346 ++ ret = -EAGAIN;
1347 ++ if (file->f_flags & O_NONBLOCK)
1348 + break;
1349 +-
1350 +- kevent = inotify_dev_get_event(dev);
1351 +- if (event_size + kevent->event.len > count) {
1352 +- if (ret == 0 && count > 0) {
1353 +- /*
1354 +- * could not get a single event because we
1355 +- * didn't have enough buffer space.
1356 +- */
1357 +- ret = -EINVAL;
1358 +- }
1359 ++ ret = -EINTR;
1360 ++ if (signal_pending(current))
1361 + break;
1362 +- }
1363 +- remove_kevent(dev, kevent);
1364 +
1365 +- /*
1366 +- * Must perform the copy_to_user outside the mutex in order
1367 +- * to avoid a lock order reversal with mmap_sem.
1368 +- */
1369 +- mutex_unlock(&dev->ev_mutex);
1370 +-
1371 +- if (copy_to_user(buf, &kevent->event, event_size)) {
1372 +- ret = -EFAULT;
1373 ++ if (start != buf)
1374 + break;
1375 +- }
1376 +- buf += event_size;
1377 +- count -= event_size;
1378 +-
1379 +- if (kevent->name) {
1380 +- if (copy_to_user(buf, kevent->name, kevent->event.len)){
1381 +- ret = -EFAULT;
1382 +- break;
1383 +- }
1384 +- buf += kevent->event.len;
1385 +- count -= kevent->event.len;
1386 +- }
1387 +-
1388 +- free_kevent(kevent);
1389 +
1390 +- mutex_lock(&dev->ev_mutex);
1391 ++ schedule();
1392 + }
1393 +- mutex_unlock(&dev->ev_mutex);
1394 +
1395 ++ finish_wait(&dev->wq, &wait);
1396 ++ if (start != buf && ret != -EFAULT)
1397 ++ ret = buf - start;
1398 + return ret;
1399 + }
1400 +
1401 +diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c
1402 +index 66f6e58..f2c478c 100644
1403 +--- a/fs/sysfs/bin.c
1404 ++++ b/fs/sysfs/bin.c
1405 +@@ -63,6 +63,9 @@ read(struct file *file, char __user *userbuf, size_t bytes, loff_t *off)
1406 + int count = min_t(size_t, bytes, PAGE_SIZE);
1407 + char *temp;
1408 +
1409 ++ if (!bytes)
1410 ++ return 0;
1411 ++
1412 + if (size) {
1413 + if (offs > size)
1414 + return 0;
1415 +@@ -131,6 +134,9 @@ static ssize_t write(struct file *file, const char __user *userbuf,
1416 + int count = min_t(size_t, bytes, PAGE_SIZE);
1417 + char *temp;
1418 +
1419 ++ if (!bytes)
1420 ++ return 0;
1421 ++
1422 + if (size) {
1423 + if (offs > size)
1424 + return 0;
1425 +diff --git a/include/linux/Kbuild b/include/linux/Kbuild
1426 +index e531783..3a025d9 100644
1427 +--- a/include/linux/Kbuild
1428 ++++ b/include/linux/Kbuild
1429 +@@ -41,6 +41,7 @@ header-y += baycom.h
1430 + header-y += bfs_fs.h
1431 + header-y += blkpg.h
1432 + header-y += bpqether.h
1433 ++header-y += bsg.h
1434 + header-y += can.h
1435 + header-y += cdk.h
1436 + header-y += chio.h
1437 +diff --git a/include/linux/klist.h b/include/linux/klist.h
1438 +index 8ea98db..a21cd7a 100644
1439 +--- a/include/linux/klist.h
1440 ++++ b/include/linux/klist.h
1441 +@@ -23,7 +23,7 @@ struct klist {
1442 + struct list_head k_list;
1443 + void (*get)(struct klist_node *);
1444 + void (*put)(struct klist_node *);
1445 +-};
1446 ++} __attribute__ ((aligned (4)));
1447 +
1448 + #define KLIST_INIT(_name, _get, _put) \
1449 + { .k_lock = __SPIN_LOCK_UNLOCKED(_name.k_lock), \
1450 +diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
1451 +index 1800f1d..52df0cb 100644
1452 +--- a/include/linux/pci_ids.h
1453 ++++ b/include/linux/pci_ids.h
1454 +@@ -1357,6 +1357,7 @@
1455 + #define PCI_DEVICE_ID_VIA_8783_0 0x3208
1456 + #define PCI_DEVICE_ID_VIA_8237 0x3227
1457 + #define PCI_DEVICE_ID_VIA_8251 0x3287
1458 ++#define PCI_DEVICE_ID_VIA_8261 0x3402
1459 + #define PCI_DEVICE_ID_VIA_8237A 0x3337
1460 + #define PCI_DEVICE_ID_VIA_8237S 0x3372
1461 + #define PCI_DEVICE_ID_VIA_SATA_EIDE 0x5324
1462 +@@ -1366,10 +1367,13 @@
1463 + #define PCI_DEVICE_ID_VIA_CX700 0x8324
1464 + #define PCI_DEVICE_ID_VIA_CX700_IDE 0x0581
1465 + #define PCI_DEVICE_ID_VIA_VX800 0x8353
1466 ++#define PCI_DEVICE_ID_VIA_VX855 0x8409
1467 + #define PCI_DEVICE_ID_VIA_8371_1 0x8391
1468 + #define PCI_DEVICE_ID_VIA_82C598_1 0x8598
1469 + #define PCI_DEVICE_ID_VIA_838X_1 0xB188
1470 + #define PCI_DEVICE_ID_VIA_83_87XX_1 0xB198
1471 ++#define PCI_DEVICE_ID_VIA_C409_IDE 0XC409
1472 ++#define PCI_DEVICE_ID_VIA_ANON 0xFFFF
1473 +
1474 + #define PCI_VENDOR_ID_SIEMENS 0x110A
1475 + #define PCI_DEVICE_ID_SIEMENS_DSCC4 0x2102
1476 +@@ -1795,6 +1799,7 @@
1477 + #define PCI_DEVICE_ID_SEALEVEL_UCOMM232 0x7202
1478 + #define PCI_DEVICE_ID_SEALEVEL_COMM4 0x7401
1479 + #define PCI_DEVICE_ID_SEALEVEL_COMM8 0x7801
1480 ++#define PCI_DEVICE_ID_SEALEVEL_7803 0x7803
1481 + #define PCI_DEVICE_ID_SEALEVEL_UCOMM8 0x7804
1482 +
1483 + #define PCI_VENDOR_ID_HYPERCOPE 0x1365
1484 +@@ -2171,6 +2176,7 @@
1485 + #define PCI_DEVICE_ID_RDC_R6040 0x6040
1486 + #define PCI_DEVICE_ID_RDC_R6060 0x6060
1487 + #define PCI_DEVICE_ID_RDC_R6061 0x6061
1488 ++#define PCI_DEVICE_ID_RDC_D1010 0x1010
1489 +
1490 + #define PCI_VENDOR_ID_LENOVO 0x17aa
1491 +
1492 +diff --git a/include/linux/sched.h b/include/linux/sched.h
1493 +index 55e30d1..3883c32 100644
1494 +--- a/include/linux/sched.h
1495 ++++ b/include/linux/sched.h
1496 +@@ -631,7 +631,6 @@ struct user_struct {
1497 + atomic_t inotify_devs; /* How many inotify devs does this user have opened? */
1498 + #endif
1499 + #ifdef CONFIG_EPOLL
1500 +- atomic_t epoll_devs; /* The number of epoll descriptors currently open */
1501 + atomic_t epoll_watches; /* The number of file descriptors currently watched */
1502 + #endif
1503 + #ifdef CONFIG_POSIX_MQUEUE
1504 +diff --git a/kernel/relay.c b/kernel/relay.c
1505 +index 09ac200..9d79b78 100644
1506 +--- a/kernel/relay.c
1507 ++++ b/kernel/relay.c
1508 +@@ -663,8 +663,10 @@ int relay_late_setup_files(struct rchan *chan,
1509 +
1510 + mutex_lock(&relay_channels_mutex);
1511 + /* Is chan already set up? */
1512 +- if (unlikely(chan->has_base_filename))
1513 ++ if (unlikely(chan->has_base_filename)) {
1514 ++ mutex_unlock(&relay_channels_mutex);
1515 + return -EEXIST;
1516 ++ }
1517 + chan->has_base_filename = 1;
1518 + chan->parent = parent;
1519 + curr_cpu = get_cpu();
1520 +diff --git a/kernel/resource.c b/kernel/resource.c
1521 +index 4337063..e633106 100644
1522 +--- a/kernel/resource.c
1523 ++++ b/kernel/resource.c
1524 +@@ -853,6 +853,15 @@ int iomem_map_sanity_check(resource_size_t addr, unsigned long size)
1525 + if (PFN_DOWN(p->start) <= PFN_DOWN(addr) &&
1526 + PFN_DOWN(p->end) >= PFN_DOWN(addr + size - 1))
1527 + continue;
1528 ++ /*
1529 ++ * if a resource is "BUSY", it's not a hardware resource
1530 ++ * but a driver mapping of such a resource; we don't want
1531 ++ * to warn for those; some drivers legitimately map only
1532 ++ * partial hardware resources. (example: vesafb)
1533 ++ */
1534 ++ if (p->flags & IORESOURCE_BUSY)
1535 ++ continue;
1536 ++
1537 + printk(KERN_WARNING "resource map sanity check conflict: "
1538 + "0x%llx 0x%llx 0x%llx 0x%llx %s\n",
1539 + (unsigned long long)addr,
1540 +diff --git a/mm/mmap.c b/mm/mmap.c
1541 +index 937b44f..9c3f4f8 100644
1542 +--- a/mm/mmap.c
1543 ++++ b/mm/mmap.c
1544 +@@ -1095,6 +1095,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
1545 + {
1546 + struct mm_struct *mm = current->mm;
1547 + struct vm_area_struct *vma, *prev;
1548 ++ struct vm_area_struct *merged_vma;
1549 + int correct_wcount = 0;
1550 + int error;
1551 + struct rb_node **rb_link, *rb_parent;
1552 +@@ -1207,13 +1208,17 @@ munmap_back:
1553 + if (vma_wants_writenotify(vma))
1554 + vma->vm_page_prot = vm_get_page_prot(vm_flags & ~VM_SHARED);
1555 +
1556 +- if (file && vma_merge(mm, prev, addr, vma->vm_end,
1557 +- vma->vm_flags, NULL, file, pgoff, vma_policy(vma))) {
1558 ++ merged_vma = NULL;
1559 ++ if (file)
1560 ++ merged_vma = vma_merge(mm, prev, addr, vma->vm_end,
1561 ++ vma->vm_flags, NULL, file, pgoff, vma_policy(vma));
1562 ++ if (merged_vma) {
1563 + mpol_put(vma_policy(vma));
1564 + kmem_cache_free(vm_area_cachep, vma);
1565 + fput(file);
1566 + if (vm_flags & VM_EXECUTABLE)
1567 + removed_exe_file_vma(mm);
1568 ++ vma = merged_vma;
1569 + } else {
1570 + vma_link(mm, vma, prev, rb_link, rb_parent);
1571 + file = vma->vm_file;
1572 +diff --git a/mm/vmalloc.c b/mm/vmalloc.c
1573 +index 7465f22..0380ea5 100644
1574 +--- a/mm/vmalloc.c
1575 ++++ b/mm/vmalloc.c
1576 +@@ -23,6 +23,7 @@
1577 + #include <linux/rbtree.h>
1578 + #include <linux/radix-tree.h>
1579 + #include <linux/rcupdate.h>
1580 ++#include <linux/bootmem.h>
1581 +
1582 + #include <asm/atomic.h>
1583 + #include <asm/uaccess.h>
1584 +@@ -960,6 +961,8 @@ EXPORT_SYMBOL(vm_map_ram);
1585 +
1586 + void __init vmalloc_init(void)
1587 + {
1588 ++ struct vmap_area *va;
1589 ++ struct vm_struct *tmp;
1590 + int i;
1591 +
1592 + for_each_possible_cpu(i) {
1593 +@@ -972,6 +975,14 @@ void __init vmalloc_init(void)
1594 + vbq->nr_dirty = 0;
1595 + }
1596 +
1597 ++ /* Import existing vmlist entries. */
1598 ++ for (tmp = vmlist; tmp; tmp = tmp->next) {
1599 ++ va = alloc_bootmem(sizeof(struct vmap_area));
1600 ++ va->flags = tmp->flags | VM_VM_AREA;
1601 ++ va->va_start = (unsigned long)tmp->addr;
1602 ++ va->va_end = va->va_start + tmp->size;
1603 ++ __insert_vmap_area(va);
1604 ++ }
1605 + vmap_initialized = true;
1606 + }
1607 +
1608 +diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
1609 +index 1895a4c..0bc398c 100644
1610 +--- a/net/core/net_namespace.c
1611 ++++ b/net/core/net_namespace.c
1612 +@@ -342,8 +342,8 @@ again:
1613 + rv = register_pernet_operations(first_device, ops);
1614 + if (rv < 0)
1615 + ida_remove(&net_generic_ids, *id);
1616 +- mutex_unlock(&net_mutex);
1617 + out:
1618 ++ mutex_unlock(&net_mutex);
1619 + return rv;
1620 + }
1621 + EXPORT_SYMBOL_GPL(register_pernet_gen_subsys);
1622 +diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
1623 +index 1460537..077be80 100644
1624 +--- a/net/mac80211/tx.c
1625 ++++ b/net/mac80211/tx.c
1626 +@@ -1299,8 +1299,10 @@ int ieee80211_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
1627 + if (is_multicast_ether_addr(hdr->addr3))
1628 + memcpy(hdr->addr1, hdr->addr3, ETH_ALEN);
1629 + else
1630 +- if (mesh_nexthop_lookup(skb, osdata))
1631 +- return 0;
1632 ++ if (mesh_nexthop_lookup(skb, osdata)) {
1633 ++ dev_put(odev);
1634 ++ return 0;
1635 ++ }
1636 + if (memcmp(odev->dev_addr, hdr->addr4, ETH_ALEN) != 0)
1637 + IEEE80211_IFSTA_MESH_CTR_INC(&osdata->u.mesh,
1638 + fwded_frames);
1639 +diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
1640 +index 7c1eb23..a50089f 100644
1641 +--- a/sound/pci/hda/patch_conexant.c
1642 ++++ b/sound/pci/hda/patch_conexant.c
1643 +@@ -1470,6 +1470,7 @@ static struct snd_pci_quirk cxt5047_cfg_tbl[] = {
1644 + SND_PCI_QUIRK(0x103c, 0x30a5, "HP DV5200T/DV8000T", CXT5047_LAPTOP_HP),
1645 + SND_PCI_QUIRK(0x103c, 0x30b2, "HP DV2000T/DV3000T", CXT5047_LAPTOP),
1646 + SND_PCI_QUIRK(0x103c, 0x30b5, "HP DV2000Z", CXT5047_LAPTOP),
1647 ++ SND_PCI_QUIRK(0x103c, 0x30cf, "HP DV6700", CXT5047_LAPTOP),
1648 + SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba P100", CXT5047_LAPTOP_EAPD),
1649 + {}
1650 + };
1651 +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
1652 +index befb699..75101d8 100644
1653 +--- a/sound/pci/hda/patch_realtek.c
1654 ++++ b/sound/pci/hda/patch_realtek.c
1655 +@@ -6780,6 +6780,7 @@ static int patch_alc882(struct hda_codec *codec)
1656 + case 0x106b00a4: /* MacbookPro4,1 */
1657 + case 0x106b2c00: /* Macbook Pro rev3 */
1658 + case 0x106b3600: /* Macbook 3.1 */
1659 ++ case 0x106b3800: /* MacbookPro4,1 - latter revision */
1660 + board_config = ALC885_MBP3;
1661 + break;
1662 + default:
1663 +diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
1664 +index 8b204b8..1f9fcfe 100644
1665 +--- a/sound/pci/hda/patch_sigmatel.c
1666 ++++ b/sound/pci/hda/patch_sigmatel.c
1667 +@@ -2428,6 +2428,8 @@ static int stac92xx_build_pcms(struct hda_codec *codec)
1668 +
1669 + info->name = "STAC92xx Analog";
1670 + info->stream[SNDRV_PCM_STREAM_PLAYBACK] = stac92xx_pcm_analog_playback;
1671 ++ info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid =
1672 ++ spec->multiout.dac_nids[0];
1673 + info->stream[SNDRV_PCM_STREAM_CAPTURE] = stac92xx_pcm_analog_capture;
1674 + info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->adc_nids[0];
1675 + info->stream[SNDRV_PCM_STREAM_CAPTURE].substreams = spec->num_adcs;
1676 +diff --git a/sound/pci/oxygen/virtuoso.c b/sound/pci/oxygen/virtuoso.c
1677 +index e9e829e..a962166 100644
1678 +--- a/sound/pci/oxygen/virtuoso.c
1679 ++++ b/sound/pci/oxygen/virtuoso.c
1680 +@@ -908,6 +908,7 @@ static const struct oxygen_model model_xonar_hdav = {
1681 + .dac_channels = 8,
1682 + .dac_volume_min = 0x0f,
1683 + .dac_volume_max = 0xff,
1684 ++ .misc_flags = OXYGEN_MISC_MIDI,
1685 + .function_flags = OXYGEN_FUNCTION_2WIRE,
1686 + .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
1687 + .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
1688
1689 Deleted: genpatches-2.6/trunk/2.6.28/1725_alpha-srm-compile-failure.patch
1690 ===================================================================
1691 --- genpatches-2.6/trunk/2.6.28/1725_alpha-srm-compile-failure.patch 2009-02-02 20:13:48 UTC (rev 1491)
1692 +++ genpatches-2.6/trunk/2.6.28/1725_alpha-srm-compile-failure.patch 2009-02-02 20:17:50 UTC (rev 1492)
1693 @@ -1,38 +0,0 @@
1694 -From: Ivan Kokshaysky <ink@×××××××××××××××××.ru>
1695 -Date: Thu, 15 Jan 2009 21:51:17 +0000 (-0800)
1696 -Subject: alpha: nautilus - fix compile failure with gcc-4.3
1697 -X-Git-Tag: v2.6.29-rc2~27
1698 -X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=70b66cbfd3316b792a855cb9a2574e85f1a63d0f
1699 -
1700 -alpha: nautilus - fix compile failure with gcc-4.3
1701 -
1702 -init_srm_irq() deals with irq's #16 and above, but size of irq_desc
1703 -array on nautilus and some other system types is 16. So gcc-4.3
1704 -complains that "array subscript is above array bounds", even though
1705 -this function is never called on those systems.
1706 -
1707 -This adds a check for NR_IRQS <= 16, which effectively optimizes
1708 -init_srm_irq() code away on problematic platforms.
1709 -
1710 -Thanks to Daniel Drake <dsd@g.o> for detailed analysis
1711 -of the problem.
1712 -
1713 -Signed-off-by: Ivan Kokshaysky <ink@×××××××××××××××××.ru>
1714 -Cc: Richard Henderson <rth@×××××××.net>
1715 -Signed-off-by: Andrew Morton <akpm@××××××××××××××××.org>
1716 -Signed-off-by: Linus Torvalds <torvalds@××××××××××××××××.org>
1717 ----
1718 -
1719 -diff --git a/arch/alpha/kernel/irq_srm.c b/arch/alpha/kernel/irq_srm.c
1720 -index 3221201..a03fbca 100644
1721 ---- a/arch/alpha/kernel/irq_srm.c
1722 -+++ b/arch/alpha/kernel/irq_srm.c
1723 -@@ -63,6 +63,8 @@ init_srm_irqs(long max, unsigned long ignore_mask)
1724 - {
1725 - long i;
1726 -
1727 -+ if (NR_IRQS <= 16)
1728 -+ return;
1729 - for (i = 16; i < max; ++i) {
1730 - if (i < 64 && ((ignore_mask >> i) & 1))
1731 - continue;