summaryrefslogtreecommitdiffstats
path: root/arch/sparc64
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2005-06-01 04:13:52 +0200
committerDavid S. Miller <davem@davemloft.net>2005-06-01 04:13:52 +0200
commit88314ee73fd75eb32abdcb3119cd303c116d4500 (patch)
tree913c23ad89ec778d62eb517487dc6ab545d869c5 /arch/sparc64
parent[SPARC64]: Fix streaming buffer flushing on PCI and SBUS. (diff)
downloadlinux-88314ee73fd75eb32abdcb3119cd303c116d4500.tar.xz
linux-88314ee73fd75eb32abdcb3119cd303c116d4500.zip
[SPARC64]: Refine PCI strbuf ctx-based flush.
The initial peek read PIO of the match register is just a waste. Just do the flush writes first, as that is more efficient. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64')
-rw-r--r--arch/sparc64/kernel/pci_iommu.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/sparc64/kernel/pci_iommu.c b/arch/sparc64/kernel/pci_iommu.c
index 1807876f8c36..2803bc7c2c79 100644
--- a/arch/sparc64/kernel/pci_iommu.c
+++ b/arch/sparc64/kernel/pci_iommu.c
@@ -422,14 +422,12 @@ static void pci_strbuf_flush(struct pci_strbuf *strbuf, struct pci_iommu *iommu,
flushreg = strbuf->strbuf_ctxflush;
matchreg = PCI_STC_CTXMATCH_ADDR(strbuf, ctx);
- if (pci_iommu_read(matchreg) == 0)
- goto do_flush_sync;
-
pci_iommu_write(flushreg, ctx);
- if ((val = pci_iommu_read(matchreg)) == 0)
+ val = pci_iommu_read(matchreg);
+ val &= 0xffff;
+ if (!val)
goto do_flush_sync;
- val &= 0xffff;
while (val) {
if (val & 0x1)
pci_iommu_write(flushreg, ctx);