diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /arch/ia64/sn/pci | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'arch/ia64/sn/pci')
-rw-r--r-- | arch/ia64/sn/pci/pci_dma.c | 1 | ||||
-rw-r--r-- | arch/ia64/sn/pci/pcibr/pcibr_provider.c | 1 | ||||
-rw-r--r-- | arch/ia64/sn/pci/tioca_provider.c | 20 | ||||
-rw-r--r-- | arch/ia64/sn/pci/tioce_provider.c | 1 |
4 files changed, 9 insertions, 14 deletions
diff --git a/arch/ia64/sn/pci/pci_dma.c b/arch/ia64/sn/pci/pci_dma.c index 98b684928e12..a9d310de57da 100644 --- a/arch/ia64/sn/pci/pci_dma.c +++ b/arch/ia64/sn/pci/pci_dma.c | |||
@@ -9,6 +9,7 @@ | |||
9 | * a description of how these routines should be used. | 9 | * a description of how these routines should be used. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/gfp.h> | ||
12 | #include <linux/module.h> | 13 | #include <linux/module.h> |
13 | #include <linux/dma-mapping.h> | 14 | #include <linux/dma-mapping.h> |
14 | #include <asm/dma.h> | 15 | #include <asm/dma.h> |
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_provider.c b/arch/ia64/sn/pci/pcibr/pcibr_provider.c index d13e5a22a558..3cb5cf377644 100644 --- a/arch/ia64/sn/pci/pcibr/pcibr_provider.c +++ b/arch/ia64/sn/pci/pcibr/pcibr_provider.c | |||
@@ -8,6 +8,7 @@ | |||
8 | 8 | ||
9 | #include <linux/interrupt.h> | 9 | #include <linux/interrupt.h> |
10 | #include <linux/types.h> | 10 | #include <linux/types.h> |
11 | #include <linux/slab.h> | ||
11 | #include <linux/pci.h> | 12 | #include <linux/pci.h> |
12 | #include <asm/sn/addrs.h> | 13 | #include <asm/sn/addrs.h> |
13 | #include <asm/sn/geo.h> | 14 | #include <asm/sn/geo.h> |
diff --git a/arch/ia64/sn/pci/tioca_provider.c b/arch/ia64/sn/pci/tioca_provider.c index 35b2a27d2e77..4d4536e3b6f3 100644 --- a/arch/ia64/sn/pci/tioca_provider.c +++ b/arch/ia64/sn/pci/tioca_provider.c | |||
@@ -9,6 +9,8 @@ | |||
9 | #include <linux/types.h> | 9 | #include <linux/types.h> |
10 | #include <linux/interrupt.h> | 10 | #include <linux/interrupt.h> |
11 | #include <linux/pci.h> | 11 | #include <linux/pci.h> |
12 | #include <linux/bitmap.h> | ||
13 | #include <linux/slab.h> | ||
12 | #include <asm/sn/sn_sal.h> | 14 | #include <asm/sn/sn_sal.h> |
13 | #include <asm/sn/addrs.h> | 15 | #include <asm/sn/addrs.h> |
14 | #include <asm/sn/io.h> | 16 | #include <asm/sn/io.h> |
@@ -369,7 +371,7 @@ tioca_dma_d48(struct pci_dev *pdev, u64 paddr) | |||
369 | static dma_addr_t | 371 | static dma_addr_t |
370 | tioca_dma_mapped(struct pci_dev *pdev, unsigned long paddr, size_t req_size) | 372 | tioca_dma_mapped(struct pci_dev *pdev, unsigned long paddr, size_t req_size) |
371 | { | 373 | { |
372 | int i, ps, ps_shift, entry, entries, mapsize, last_entry; | 374 | int ps, ps_shift, entry, entries, mapsize; |
373 | u64 xio_addr, end_xio_addr; | 375 | u64 xio_addr, end_xio_addr; |
374 | struct tioca_common *tioca_common; | 376 | struct tioca_common *tioca_common; |
375 | struct tioca_kernel *tioca_kern; | 377 | struct tioca_kernel *tioca_kern; |
@@ -410,23 +412,13 @@ tioca_dma_mapped(struct pci_dev *pdev, unsigned long paddr, size_t req_size) | |||
410 | map = tioca_kern->ca_pcigart_pagemap; | 412 | map = tioca_kern->ca_pcigart_pagemap; |
411 | mapsize = tioca_kern->ca_pcigart_entries; | 413 | mapsize = tioca_kern->ca_pcigart_entries; |
412 | 414 | ||
413 | entry = find_first_zero_bit(map, mapsize); | 415 | entry = bitmap_find_next_zero_area(map, mapsize, 0, entries, 0); |
414 | while (entry < mapsize) { | 416 | if (entry >= mapsize) { |
415 | last_entry = find_next_bit(map, mapsize, entry); | ||
416 | |||
417 | if (last_entry - entry >= entries) | ||
418 | break; | ||
419 | |||
420 | entry = find_next_zero_bit(map, mapsize, last_entry); | ||
421 | } | ||
422 | |||
423 | if (entry > mapsize) { | ||
424 | kfree(ca_dmamap); | 417 | kfree(ca_dmamap); |
425 | goto map_return; | 418 | goto map_return; |
426 | } | 419 | } |
427 | 420 | ||
428 | for (i = 0; i < entries; i++) | 421 | bitmap_set(map, entry, entries); |
429 | set_bit(entry + i, map); | ||
430 | 422 | ||
431 | bus_addr = tioca_kern->ca_pciap_base + (entry * ps); | 423 | bus_addr = tioca_kern->ca_pciap_base + (entry * ps); |
432 | 424 | ||
diff --git a/arch/ia64/sn/pci/tioce_provider.c b/arch/ia64/sn/pci/tioce_provider.c index 012f3b82ee55..27faba035f3a 100644 --- a/arch/ia64/sn/pci/tioce_provider.c +++ b/arch/ia64/sn/pci/tioce_provider.c | |||
@@ -8,6 +8,7 @@ | |||
8 | 8 | ||
9 | #include <linux/types.h> | 9 | #include <linux/types.h> |
10 | #include <linux/interrupt.h> | 10 | #include <linux/interrupt.h> |
11 | #include <linux/slab.h> | ||
11 | #include <linux/pci.h> | 12 | #include <linux/pci.h> |
12 | #include <asm/sn/sn_sal.h> | 13 | #include <asm/sn/sn_sal.h> |
13 | #include <asm/sn/addrs.h> | 14 | #include <asm/sn/addrs.h> |