From: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
To: JBottomley@odin.com, linux-scsi@vger.kernel.org,
martin.petersen@oracle.com
Cc: aacraid@pmc-sierra.com, gana.sridaran@microsemi.com,
scott.benesh@microsemi.com, vishal.josemannanal@microsemi.com,
RaghavaAditya.Renukunta@microsemi.com
Subject: [PATCH 09/10] aacraid: Fix for KDUMP driver hang
Date: Mon, 25 Apr 2016 23:32:37 -0700 [thread overview]
Message-ID: <20160426063237.28402.20267.stgit@pmcuser-System-Product-Name> (raw)
In-Reply-To: <20160426062414.28402.69178.stgit@pmcuser-System-Product-Name>
When KDUMP is triggered the driver first talks to the firmware in INTX
mode, but the adapter firmware is still in MSIX mode. Therefore the first
driver command hangs since the driver is waiting for an INTX response and
firmware gives a MSIX response. If when the OS is installed on a RAID
drive created by the adapter KDUMP will hang since the driver does not
receive a response in sync mode.
Fixed by: Change the firmware to INTX mode if it is in MSIX mode before
sending the first sync command.
Cc: stable@vger.kernel.org
Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
---
drivers/scsi/aacraid/aacraid.h | 1 +
drivers/scsi/aacraid/comminit.c | 24 ++++++++++++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index b70f3eb..0ba8f61 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -29,6 +29,7 @@ enum {
#define AAC_INT_MODE_MSI (1<<1)
#define AAC_INT_MODE_AIF (1<<2)
#define AAC_INT_MODE_SYNC (1<<3)
+#define AAC_INT_MODE_MSIX (1<<16)
#define AAC_INT_ENABLE_TYPE1_INTX 0xfffffffb
#define AAC_INT_ENABLE_TYPE1_MSIX 0xfffffffa
diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c
index 50d521a..341ea32 100644
--- a/drivers/scsi/aacraid/comminit.c
+++ b/drivers/scsi/aacraid/comminit.c
@@ -37,6 +37,7 @@
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <linux/blkdev.h>
+#include <linux/delay.h>
#include <linux/completion.h>
#include <linux/mm.h>
#include <scsi/scsi_host.h>
@@ -47,6 +48,20 @@ struct aac_common aac_config = {
.irq_mod = 1
};
+static inline int aac_is_msix_mode(struct aac_dev *dev)
+{
+ u32 status;
+
+ status = src_readl(dev, MUnit.OMR);
+ return (status & AAC_INT_MODE_MSIX);
+}
+
+static inline void aac_change_to_intx(struct aac_dev *dev)
+{
+ aac_src_access_devreg(dev, AAC_DISABLE_MSIX);
+ aac_src_access_devreg(dev, AAC_ENABLE_INTX);
+}
+
static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long commsize, unsigned long commalign)
{
unsigned char *base;
@@ -414,6 +429,15 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
dev->comm_interface = AAC_COMM_PRODUCER;
dev->raw_io_interface = dev->raw_io_64 = 0;
+
+ /*
+ * Enable INTX mode, if not done already Enabled
+ */
+ if (aac_is_msix_mode(dev)) {
+ aac_change_to_intx(dev);
+ dev_info(&dev->pdev->dev, "Changed firmware to INTX mode");
+ }
+
if ((!aac_adapter_sync_cmd(dev, GET_ADAPTER_PROPERTIES,
0, 0, 0, 0, 0, 0,
status+0, status+1, status+2, status+3, NULL)) &&
next prev parent reply other threads:[~2016-04-26 6:35 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-26 6:30 [PATCH 00/10] aacraid: Patchset for aacraid driver version 41066 Raghava Aditya Renukunta
2016-04-26 6:30 ` [PATCH 01/10] aacraid: Removed unnecessary checks for NULL Raghava Aditya Renukunta
2016-04-26 6:31 ` [PATCH 02/10] aacraid: Fix incorrectly named MACRO Raghava Aditya Renukunta
2016-04-27 9:14 ` Johannes Thumshirn
2016-04-26 6:31 ` [PATCH 03/10] aacraid: Start adapter after updating number of MSIX vectors Raghava Aditya Renukunta
2016-04-27 9:14 ` Johannes Thumshirn
2016-04-26 6:31 ` [PATCH 04/10] aacraid: Relinquish CPU during timeout wait Raghava Aditya Renukunta
2016-04-27 9:31 ` Johannes Thumshirn
2016-04-26 6:31 ` [PATCH 05/10] aacraid: Disable MSI mode for series 6, 7, 8 cards Raghava Aditya Renukunta
2016-04-27 9:16 ` Johannes Thumshirn
2016-04-26 6:31 ` [PATCH 06/10] aacraid: Fix for aac_command_thread hang Raghava Aditya Renukunta
2016-04-27 9:32 ` Johannes Thumshirn
2016-04-26 6:32 ` [PATCH 07/10] aacraid: Log firmware AIF messages Raghava Aditya Renukunta
2016-04-27 9:21 ` Johannes Thumshirn
2016-04-26 6:32 ` [PATCH 08/10] aacraid: Remove code to needlessly complete fib Raghava Aditya Renukunta
2016-04-27 9:24 ` Johannes Thumshirn
2016-04-27 16:34 ` Raghava Aditya Renukunta
2016-04-28 7:47 ` Johannes Thumshirn
2016-04-26 6:32 ` Raghava Aditya Renukunta [this message]
2016-04-27 9:29 ` [PATCH 09/10] aacraid: Fix for KDUMP driver hang Johannes Thumshirn
2016-04-27 16:49 ` Raghava Aditya Renukunta
2016-04-28 7:49 ` Johannes Thumshirn
2016-04-26 6:32 ` [PATCH 10/10] aacraid: Update driver version Raghava Aditya Renukunta
2016-04-27 9:30 ` Johannes Thumshirn
2016-04-29 23:15 ` [PATCH 00/10] aacraid: Patchset for aacraid driver version 41066 Martin K. Petersen
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=20160426063237.28402.20267.stgit@pmcuser-System-Product-Name \
--to=raghavaaditya.renukunta@microsemi.com \
--cc=JBottomley@odin.com \
--cc=aacraid@pmc-sierra.com \
--cc=gana.sridaran@microsemi.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=scott.benesh@microsemi.com \
--cc=vishal.josemannanal@microsemi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox