diff options
author | David S. Miller <davem@davemloft.net> | 2005-05-31 19:57:59 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-05-31 19:57:59 -0400 |
commit | 7c963ad1d113790a8c723a178988b675868f3abe (patch) | |
tree | 2e1cc54795aeca06a11801636737901ba71a2ed8 /include | |
parent | 2e3e80c2b75e3815a0160cbd23d4fdb767d66b35 (diff) |
[SPARC64]: Fix streaming buffer flushing on PCI and SBUS.
Firstly, if the direction is TODEVICE, then dirty data in the
streaming cache is impossible so we can elide the flush-flag
synchronization in that case.
Next, the context allocator is broken. It is highly likely
that contexts get used multiple times for different dma
mappings, which confuses the strbuf flushing code and makes
it run inefficiently.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-sparc64/iommu.h | 2 | ||||
-rw-r--r-- | include/asm-sparc64/pbm.h | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/include/asm-sparc64/iommu.h b/include/asm-sparc64/iommu.h index 5fd16e42a045..0de7a3da79cd 100644 --- a/include/asm-sparc64/iommu.h +++ b/include/asm-sparc64/iommu.h | |||
@@ -16,4 +16,6 @@ | |||
16 | #define IOPTE_CACHE 0x0000000000000010UL /* Cached (in UPA E-cache) */ | 16 | #define IOPTE_CACHE 0x0000000000000010UL /* Cached (in UPA E-cache) */ |
17 | #define IOPTE_WRITE 0x0000000000000002UL /* Writeable */ | 17 | #define IOPTE_WRITE 0x0000000000000002UL /* Writeable */ |
18 | 18 | ||
19 | #define IOMMU_NUM_CTXS 4096 | ||
20 | |||
19 | #endif /* !(_SPARC_IOMMU_H) */ | 21 | #endif /* !(_SPARC_IOMMU_H) */ |
diff --git a/include/asm-sparc64/pbm.h b/include/asm-sparc64/pbm.h index 92999631c819..4c15610a2bac 100644 --- a/include/asm-sparc64/pbm.h +++ b/include/asm-sparc64/pbm.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <asm/io.h> | 15 | #include <asm/io.h> |
16 | #include <asm/page.h> | 16 | #include <asm/page.h> |
17 | #include <asm/oplib.h> | 17 | #include <asm/oplib.h> |
18 | #include <asm/iommu.h> | ||
18 | 19 | ||
19 | /* The abstraction used here is that there are PCI controllers, | 20 | /* The abstraction used here is that there are PCI controllers, |
20 | * each with one (Sabre) or two (PSYCHO/SCHIZO) PCI bus modules | 21 | * each with one (Sabre) or two (PSYCHO/SCHIZO) PCI bus modules |
@@ -40,9 +41,6 @@ struct pci_iommu { | |||
40 | */ | 41 | */ |
41 | spinlock_t lock; | 42 | spinlock_t lock; |
42 | 43 | ||
43 | /* Context allocator. */ | ||
44 | unsigned int iommu_cur_ctx; | ||
45 | |||
46 | /* IOMMU page table, a linear array of ioptes. */ | 44 | /* IOMMU page table, a linear array of ioptes. */ |
47 | iopte_t *page_table; /* The page table itself. */ | 45 | iopte_t *page_table; /* The page table itself. */ |
48 | int page_table_sz_bits; /* log2 of ow many pages does it map? */ | 46 | int page_table_sz_bits; /* log2 of ow many pages does it map? */ |
@@ -87,6 +85,10 @@ struct pci_iommu { | |||
87 | u16 flush; | 85 | u16 flush; |
88 | } alloc_info[PBM_NCLUSTERS]; | 86 | } alloc_info[PBM_NCLUSTERS]; |
89 | 87 | ||
88 | /* CTX allocation. */ | ||
89 | unsigned long ctx_lowest_free; | ||
90 | unsigned long ctx_bitmap[IOMMU_NUM_CTXS / (sizeof(unsigned long) * 8)]; | ||
91 | |||
90 | /* Here a PCI controller driver describes the areas of | 92 | /* Here a PCI controller driver describes the areas of |
91 | * PCI memory space where DMA to/from physical memory | 93 | * PCI memory space where DMA to/from physical memory |
92 | * are addressed. Drivers interrogate the PCI layer | 94 | * are addressed. Drivers interrogate the PCI layer |