All of lore.kernel.org
 help / color / mirror / Atom feed
From: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
To: jejb@linux.vnet.ibm.com, martin.petersen@oracle.com,
	linux-scsi@vger.kernel.org
Cc: David.Carroll@microsemi.com, Gana.Sridaran@microsemi.com,
	Scott.Benesh@microsemi.com, jthumshirn@suse.de,
	dan.carpenter@oracle.com
Subject: [PATCH 03/16] aacraid: Fix for excessive prints on EEH
Date: Tue, 14 Feb 2017 12:44:33 -0800	[thread overview]
Message-ID: <20170214204446.14808-4-RaghavaAditya.Renukunta@microsemi.com> (raw)
In-Reply-To: <20170214204446.14808-1-RaghavaAditya.Renukunta@microsemi.com>

This issue showed up on a kdump debug(single CPU on powerkvm), when EEH
errors rendered the adapter unusable. The driver correctly detected the
issue and attempted to restart the controller, in doing so the driver
attempted to read the status registers of the controller. This triggered
additional eeh errors which continued for a good 6 minutes.

Fixed by returning without waiting when EEH error is reported.

Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Reviewed-by: David Carroll <David.Carroll@microsemi.com>
---
 drivers/scsi/aacraid/commsup.c | 38 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 37 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 56090f5..6220b47 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -461,6 +461,30 @@ int aac_queue_get(struct aac_dev * dev, u32 * index, u32 qid, struct hw_fib * hw
 	return 0;
 }
 
