]> err.no Git - linux-2.6/commitdiff
[SPARC64]: Refine PCI strbuf ctx-based flush.
authorDavid S. Miller <davem@davemloft.net>
Wed, 1 Jun 2005 02:13:52 +0000 (19:13 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 1 Jun 2005 02:13:52 +0000 (19:13 -0700)
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>
arch/sparc64/kernel/pci_iommu.c

index 1807876f8c36fe2cbbacd3bc31247267ca71e10b..2803bc7c2c798af12fc0d57b701991bc51727995 100644 (file)
@@ -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);