[PATCH 2/2] ipr_block_config_io_during_bist (resend)

brking at us.ibm.com brking at us.ibm.com
Thu Nov 4 02:10:26 EST 2004



Change ipr to use new ppc64 pci APIs to block PCI config space
accesses when running BIST to prevent PCI master aborts.

Signed-off-by: Brian King <brking at us.ibm.com>
---

 linux-2.6.10-rc1-bk13-bjking1/drivers/scsi/ipr.c |    5 ++++-
 linux-2.6.10-rc1-bk13-bjking1/drivers/scsi/ipr.h |    7 +++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff -puN drivers/scsi/ipr.c~ipr_block_config_io_during_bist drivers/scsi/ipr.c
--- linux-2.6.10-rc1-bk13/drivers/scsi/ipr.c~ipr_block_config_io_during_bist	2004-11-03 09:08:27.000000000 -0600
+++ linux-2.6.10-rc1-bk13-bjking1/drivers/scsi/ipr.c	2004-11-03 09:08:27.000000000 -0600
@@ -4935,6 +4935,7 @@ static int ipr_reset_restore_cfg_space(s
 	int rc;
 
 	ENTER;
+	pci_unblock_config_io(ioa_cfg->pdev);
 	rc = pci_restore_state(ioa_cfg->pdev);
 
 	if (rc != PCIBIOS_SUCCESSFUL) {
@@ -4989,9 +4990,11 @@ static int ipr_reset_start_bist(struct i
 	int rc;
 
 	ENTER;
-	rc = pci_write_config_byte(ioa_cfg->pdev, PCI_BIST, PCI_BIST_START);
+	pci_block_config_io(ioa_cfg->pdev);
+	rc = pci_start_bist(ioa_cfg->pdev);
 
 	if (rc != PCIBIOS_SUCCESSFUL) {
+		pci_unblock_config_io(ioa_cfg->pdev);
 		ipr_cmd->ioasa.ioasc = cpu_to_be32(IPR_IOASC_PCI_ACCESS_ERROR);
 		rc = IPR_RC_JOB_CONTINUE;
 	} else {
diff -puN drivers/scsi/ipr.h~ipr_block_config_io_during_bist drivers/scsi/ipr.h
--- linux-2.6.10-rc1-bk13/drivers/scsi/ipr.h~ipr_block_config_io_during_bist	2004-11-03 09:08:27.000000000 -0600
+++ linux-2.6.10-rc1-bk13-bjking1/drivers/scsi/ipr.h	2004-11-03 09:08:27.000000000 -0600
@@ -1112,6 +1112,13 @@ __FUNCTION__, __LINE__, ioa_cfg
 #define ipr_remove_dump_file(kobj, attr) do { } while(0)
 #endif
 
+#if !defined(CONFIG_PPC_PSERIES) && !defined(CONFIG_PPC_ISERIES)
+#define pci_block_config_io(dev) do { } while(0)
+#define pci_unblock_config_io(dev) do { } while(0)
+#define pci_start_bist(dev) \
+        pci_write_config_byte(dev, PCI_BIST, PCI_BIST_START)
+#endif
+
 /*
  * Error logging macros
  */
_



More information about the Linuxppc64-dev mailing list