diff options
author | Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com> | 2014-06-04 15:57:51 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-09 23:14:27 +0200 |
commit | fb145456fa4f4311f90703aeee058bab3b274bf8 (patch) | |
tree | 980ae85a3c35b8b574dddeaf96bf84d41dbb83d3 /drivers/misc/genwqe/card_dev.c | |
parent | GenWQE: Add sysfs interface for bitstream reload (diff) | |
download | linux-fb145456fa4f4311f90703aeee058bab3b274bf8.tar.xz linux-fb145456fa4f4311f90703aeee058bab3b274bf8.zip |
GenWQE: Add support for EEH error recovery
This patch implements the callbacks and functions necessary to have EEH
recovery support.
It adds a config option to enable or disable explicit calls to trigger
platform specific mechanisms on error recovery paths. This option is
enabled by default only on PPC64 systems and can be overritten via
debugfs. If this option is enabled, on the error recovery path the
driver will call pci_channel_offline() to check for error condition and
issue non-raw MMIO reads to trigger early EEH detection in case of
hardware failures. This is necessary since the driver MMIO helper
funtions use raw accessors.
Signed-off-by: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
Acked-by: Frank Haverkamp <haver@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/genwqe/card_dev.c')
-rw-r--r-- | drivers/misc/genwqe/card_dev.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/misc/genwqe/card_dev.c b/drivers/misc/genwqe/card_dev.c index 1d2f163a1906..aae42555e2ca 100644 --- a/drivers/misc/genwqe/card_dev.c +++ b/drivers/misc/genwqe/card_dev.c @@ -1048,10 +1048,15 @@ static long genwqe_ioctl(struct file *filp, unsigned int cmd, int rc = 0; struct genwqe_file *cfile = (struct genwqe_file *)filp->private_data; struct genwqe_dev *cd = cfile->cd; + struct pci_dev *pci_dev = cd->pci_dev; struct genwqe_reg_io __user *io; u64 val; u32 reg_offs; + /* Return -EIO if card hit EEH */ + if (pci_channel_offline(pci_dev)) + return -EIO; + if (_IOC_TYPE(cmd) != GENWQE_IOC_CODE) return -EINVAL; |