PCI Error Recovery: Symbios SCSI device driver]
PATCH 19/22 PCI Error Recovery: Symbios SCSI device driver]
Hi,
I'm not sure where to send this patch. Its a part of a much larger series of patches that imleent "PCI Bus Error Recovery". Some background is in order:
Some recent PCI bridge chips can detect a variety of PCI error conditions, and react to them by offlining the affected PCI device. These errors can be recovered by quiescing the affected device driver, resetting the PCI bridge chip, and then restarting the device driver.
The big sequence of patches implements this whole system for the ppc64 architecture, plus it converts five "sample" drivers to use it. I've implemented the recovery for two SCSI device drivers: the Symbios 53Cxx driver, included bewlo, and the "IBM power raid" ipr driver.
I'm fishing for comments, suggestins, etc. These patches are submited for inclusion into mainline.
--linas
p.s. The next emails will include the pci header changes, and the overview documentation. The full set of patches for he whole system should be visible on the LKML.
p.p.s I'm also wondering if there is some way to implement this in SCSI-generic. Haven't thought much about this. Comments?
----- Forwarded message from linas <[email protected]> -----
To: [email protected]
Cc: [email protected], [email protected],
[email protected]
Subject: [PATCH 19/22] PCI Error Recovery: Symbios SCSI device driver
PCI Error Recovery: Symbios SCSI device driver
Various PCI bus errors can be signaled by newer PCI controllers. This patch adds the PCI error recovery callbacks to the Symbios SCSI device driver. The patch has been tested, and appears to work well.
--
arch/ppc64/configs/pSeries_defconfig | 1 drivers/scsi/Kconfig | 8 ++ drivers/scsi/sym53c8xx_2/sym_glue.c | 124 +++++++++++++++++++++++++++++++++++ drivers/scsi/sym53c8xx_2/sym_glue.h | 4 + drivers/scsi/sym53c8xx_2/sym_hipd.c | 16 ++++ 5 files changed, 153 insertions(+)
arch/ppc64/configs/pSeries_defconfig +1 -0
@@ -473,6 +473,7 @@ CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set +CONFIG_SCSI_SYM53C8XX_EEH_RECOVERY=y CONFIG_SCSI_IPR=y CONFIG_SCSI_IPR_TRACE=y CONFIG_SCSI_IPR_DUMP=y
drivers/scsi/Kconfig +8 -0
@@ -1062,6 +1062,14 @@ the card. This is significantly slower then using memory mapped IO. Most people should answer N. +config SCSI_SYM53C8XX_EEH_RECOVERY + bool "Enable PCI bus error recovery" + depends on SCSI_SYM53C8XX_2 && PPC_PSERIES + help + If you say Y here, the driver will be able to recover from + PCI bus errors on many PowerPC platforms. IBM pSeries users + should answer Y. + config SCSI_IPR tristate "IBM Power Linux RAID adapter support" depends on PCI && SCSI
drivers/scsi/sym53c8xx_2/sym_glue.c +124 -0
165 lines not on this page · raw message
drivers/scsi/sym53c8xx_2/sym_glue.h +4 -0
@@ -181,6 +181,10 @@char chip_name[8 ];struct pci_dev *device; +/* pci bus i/o state; waiter for clearing of i/o state */ +enum pci_channel_state io_state; +struct sym_eh_wait *io_reset_wait; +struct Scsi_Host *host;void __iomem * ioaddr;/* MMIO kernel io address */
drivers/scsi/sym53c8xx_2/sym_hipd.c +16 -0
@@ -2806,6 +2806,7 @@u_char istat, istatc;u_char dstat;u_short sist; +u_int icnt;/* * interrupt on the fly ?
@@ -2847,6 +2848,7 @@ sist =0 ; dstat =0 ; istatc = istat; + icnt =0 ; do { if (istatc & SIP) sist |= INW(np, nc_sist);
@@ -2854,6 +2856,20 @@ dstat |=INB (np, nc_dstat); istatc =INB (np, nc_istat); istat |= istatc; +#ifdef CONFIG_SCSI_SYM53C8XX_EEH_RECOVERY +/* Prevent deadlock waiting on a condition that may never clear. */ +/* XXX this is a temporary kludge; the correct to detect +* a PCI bus error would be to use the io_check interfaces +* proposed by Hidetoshi Seto <[email protected]> +* Problem with polling like that is the state flag might not +* be set. +*/ + icnt ++; +if (100 < icnt) { +if (np->s.device->error_state != pci_channel_io_normal) +return ; + } +#endif /* CONFIG_SCSI_SYM53C8XX_EEH_RECOVERY */ }while (istatc & (SIP |DIP ));if (DEBUG_FLAGS &DEBUG_TINY )
_______________________________________________
Linuxppc64-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc64-dev
----- End forwarded message -----