[PATCH 2/2] ipr: Block config IO during BIST (#3)

brking at us.ibm.com brking at us.ibm.com
Tue Nov 9 03:19:42 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-bk18-bjking1/drivers/scsi/ipr.c |    5 ++++-
 linux-2.6.10-rc1-bk18-bjking1/drivers/scsi/ipr.h |    7 +++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff -puN drivers/scsi/ipr.h~ipr_block_config_io_during_bist_revised drivers/scsi/ipr.h
--- linux-2.6.10-rc1-bk18/drivers/scsi/ipr.h~ipr_block_config_io_during_bist_revised	2004-11-08 09:32:53.000000000 -0600
+++ linux-2.6.10-rc1-bk18-bjking1/drivers/scsi/ipr.h	2004-11-08 09:32:53.000000000 -0600
@@ -1112,6 +1112,13 @@ __FUNCTION__, __LINE__, ioa_cfg
 #define ipr_remove_dump_file(kobj, attr) do { } while(0)
 #endif
 
+#ifndef CONFIG_PPC64
+#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
  */
diff -puN drivers/scsi/ipr.c~ipr_block_config_io_during_bist_revised drivers/scsi/ipr.c
--- linux-2.6.10-rc1-bk18/drivers/scsi/ipr.c~ipr_block_config_io_during_bist_revised	2004-11-08 09:32:53.000000000 -0600
+++ linux-2.6.10-rc1-bk18-bjking1/drivers/scsi/ipr.c	2004-11-08 09:32:53.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 {
_



More information about the Linuxppc64-dev mailing list