From: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: haver@linux.vnet.ibm.com, gregkh@linuxfoundation.org,
Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
Subject: [PATCH 3/4] GenWQE: Improve hardware error recovery
Date: Wed, 25 Jun 2014 13:22:06 -0300 [thread overview]
Message-ID: <1403713327-27976-4-git-send-email-klebers@linux.vnet.ibm.com> (raw)
In-Reply-To: <1403713327-27976-1-git-send-email-klebers@linux.vnet.ibm.com>
Currently, in the event of a fatal hardware error, the driver tries a
recovery procedure that calls pci_reset_function() to reset the card.
This is not sufficient in some cases, needing a fundamental reset to
bring the card back.
This patch implements a call to the platform fundamental reset procedure
on the error recovery path if GENWQE_PLATFORM_ERROR_RECOVERY is enabled.
This is implemented by default only on PPC64, since this can cause
problems on other archs, e.g. zSeries, where the platform has its own
recovery procedures, leading to a potencial race conditition. For these
cases, the recovery is kept as it was before.
Signed-off-by: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
---
drivers/misc/genwqe/card_base.c | 45 +++++++++++++++++++++++++++++++++++++++
1 files changed, 45 insertions(+), 0 deletions(-)
diff --git a/drivers/misc/genwqe/card_base.c b/drivers/misc/genwqe/card_base.c
index 87ebaba..abb7961 100644
--- a/drivers/misc/genwqe/card_base.c
+++ b/drivers/misc/genwqe/card_base.c
@@ -797,6 +797,41 @@ static int genwqe_pci_fundamental_reset(struct pci_dev *pci_dev)
return rc;
}
+
+static int genwqe_platform_recovery(struct genwqe_dev *cd)
+{
+ struct pci_dev *pci_dev = cd->pci_dev;
+ int rc;
+
+ dev_info(&pci_dev->dev,
+ "[%s] resetting card for error recovery\n", __func__);
+
+ /* Clear out error injection flags */
+ cd->err_inject &= ~(GENWQE_INJECT_HARDWARE_FAILURE |
+ GENWQE_INJECT_GFIR_FATAL |
+ GENWQE_INJECT_GFIR_INFO);
+
+ genwqe_stop(cd);
+
+ /* Try recoverying the card with fundamental reset */
+ rc = genwqe_pci_fundamental_reset(pci_dev);
+ if (!rc) {
+ rc = genwqe_start(cd);
+ if (!rc)
+ dev_info(&pci_dev->dev,
+ "[%s] card recovered\n", __func__);
+ else
+ dev_err(&pci_dev->dev,
+ "[%s] err: cannot start card services! (err=%d)\n",
+ __func__, rc);
+ } else {
+ dev_err(&pci_dev->dev,
+ "[%s] card reset failed\n", __func__);
+ }
+
+ return rc;
+}
+
/*
* genwqe_reload_bistream() - reload card bitstream
*
@@ -875,6 +910,7 @@ static int genwqe_health_thread(void *data)
struct pci_dev *pci_dev = cd->pci_dev;
u64 gfir, gfir_masked, slu_unitcfg, app_unitcfg;
+ health_thread_begin:
while (!kthread_should_stop()) {
rc = wait_event_interruptible_timeout(cd->health_waitq,
(genwqe_health_check_cond(cd, &gfir) ||
@@ -960,6 +996,15 @@ static int genwqe_health_thread(void *data)
/* We do nothing if the card is going over PCI recovery */
if (pci_channel_offline(pci_dev))
return -EIO;
+
+ /*
+ * If it's supported by the platform, we try a fundamental reset
+ * to recover from a fatal error. Otherwise, we continue to wait
+ * for an external recovery procedure to take care of it.
+ */
+ rc = genwqe_platform_recovery(cd);
+ if (!rc)
+ goto health_thread_begin;
}
dev_err(&pci_dev->dev,
--
1.7.1
next prev parent reply other threads:[~2014-06-25 16:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-25 16:22 [PATCH 0/4] GenWQE: patches to improve RAS features (v2) Kleber Sacilotto de Souza
2014-06-25 16:22 ` [PATCH 1/4] GenWQE: Add sysfs interface for bitstream reload Kleber Sacilotto de Souza
2014-06-25 16:22 ` [PATCH 2/4] GenWQE: Add support for EEH error recovery Kleber Sacilotto de Souza
2014-06-25 16:22 ` Kleber Sacilotto de Souza [this message]
2014-06-25 16:22 ` [PATCH 4/4] GenWQE: Remove unnecessary include Kleber Sacilotto de Souza
2014-06-26 8:55 ` [PATCH 0/4] GenWQE: patches to improve RAS features (v2) Frank Haverkamp
2014-07-04 7:37 ` Frank Haverkamp
2014-07-04 17:39 ` Greg KH
2014-07-09 21:16 ` Greg KH
2014-07-10 12:41 ` Kleber Sacilotto de Souza
-- strict thread matches above, loose matches on Subject: below --
2014-06-04 13:57 [PATCH 0/4] GenWQE: patches to improve RAS features Kleber Sacilotto de Souza
2014-06-04 13:57 ` [PATCH 3/4] GenWQE: Improve hardware error recovery Kleber Sacilotto de Souza
2014-06-04 14:06 ` Frank Haverkamp
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1403713327-27976-4-git-send-email-klebers@linux.vnet.ibm.com \
--to=klebers@linux.vnet.ibm.com \
--cc=gregkh@linuxfoundation.org \
--cc=haver@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®