mthca_reset.c: Fix a non-blocking Config Write that needs flushing in mthca_reset()

Signed-off-by: John Partridge johnip@sgi.com
---
--- openib-1.1-buildable-ORIG/drivers/infiniband/hw/mthca/mthca_reset.c	2006-09-20 07:19:24.000000000 -0500
+++ openib-1.1/drivers/infiniband/hw/mthca/mthca_reset.c	2006-10-19 13:55:04.292275707 -0500
@@ -281,6 +281,17 @@
 		goto out;
 	}
 
+	/*
+	 * Perform a "flush" of the pci_write_config_dword() for PCI_COMMAND.
+	 * The PCI_COMMAND to the HCA must complete before we exit mthca_reset()
+	 * or any PIO Memory Reads via the BAR will fail at this point.
+	 */
+	if (pci_read_config_dword(mdev->pdev, PCI_COMMAND, hca_header)) {
+			err = -ENODEV;
+			mthca_err(mdev, "Couldn't access HCA memory after restoring, "
+				"aborting.\n");
+	}
+
 out:
 	if (bridge)
 		pci_dev_put(bridge);