+#ifdef CONFIG_EEH
+static inline int aac_check_eeh_failure(struct aac_dev *dev)
+{
+	/* Check for an EEH failure for the given
+	 * device node. Function eeh_dev_check_failure()
+	 * returns 0 if there has not been an EEH error
+	 * otherwise returns a non-zero value.
+	 *
+	 * Need to be called before any PCI operation,
+	 * i.e.,before aac_adapter_check_health()
+	 */
+	struct eeh_dev *edev = pci_dev_to_eeh_dev(dev->pdev);
+
+	if (eeh_dev_check_failure(edev)) {
+		/* The EEH mechanisms will handle this
+		 * error and reset the device if
+		 * necessary.
+		 */
+		return 1;
+	}
+	return 0;
+}
+#endif
+
 /*
  *	Define the highest level of host to adapter communication routines.
  *	These routines will support host to adapter FS commuication. These
@@ -496,7 +520,6 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size,
 	unsigned long mflags = 0;
 	unsigned long sflags = 0;
 
-
 	if (!(hw_fib->header.XferState & cpu_to_le32(HostOwned)))
 		return -EBUSY;
 	/*
@@ -662,6 +685,12 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size,
 					}
 					return -ETIMEDOUT;
 				}
+
+#if defined(CONFIG_EEH)
+				if (aac_check_eeh_failure(dev))
+					return -EFAULT;
+#endif
+
 				if ((blink = aac_adapter_check_health(dev)) > 0) {
 					if (wait == -1) {
 	        				printk(KERN_ERR "aacraid: aac_fib_send: adapter blinkLED 0x%x.\n"
@@ -755,7 +784,14 @@ int aac_hba_send(u8 command, struct fib *fibptr, fib_callback callback,
 	FIB_COUNTER_INCREMENT(aac_config.NativeSent);
 
 	if (wait) {
+
 		spin_unlock_irqrestore(&fibptr->event_lock, flags);
+
+#if defined(CONFIG_EEH)
+		if (aac_check_eeh_failure(dev))
+			return -EFAULT;
+#endif
+
 		/* Only set for first known interruptable command */
 		if (down_interruptible(&fibptr->event_wait)) {
 			fibptr->done = 2;
-- 
2.7.4

  parent reply	other threads:[~2017-02-15  3:22 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-14 20:44 [PATCH 00/16] aacraid: Fixes and enhancements for arc family Raghava Aditya Renukunta
2017-02-14 20:44 ` [PATCH 01/16] aacraid: Fix camel case Raghava Aditya Renukunta
2017-02-15  8:02   ` Johannes Thumshirn
2017-02-14 20:44 ` [PATCH 02/16] aacraid: Use correct channel number for raw srb Raghava Aditya Renukunta
2017-02-15  8:03   ` Johannes Thumshirn
2017-02-14 20:44 ` Raghava Aditya Renukunta [this message]
2017-02-15  8:07   ` [PATCH 03/16] aacraid: Fix for excessive prints on EEH Johannes Thumshirn
2017-02-15 18:06     ` Raghava Aditya Renukunta
2017-02-14 20:44 ` [PATCH 04/16] aacraid: Prevent E3 lockup when deleting units Raghava Aditya Renukunta
2017-02-15  8:20   ` Johannes Thumshirn
2017-02-15 18:08     ` Raghava Aditya Renukunta
2017-02-16  7:40       ` Johannes Thumshirn
2017-02-14 20:44 ` [PATCH 05/16] aacraid: Fix memory leak in fib init path Raghava Aditya Renukunta
2017-02-15  8:31   ` Johannes Thumshirn
2017-02-15 18:08     ` Raghava Aditya Renukunta
2017-02-14 20:44 ` [PATCH 06/16] aacraid: Added sysfs for driver version Raghava Aditya Renukunta
2017-02-15  8:32   ` Johannes Thumshirn
2017-02-15 18:12     ` Raghava Aditya Renukunta
2017-02-16  7:43       ` Johannes Thumshirn
2017-02-16 19:38         ` Raghava Aditya Renukunta
2017-02-14 20:44 ` [PATCH 07/16] aacraid: Fix sync fibs time out on controller reset Raghava Aditya Renukunta
2017-02-15  8:34   ` Johannes Thumshirn
2017-02-14 20:44 ` [PATCH 08/16] aacraid: Skip wellness sync on controller failure Raghava Aditya Renukunta
2017-02-15  8:35   ` Johannes Thumshirn
2017-02-14 20:44 ` [PATCH 09/16] aacraid: Reload offlined drives after controller reset Raghava Aditya Renukunta
2017-02-15  8:38   ` Johannes Thumshirn
2017-02-14 20:44 ` [PATCH 10/16] aacraid: Terminate kthread on controller fw assert Raghava Aditya Renukunta
2017-02-15  8:44   ` Johannes Thumshirn
2017-02-15 22:22     ` Raghava Aditya Renukunta
2017-02-16  9:31       ` Johannes Thumshirn
2017-02-16 19:53         ` Raghava Aditya Renukunta
2017-02-14 20:44 ` [PATCH 11/16] aacraid: Decrease adapter health check interval Raghava Aditya Renukunta
2017-02-15  8:45   ` Johannes Thumshirn
2017-02-14 20:44 ` [PATCH 12/16] aacraid: Skip IOP reset on controller panic(SMART Family) Raghava Aditya Renukunta
2017-02-15  8:49   ` Johannes Thumshirn
2017-02-15 18:14     ` Raghava Aditya Renukunta
2017-02-14 20:44 ` [PATCH 13/16] aacraid: Reorder Adapter status check Raghava Aditya Renukunta
2017-02-15  8:50   ` Johannes Thumshirn
2017-02-14 20:44 ` [PATCH 14/16] aacraid: Save adapter fib log before an IOP reset Raghava Aditya Renukunta
2017-02-15  8:53   ` Johannes Thumshirn
2017-02-14 20:44 ` [PATCH 15/16] aacraid: Fix a potential spinlock double unlock bug Raghava Aditya Renukunta
2017-02-15  8:54   ` Johannes Thumshirn
2017-02-14 20:44 ` [PATCH 16/16] aacraid: Update driver version Raghava Aditya Renukunta
2017-02-15  8:55   ` Johannes Thumshirn

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=20170214204446.14808-4-RaghavaAditya.Renukunta@microsemi.com \
    --to=raghavaaditya.renukunta@microsemi.com \
    --cc=David.Carroll@microsemi.com \
    --cc=Gana.Sridaran@microsemi.com \
    --cc=Scott.Benesh@microsemi.com \
    --cc=dan.carpenter@oracle.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=jthumshirn@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.