Re: [PATCH 2/2] ipr: Block config access during BIST (resend)

From: Brian King
Date: Tue Aug 23 2005 - 10:17:25 EST


Greg,

Please apply along with the previous pci patch.

Thanks

--
Brian King
eServer Storage I/O
IBM Linux Technology Center

IPR scsi adapter have an exposure today in that they issue BIST to
the adapter to reset the card. If, during the time it takes to complete
BIST, userspace attempts to access PCI config space, the host bus bridge
will master abort the access since the ipr adapter does not respond on
the PCI bus for a brief period of time when running BIST. On PPC64
hardware, this master abort results in the host PCI bridge isolating
that PCI device from the rest of the system, making the device unusable
until Linux is rebooted. This patch makes use of some newly added PCI layer
APIs that allow for protection from userspace accessing config space
of a device in scenarios such as this.

Signed-off-by: Brian King <brking@xxxxxxxxxx>
---

linux-2.6-bjking1/drivers/scsi/ipr.c | 2 ++
1 files changed, 2 insertions(+)

diff -puN drivers/scsi/ipr.c~ipr_block_user_config_io_during_bist drivers/scsi/ipr.c
--- linux-2.6/drivers/scsi/ipr.c~ipr_block_user_config_io_during_bist 2005-08-22 17:03:57.000000000 -0500
+++ linux-2.6-bjking1/drivers/scsi/ipr.c 2005-08-22 17:03:57.000000000 -0500
@@ -4944,6 +4944,7 @@ static int ipr_reset_restore_cfg_space(s
int rc;

ENTER;
+ pci_unblock_user_cfg_access(ioa_cfg->pdev);
rc = pci_restore_state(ioa_cfg->pdev);

if (rc != PCIBIOS_SUCCESSFUL) {
@@ -4998,6 +4999,7 @@ static int ipr_reset_start_bist(struct i
int rc;

ENTER;
+ pci_block_user_cfg_access(ioa_cfg->pdev);
rc = pci_write_config_byte(ioa_cfg->pdev, PCI_BIST, PCI_BIST_START);

if (rc != PCIBIOS_SUCCESSFUL) {
_