/[linux-patches]/genpatches-2.6/trunk/2.6.16/1021_linux-2.6.16.22.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.16/1021_linux-2.6.16.22.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 503 - (show annotations) (download) (as text)
Tue Jun 27 14:24:44 2006 UTC (14 years, 4 months ago) by dsd
File MIME type: text/x-diff
File size: 22133 byte(s)
Linux 2.6.16.22
1 diff --git a/arch/sparc64/kernel/pci_iommu.c b/arch/sparc64/kernel/pci_iommu.c
2 index a11910b..f63f065 100644
3 --- a/arch/sparc64/kernel/pci_iommu.c
4 +++ b/arch/sparc64/kernel/pci_iommu.c
5 @@ -219,7 +219,7 @@ static inline void iommu_free_ctx(struct
6 * DMA for PCI device PDEV. Return non-NULL cpu-side address if
7 * successful and set *DMA_ADDRP to the PCI side dma address.
8 */
9 -void *pci_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp)
10 +void *__pci_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp, gfp_t gfp)
11 {
12 struct pcidev_cookie *pcp;
13 struct pci_iommu *iommu;
14 @@ -233,7 +233,7 @@ void *pci_alloc_consistent(struct pci_de
15 if (order >= 10)
16 return NULL;
17
18 - first_page = __get_free_pages(GFP_ATOMIC, order);
19 + first_page = __get_free_pages(gfp, order);
20 if (first_page == 0UL)
21 return NULL;
22 memset((char *)first_page, 0, PAGE_SIZE << order);
23 diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
24 index 3c06bfb..a6fe4f3 100644
25 --- a/arch/sparc64/kernel/sparc64_ksyms.c
26 +++ b/arch/sparc64/kernel/sparc64_ksyms.c
27 @@ -221,7 +221,7 @@ #ifdef CONFIG_PCI
28 EXPORT_SYMBOL(ebus_chain);
29 EXPORT_SYMBOL(isa_chain);
30 EXPORT_SYMBOL(pci_memspace_mask);
31 -EXPORT_SYMBOL(pci_alloc_consistent);
32 +EXPORT_SYMBOL(__pci_alloc_consistent);
33 EXPORT_SYMBOL(pci_free_consistent);
34 EXPORT_SYMBOL(pci_map_single);
35 EXPORT_SYMBOL(pci_unmap_single);
36 diff --git a/arch/sparc64/lib/checksum.S b/arch/sparc64/lib/checksum.S
37 index ba9cd3c..1d230f6 100644
38 --- a/arch/sparc64/lib/checksum.S
39 +++ b/arch/sparc64/lib/checksum.S
40 @@ -165,8 +165,9 @@ csum_partial_end_cruft:
41 sll %g1, 8, %g1
42 or %o5, %g1, %o4
43
44 -1: add %o2, %o4, %o2
45 +1: addcc %o2, %o4, %o2
46 + addc %g0, %o2, %o2
47
48 csum_partial_finish:
49 retl
50 - mov %o2, %o0
51 + srl %o2, 0, %o0
52 diff --git a/arch/sparc64/lib/csum_copy.S b/arch/sparc64/lib/csum_copy.S
53 index 71af488..e566c77 100644
54 --- a/arch/sparc64/lib/csum_copy.S
55 +++ b/arch/sparc64/lib/csum_copy.S
56 @@ -221,11 +221,12 @@ FUNC_NAME: /* %o0=src, %o1=dst, %o2=len
57 sll %g1, 8, %g1
58 or %o5, %g1, %o4
59
60 -1: add %o3, %o4, %o3
61 +1: addcc %o3, %o4, %o3
62 + addc %g0, %o3, %o3
63
64 70:
65 retl
66 - mov %o3, %o0
67 + srl %o3, 0, %o0
68
69 95: mov 0, GLOBAL_SPARE
70 brlez,pn %o2, 4f
71 diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
72 index abbdb37..f36db22 100644
73 --- a/drivers/acpi/processor_perflib.c
74 +++ b/drivers/acpi/processor_perflib.c
75 @@ -577,6 +577,8 @@ acpi_processor_register_performance(stru
76 return_VALUE(-EBUSY);
77 }
78
79 + WARN_ON(!performance);
80 +
81 pr->performance = performance;
82
83 if (acpi_processor_get_performance_info(pr)) {
84 @@ -609,7 +611,8 @@ acpi_processor_unregister_performance(st
85 return_VOID;
86 }
87
88 - kfree(pr->performance->states);
89 + if (pr->performance)
90 + kfree(pr->performance->states);
91 pr->performance = NULL;
92
93 acpi_cpufreq_remove_file(pr);
94 diff --git a/drivers/message/i2o/exec-osm.c b/drivers/message/i2o/exec-osm.c
95 index 9bb9859..04e0357 100644
96 --- a/drivers/message/i2o/exec-osm.c
97 +++ b/drivers/message/i2o/exec-osm.c
98 @@ -55,6 +55,7 @@ struct i2o_exec_wait {
99 u32 m; /* message id */
100 struct i2o_message *msg; /* pointer to the reply message */
101 struct list_head list; /* node in global wait list */
102 + spinlock_t lock; /* lock before modifying */
103 };
104
105 /* Exec OSM class handling definition */
106 @@ -80,6 +81,7 @@ static struct i2o_exec_wait *i2o_exec_wa
107 return NULL;
108
109 INIT_LIST_HEAD(&wait->list);
110 + spin_lock_init(&wait->lock);
111
112 return wait;
113 };
114 @@ -118,6 +120,7 @@ int i2o_msg_post_wait_mem(struct i2o_con
115 DECLARE_WAIT_QUEUE_HEAD(wq);
116 struct i2o_exec_wait *wait;
117 static u32 tcntxt = 0x80000000;
118 + long flags;
119 int rc = 0;
120
121 wait = i2o_exec_wait_alloc();
122 @@ -139,33 +142,28 @@ int i2o_msg_post_wait_mem(struct i2o_con
123 wait->tcntxt = tcntxt++;
124 msg->u.s.tcntxt = cpu_to_le32(wait->tcntxt);
125
126 + wait->wq = &wq;
127 + /*
128 + * we add elements to the head, because if a entry in the list will
129 + * never be removed, we have to iterate over it every time
130 + */
131 + list_add(&wait->list, &i2o_exec_wait_list);
132 +
133 /*
134 * Post the message to the controller. At some point later it will
135 * return. If we time out before it returns then complete will be zero.
136 */
137 i2o_msg_post(c, msg);
138
139 - if (!wait->complete) {
140 - wait->wq = &wq;
141 - /*
142 - * we add elements add the head, because if a entry in the list
143 - * will never be removed, we have to iterate over it every time
144 - */
145 - list_add(&wait->list, &i2o_exec_wait_list);
146 -
147 - wait_event_interruptible_timeout(wq, wait->complete,
148 - timeout * HZ);
149 + wait_event_interruptible_timeout(wq, wait->complete, timeout * HZ);
150
151 - wait->wq = NULL;
152 - }
153 + spin_lock_irqsave(&wait->lock, flags);
154
155 - barrier();
156 + wait->wq = NULL;
157
158 - if (wait->complete) {
159 + if (wait->complete)
160 rc = le32_to_cpu(wait->msg->body[0]) >> 24;
161 - i2o_flush_reply(c, wait->m);
162 - i2o_exec_wait_free(wait);
163 - } else {
164 + else {
165 /*
166 * We cannot remove it now. This is important. When it does
167 * terminate (which it must do if the controller has not
168 @@ -179,6 +177,13 @@ int i2o_msg_post_wait_mem(struct i2o_con
169 rc = -ETIMEDOUT;
170 }
171
172 + spin_unlock_irqrestore(&wait->lock, flags);
173 +
174 + if (rc != -ETIMEDOUT) {
175 + i2o_flush_reply(c, wait->m);
176 + i2o_exec_wait_free(wait);
177 + }
178 +
179 return rc;
180 };
181
182 @@ -206,7 +211,6 @@ static int i2o_msg_post_wait_complete(st
183 {
184 struct i2o_exec_wait *wait, *tmp;
185 unsigned long flags;
186 - static spinlock_t lock = SPIN_LOCK_UNLOCKED;
187 int rc = 1;
188
189 /*
190 @@ -216,23 +220,24 @@ static int i2o_msg_post_wait_complete(st
191 * already expired. Not much we can do about that except log it for
192 * debug purposes, increase timeout, and recompile.
193 */
194 - spin_lock_irqsave(&lock, flags);
195 list_for_each_entry_safe(wait, tmp, &i2o_exec_wait_list, list) {
196 if (wait->tcntxt == context) {
197 - list_del(&wait->list);
198 + spin_lock_irqsave(&wait->lock, flags);
199
200 - spin_unlock_irqrestore(&lock, flags);
201 + list_del(&wait->list);
202
203 wait->m = m;
204 wait->msg = msg;
205 wait->complete = 1;
206
207 - barrier();
208 -
209 - if (wait->wq) {
210 - wake_up_interruptible(wait->wq);
211 + if (wait->wq)
212 rc = 0;
213 - } else {
214 + else
215 + rc = -1;
216 +
217 + spin_unlock_irqrestore(&wait->lock, flags);
218 +
219 + if (rc) {
220 struct device *dev;
221
222 dev = &c->pdev->dev;
223 @@ -241,15 +246,13 @@ static int i2o_msg_post_wait_complete(st
224 c->name);
225 i2o_dma_free(dev, &wait->dma);
226 i2o_exec_wait_free(wait);
227 - rc = -1;
228 - }
229 + } else
230 + wake_up_interruptible(wait->wq);
231
232 return rc;
233 }
234 }
235
236 - spin_unlock_irqrestore(&lock, flags);
237 -
238 osm_warn("%s: Bogus reply in POST WAIT (tr-context: %08x)!\n", c->name,
239 context);
240
241 @@ -315,14 +318,9 @@ static DEVICE_ATTR(product_id, S_IRUGO,
242 static int i2o_exec_probe(struct device *dev)
243 {
244 struct i2o_device *i2o_dev = to_i2o_device(dev);
245 - struct i2o_controller *c = i2o_dev->iop;
246
247 i2o_event_register(i2o_dev, &i2o_exec_driver, 0, 0xffffffff);
248
249 - c->exec = i2o_dev;
250 -
251 - i2o_exec_lct_notify(c, c->lct->change_ind + 1);
252 -
253 device_create_file(dev, &dev_attr_vendor_id);
254 device_create_file(dev, &dev_attr_product_id);
255
256 @@ -510,6 +508,8 @@ static int i2o_exec_lct_notify(struct i2
257 struct device *dev;
258 struct i2o_message *msg;
259
260 + down(&c->lct_lock);
261 +
262 dev = &c->pdev->dev;
263
264 if (i2o_dma_realloc
265 @@ -532,6 +532,8 @@ static int i2o_exec_lct_notify(struct i2
266
267 i2o_msg_post(c, msg);
268
269 + up(&c->lct_lock);
270 +
271 return 0;
272 };
273
274 diff --git a/drivers/message/i2o/iop.c b/drivers/message/i2o/iop.c
275 index 4921674..febbdd4 100644
276 --- a/drivers/message/i2o/iop.c
277 +++ b/drivers/message/i2o/iop.c
278 @@ -804,8 +804,6 @@ void i2o_iop_remove(struct i2o_controlle
279
280 /* Ask the IOP to switch to RESET state */
281 i2o_iop_reset(c);
282 -
283 - put_device(&c->device);
284 }
285
286 /**
287 @@ -1059,7 +1057,7 @@ struct i2o_controller *i2o_iop_alloc(voi
288
289 snprintf(poolname, sizeof(poolname), "i2o_%s_msg_inpool", c->name);
290 if (i2o_pool_alloc
291 - (&c->in_msg, poolname, I2O_INBOUND_MSG_FRAME_SIZE * 4,
292 + (&c->in_msg, poolname, I2O_INBOUND_MSG_FRAME_SIZE * 4 + sizeof(u32),
293 I2O_MSG_INPOOL_MIN)) {
294 kfree(c);
295 return ERR_PTR(-ENOMEM);
296 diff --git a/drivers/parport/Kconfig b/drivers/parport/Kconfig
297 index f63c387..6c8452e 100644
298 --- a/drivers/parport/Kconfig
299 +++ b/drivers/parport/Kconfig
300 @@ -48,7 +48,7 @@ config PARPORT_PC
301
302 config PARPORT_SERIAL
303 tristate "Multi-IO cards (parallel and serial)"
304 - depends on SERIAL_8250 && PARPORT_PC && PCI
305 + depends on SERIAL_8250_PCI && PARPORT_PC && PCI
306 help
307 This adds support for multi-IO PCI cards that have parallel and
308 serial ports. You should say Y or M here. If you say M, the module
309 diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
310 index 701a328..a0cd6de 100644
311 --- a/drivers/scsi/scsi_lib.c
312 +++ b/drivers/scsi/scsi_lib.c
313 @@ -368,7 +368,7 @@ static int scsi_req_map_sg(struct reques
314 int nsegs, unsigned bufflen, gfp_t gfp)
315 {
316 struct request_queue *q = rq->q;
317 - int nr_pages = (bufflen + PAGE_SIZE - 1) >> PAGE_SHIFT;
318 + int nr_pages = (bufflen + sgl[0].offset + PAGE_SIZE - 1) >> PAGE_SHIFT;
319 unsigned int data_len = 0, len, bytes, off;
320 struct page *page;
321 struct bio *bio = NULL;
322 diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
323 index 557411c..f494b67 100644
324 --- a/drivers/usb/serial/whiteheat.c
325 +++ b/drivers/usb/serial/whiteheat.c
326 @@ -388,7 +388,7 @@ static int whiteheat_attach (struct usb_
327 if (ret) {
328 err("%s: Couldn't send command [%d]", serial->type->description, ret);
329 goto no_firmware;
330 - } else if (alen != sizeof(command)) {
331 + } else if (alen != 2) {
332 err("%s: Send command incomplete [%d]", serial->type->description, alen);
333 goto no_firmware;
334 }
335 @@ -400,7 +400,7 @@ static int whiteheat_attach (struct usb_
336 if (ret) {
337 err("%s: Couldn't get results [%d]", serial->type->description, ret);
338 goto no_firmware;
339 - } else if (alen != sizeof(result)) {
340 + } else if (alen != sizeof(*hw_info) + 1) {
341 err("%s: Get results incomplete [%d]", serial->type->description, alen);
342 goto no_firmware;
343 } else if (result[0] != command[0]) {
344 diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c
345 index 8a53981..c82d076 100644
346 --- a/fs/jfs/jfs_metapage.c
347 +++ b/fs/jfs/jfs_metapage.c
348 @@ -543,7 +543,7 @@ add_failed:
349 static int metapage_releasepage(struct page *page, gfp_t gfp_mask)
350 {
351 struct metapage *mp;
352 - int busy = 0;
353 + int ret = 1;
354 unsigned int offset;
355
356 for (offset = 0; offset < PAGE_CACHE_SIZE; offset += PSIZE) {
357 @@ -553,30 +553,20 @@ static int metapage_releasepage(struct p
358 continue;
359
360 jfs_info("metapage_releasepage: mp = 0x%p", mp);
361 - if (mp->count || mp->nohomeok) {
362 + if (mp->count || mp->nohomeok ||
363 + test_bit(META_dirty, &mp->flag)) {
364 jfs_info("count = %ld, nohomeok = %d", mp->count,
365 mp->nohomeok);
366 - busy = 1;
367 + ret = 0;
368 continue;
369 }
370 - wait_on_page_writeback(page);
371 - //WARN_ON(test_bit(META_dirty, &mp->flag));
372 - if (test_bit(META_dirty, &mp->flag)) {
373 - dump_mem("dirty mp in metapage_releasepage", mp,
374 - sizeof(struct metapage));
375 - dump_mem("page", page, sizeof(struct page));
376 - dump_stack();
377 - }
378 if (mp->lsn)
379 remove_from_logsync(mp);
380 remove_metapage(page, mp);
381 INCREMENT(mpStat.pagefree);
382 free_metapage(mp);
383 }
384 - if (busy)
385 - return -1;
386 -
387 - return 0;
388 + return ret;
389 }
390
391 static int metapage_invalidatepage(struct page *page, unsigned long offset)
392 diff --git a/fs/namei.c b/fs/namei.c
393 index 8dc2b03..f11c0aa 100644
394 --- a/fs/namei.c
395 +++ b/fs/namei.c
396 @@ -1077,8 +1077,8 @@ static int fastcall do_path_lookup(int d
397 nd->flags = flags;
398 nd->depth = 0;
399
400 - read_lock(&current->fs->lock);
401 if (*name=='/') {
402 + read_lock(&current->fs->lock);
403 if (current->fs->altroot && !(nd->flags & LOOKUP_NOALT)) {
404 nd->mnt = mntget(current->fs->altrootmnt);
405 nd->dentry = dget(current->fs->altroot);
406 @@ -1089,33 +1089,35 @@ static int fastcall do_path_lookup(int d
407 }
408 nd->mnt = mntget(current->fs->rootmnt);
409 nd->dentry = dget(current->fs->root);
410 + read_unlock(&current->fs->lock);
411 } else if (dfd == AT_FDCWD) {
412 + read_lock(&current->fs->lock);
413 nd->mnt = mntget(current->fs->pwdmnt);
414 nd->dentry = dget(current->fs->pwd);
415 + read_unlock(&current->fs->lock);
416 } else {
417 struct dentry *dentry;
418
419 file = fget_light(dfd, &fput_needed);
420 retval = -EBADF;
421 if (!file)
422 - goto unlock_fail;
423 + goto out_fail;
424
425 dentry = file->f_dentry;
426
427 retval = -ENOTDIR;
428 if (!S_ISDIR(dentry->d_inode->i_mode))
429 - goto fput_unlock_fail;
430 + goto fput_fail;
431
432 retval = file_permission(file, MAY_EXEC);
433 if (retval)
434 - goto fput_unlock_fail;
435 + goto fput_fail;
436
437 nd->mnt = mntget(file->f_vfsmnt);
438 nd->dentry = dget(dentry);
439
440 fput_light(file, fput_needed);
441 }
442 - read_unlock(&current->fs->lock);
443 current->total_link_count = 0;
444 retval = link_path_walk(name, nd);
445 out:
446 @@ -1124,13 +1126,12 @@ out:
447 nd->dentry->d_inode))
448 audit_inode(name, nd->dentry->d_inode, flags);
449 }
450 +out_fail:
451 return retval;
452
453 -fput_unlock_fail:
454 +fput_fail:
455 fput_light(file, fput_needed);
456 -unlock_fail:
457 - read_unlock(&current->fs->lock);
458 - return retval;
459 + goto out_fail;
460 }
461
462 int fastcall path_lookup(const char *name, unsigned int flags,
463 @@ -1628,6 +1629,12 @@ do_last:
464 goto exit;
465 }
466
467 + if (IS_ERR(nd->intent.open.file)) {
468 + mutex_unlock(&dir->d_inode->i_mutex);
469 + error = PTR_ERR(nd->intent.open.file);
470 + goto exit_dput;
471 + }
472 +
473 /* Negative dentry, just create the file */
474 if (!path.dentry->d_inode) {
475 if (!IS_POSIXACL(dir->d_inode))
476 diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c
477 index 5027d3d..89449d3 100644
478 --- a/fs/ntfs/file.c
479 +++ b/fs/ntfs/file.c
480 @@ -1489,14 +1489,15 @@ static inline void ntfs_flush_dcache_pag
481 unsigned nr_pages)
482 {
483 BUG_ON(!nr_pages);
484 + /*
485 + * Warning: Do not do the decrement at the same time as the call to
486 + * flush_dcache_page() because it is a NULL macro on i386 and hence the
487 + * decrement never happens so the loop never terminates.
488 + */
489 do {
490 - /*
491 - * Warning: Do not do the decrement at the same time as the
492 - * call because flush_dcache_page() is a NULL macro on i386
493 - * and hence the decrement never happens.
494 - */
495 + --nr_pages;
496 flush_dcache_page(pages[nr_pages]);
497 - } while (--nr_pages > 0);
498 + } while (nr_pages > 0);
499 }
500
501 /**
502 diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
503 index 358e4d3..c2059a3 100644
504 --- a/include/asm-generic/pgtable.h
505 +++ b/include/asm-generic/pgtable.h
506 @@ -159,17 +159,8 @@ #ifndef __HAVE_ARCH_LAZY_MMU_PROT_UPDATE
507 #define lazy_mmu_prot_update(pte) do { } while (0)
508 #endif
509
510 -#ifndef __HAVE_ARCH_MULTIPLE_ZERO_PAGE
511 +#ifndef __HAVE_ARCH_MOVE_PTE
512 #define move_pte(pte, prot, old_addr, new_addr) (pte)
513 -#else
514 -#define move_pte(pte, prot, old_addr, new_addr) \
515 -({ \
516 - pte_t newpte = (pte); \
517 - if (pte_present(pte) && pfn_valid(pte_pfn(pte)) && \
518 - pte_page(pte) == ZERO_PAGE(old_addr)) \
519 - newpte = mk_pte(ZERO_PAGE(new_addr), (prot)); \
520 - newpte; \
521 -})
522 #endif
523
524 /*
525 diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h
526 index 702a28f..69cebbd 100644
527 --- a/include/asm-mips/pgtable.h
528 +++ b/include/asm-mips/pgtable.h
529 @@ -70,7 +70,15 @@ extern unsigned long zero_page_mask;
530 #define ZERO_PAGE(vaddr) \
531 (virt_to_page(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask)))
532
533 -#define __HAVE_ARCH_MULTIPLE_ZERO_PAGE
534 +#define __HAVE_ARCH_MOVE_PTE
535 +#define move_pte(pte, prot, old_addr, new_addr) \
536 +({ \
537 + pte_t newpte = (pte); \
538 + if (pte_present(pte) && pfn_valid(pte_pfn(pte)) && \
539 + pte_page(pte) == ZERO_PAGE(old_addr)) \
540 + newpte = mk_pte(ZERO_PAGE(new_addr), (prot)); \
541 + newpte; \
542 +})
543
544 extern void paging_init(void);
545
546 diff --git a/include/asm-sparc64/dma-mapping.h b/include/asm-sparc64/dma-mapping.h
547 index c7d5804..a587fd7 100644
548 --- a/include/asm-sparc64/dma-mapping.h
549 +++ b/include/asm-sparc64/dma-mapping.h
550 @@ -4,7 +4,146 @@ #define _ASM_SPARC64_DMA_MAPPING_H
551 #include <linux/config.h>
552
553 #ifdef CONFIG_PCI
554 -#include <asm-generic/dma-mapping.h>
555 +
556 +/* we implement the API below in terms of the existing PCI one,
557 + * so include it */
558 +#include <linux/pci.h>
559 +/* need struct page definitions */
560 +#include <linux/mm.h>
561 +
562 +static inline int
563 +dma_supported(struct device *dev, u64 mask)
564 +{
565 + BUG_ON(dev->bus != &pci_bus_type);
566 +
567 + return pci_dma_supported(to_pci_dev(dev), mask);
568 +}
569 +
570 +static inline int
571 +dma_set_mask(struct device *dev, u64 dma_mask)
572 +{
573 + BUG_ON(dev->bus != &pci_bus_type);
574 +
575 + return pci_set_dma_mask(to_pci_dev(dev), dma_mask);
576 +}
577 +
578 +static inline void *
579 +dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
580 + gfp_t flag)
581 +{
582 + BUG_ON(dev->bus != &pci_bus_type);
583 +
584 + return __pci_alloc_consistent(to_pci_dev(dev), size, dma_handle, flag);
585 +}
586 +
587 +static inline void
588 +dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
589 + dma_addr_t dma_handle)
590 +{
591 + BUG_ON(dev->bus != &pci_bus_type);
592 +
593 + pci_free_consistent(to_pci_dev(dev), size, cpu_addr, dma_handle);
594 +}
595 +
596 +static inline dma_addr_t
597 +dma_map_single(struct device *dev, void *cpu_addr, size_t size,
598 + enum dma_data_direction direction)
599 +{
600 + BUG_ON(dev->bus != &pci_bus_type);
601 +
602 + return pci_map_single(to_pci_dev(dev), cpu_addr, size, (int)direction);
603 +}
604 +
605 +static inline void
606 +dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
607 + enum dma_data_direction direction)
608 +{
609 + BUG_ON(dev->bus != &pci_bus_type);
610 +
611 + pci_unmap_single(to_pci_dev(dev), dma_addr, size, (int)direction);
612 +}
613 +
614 +static inline dma_addr_t
615 +dma_map_page(struct device *dev, struct page *page,
616 + unsigned long offset, size_t size,
617 + enum dma_data_direction direction)
618 +{
619 + BUG_ON(dev->bus != &pci_bus_type);
620 +
621 + return pci_map_page(to_pci_dev(dev), page, offset, size, (int)direction);
622 +}
623 +
624 +static inline void
625 +dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
626 + enum dma_data_direction direction)
627 +{
628 + BUG_ON(dev->bus != &pci_bus_type);
629 +
630 + pci_unmap_page(to_pci_dev(dev), dma_address, size, (int)direction);
631 +}
632 +
633 +static inline int
634 +dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
635 + enum dma_data_direction direction)
636 +{
637 + BUG_ON(dev->bus != &pci_bus_type);
638 +
639 + return pci_map_sg(to_pci_dev(dev), sg, nents, (int)direction);
640 +}
641 +
642 +static inline void
643 +dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
644 + enum dma_data_direction direction)
645 +{
646 + BUG_ON(dev->bus != &pci_bus_type);
647 +
648 + pci_unmap_sg(to_pci_dev(dev), sg, nhwentries, (int)direction);
649 +}
650 +
651 +static inline void
652 +dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
653 + enum dma_data_direction direction)
654 +{
655 + BUG_ON(dev->bus != &pci_bus_type);
656 +
657 + pci_dma_sync_single_for_cpu(to_pci_dev(dev), dma_handle,
658 + size, (int)direction);
659 +}
660 +
661 +static inline void
662 +dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size,
663 + enum dma_data_direction direction)
664 +{
665 + BUG_ON(dev->bus != &pci_bus_type);
666 +
667 + pci_dma_sync_single_for_device(to_pci_dev(dev), dma_handle,
668 + size, (int)direction);
669 +}
670 +
671 +static inline void
672 +dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
673 + enum dma_data_direction direction)
674 +{
675 + BUG_ON(dev->bus != &pci_bus_type);
676 +
677 + pci_dma_sync_sg_for_cpu(to_pci_dev(dev), sg, nelems, (int)direction);
678 +}
679 +
680 +static inline void
681 +dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems,
682 + enum dma_data_direction direction)
683 +{
684 + BUG_ON(dev->bus != &pci_bus_type);
685 +
686 + pci_dma_sync_sg_for_device(to_pci_dev(dev), sg, nelems, (int)direction);
687 +}
688 +
689 +static inline int
690 +dma_mapping_error(dma_addr_t dma_addr)
691 +{
692 + return pci_dma_mapping_error(dma_addr);
693 +}
694 +
695 #else
696
697 struct device;
698 diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h
699 index 89bd71b..5b12c2a 100644
700 --- a/include/asm-sparc64/pci.h
701 +++ b/include/asm-sparc64/pci.h
702 @@ -44,7 +44,9 @@ struct pci_dev;
703 /* Allocate and map kernel buffer using consistent mode DMA for a device.
704 * hwdev should be valid struct pci_dev pointer for PCI devices.
705 */
706 -extern void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle);
707 +extern void *__pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle, gfp_t gfp);
708 +#define pci_alloc_consistent(DEV,SZ,HANDLE) \
709 + __pci_alloc_consistent(DEV,SZ,HANDLE,GFP_ATOMIC)
710
711 /* Free and unmap a consistent DMA buffer.
712 * cpu_addr is what was returned from pci_alloc_consistent,
713 diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h
714 index f0a9b44..3d6dff2 100644
715 --- a/include/asm-sparc64/pgtable.h
716 +++ b/include/asm-sparc64/pgtable.h
717 @@ -335,6 +335,23 @@ static inline void set_pte_at(struct mm_
718 #define pte_clear(mm,addr,ptep) \
719 set_pte_at((mm), (addr), (ptep), __pte(0UL))
720
721 +#ifdef DCACHE_ALIASING_POSSIBLE
722 +#define __HAVE_ARCH_MOVE_PTE
723 +#define move_pte(pte, prot, old_addr, new_addr) \
724 +({ \
725 + pte_t newpte = (pte); \
726 + if (pte_present(pte)) { \
727 + unsigned long this_pfn = pte_pfn(pte); \
728 + \
729 + if (pfn_valid(this_pfn) && \
730 + (((old_addr) ^ (new_addr)) & (1 << 13))) \
731 + flush_dcache_page_all(current->mm, \
732 + pfn_to_page(this_pfn)); \
733 + } \
734 + newpte; \
735 +})
736 +#endif
737 +
738 extern pgd_t swapper_pg_dir[2048];
739 extern pmd_t swapper_low_pmd_dir[2048];
740
741 diff --git a/include/linux/i2o.h b/include/linux/i2o.h
742 index 5a9d8c5..6368e31 100644
743 --- a/include/linux/i2o.h
744 +++ b/include/linux/i2o.h
745 @@ -1116,8 +1116,11 @@ static inline struct i2o_message *i2o_ms
746
747 mmsg->mfa = readl(c->in_port);
748 if (unlikely(mmsg->mfa >= c->in_queue.len)) {
749 + u32 mfa = mmsg->mfa;
750 +
751 mempool_free(mmsg, c->in_msg.mempool);
752 - if(mmsg->mfa == I2O_QUEUE_EMPTY)
753 +
754 + if (mfa == I2O_QUEUE_EMPTY)
755 return ERR_PTR(-EBUSY);
756 return ERR_PTR(-EFAULT);
757 }
758 diff --git a/mm/shmem.c b/mm/shmem.c
759 index f0eb2f2..1bc2285 100644
760 --- a/mm/shmem.c
761 +++ b/mm/shmem.c
762 @@ -2100,6 +2100,7 @@ #endif
763 sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
764 sb->s_magic = TMPFS_MAGIC;
765 sb->s_op = &shmem_ops;
766 + sb->s_time_gran = 1;
767
768 inode = shmem_get_inode(sb, S_IFDIR | mode, 0);
769 if (!inode)

  ViewVC Help
Powered by ViewVC 1.1.20