Browse Source

[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>
David S. Miller 20 năm trước cách đây
mục cha
commit
88314ee73f
1 tập tin đã thay đổi với 3 bổ sung5 xóa
  1. 3 5
      arch/sparc64/kernel/pci_iommu.c

+ 3 - 5
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;
 		flushreg = strbuf->strbuf_ctxflush;
 		matchreg = PCI_STC_CTXMATCH_ADDR(strbuf, ctx);
 		matchreg = PCI_STC_CTXMATCH_ADDR(strbuf, ctx);
 
 
-		if (pci_iommu_read(matchreg) == 0)
-			goto do_flush_sync;
-
 		pci_iommu_write(flushreg, ctx);
 		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;
 			goto do_flush_sync;
 
 
-		val &= 0xffff;
 		while (val) {
 		while (val) {
 			if (val & 0x1)
 			if (val & 0x1)
 				pci_iommu_write(flushreg, ctx);
 				pci_iommu_write(flushreg, ctx);