Skip to contentSkip to conversation

scsi: aacraid: Multi controller Kdump IOP reset handling

PATCH Superseded Raghava Aditya Renukunta 3 participants 9 messages Jan 20, 2018 – Feb 7, 2018

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover scsi: aacraid: Multi controller Kdump IOP reset handling

During Kdump aacraid controller IOP reset is invoked, IOP reset takes approx 40 seconds to bring the controller back up and running. with timeout of 120 seconds and anything more than 2 controllers will cause kdump to timeout.

This patchset implements a new reset mechanism called DropIO, that induces the fw to drop any pending IO in the fw and making the reset process quicker.

Raghava Aditya Renukunta (3):
scsi: aacraid: Implement DropIO sync command
scsi: aacraid: Preserve MSIX mode in the OMR register
scsi: aacraid: Auto detect INTx or MSIx mode during sync cmd
processing

 drivers/scsi/aacraid/aacraid.h |   5 +
 drivers/scsi/aacraid/src.c     | 211 ++++++++++++++++++++++++++++++++++++++---
 2 files changed, 202 insertions(+), 14 deletions(-)
Signature · 1 line
2.9.4
#1 lore raw

PATCH 1/3 scsi: aacraid: Implement DropIO sync command

IOP_RESET takes longer time to complete, if controller is in a state where we can bring it back with init struct, controller DropIO sync command is implemented.

- If controller is faulted perform standard IOP_RESET in aac_srcv_init.
- If controller is not faulted get adapter properties and extended properties.
- Update the sa_firmware variable and determine if DropIO request is supported.
- Issue DropIO request, and get the number of outstanding commands.
- If all commands are complete with success (CT_OK), consider IOP_RESET is complete.
- If any commands timeout, Perform the IOP_RESET.

---
 drivers/scsi/aacraid/aacraid.h |   4 +
 drivers/scsi/aacraid/src.c     | 167 +++++++++++++++++++++++++++++++++++++++--
 2 files changed, 163 insertions(+), 8 deletions(-)
drivers/scsi/aacraid/aacraid.h +4 -0
index 3e8bfcf..784783b 100644
@@ -1528,6 +1528,7 @@ struct aac_bus_info_response {
 #define AAC_COMM_MESSAGE_TYPE3		5
 
 #define AAC_EXTOPT_SA_FIRMWARE		cpu_to_le32(1<<1)
+#define AAC_EXTOPT_SOFT_RESET		cpu_to_le32(1<<16)
 
 /* MSIX context */
 struct aac_msix_ctx {
@@ -1662,6 +1663,7 @@ struct aac_dev
 	u8			raw_io_64;
 	u8			printf_enabled;
 	u8			in_reset;
+	u8			in_soft_reset;
 	u8			msi;
 	u8			sa_firmware;
 	int			management_fib_count;
@@ -2502,6 +2504,7 @@ struct aac_hba_info {
 #define RCV_TEMP_READINGS		0x00000025
 #define GET_COMM_PREFERRED_SETTINGS	0x00000026
 #define IOP_RESET_FW_FIB_DUMP		0x00000034
+#define DROP_IO			0x00000035
 #define IOP_RESET			0x00001000
 #define IOP_RESET_ALWAYS		0x00001001
 #define RE_INIT_ADAPTER		0x000000ee
@@ -2537,6 +2540,7 @@ struct aac_hba_info {
 #define	FLASH_UPD_PENDING		0x00002000
 #define	FLASH_UPD_SUCCESS		0x00004000
 #define	FLASH_UPD_FAILED		0x00008000
+#define	INVALID_OMR			0xffffffff
 #define	FWUPD_TIMEOUT			(5 * 60)
 
 /*
drivers/scsi/aacraid/src.c +159 -8

201 lines not on this page · raw message

Signature · 1 line
2.9.4
Reviewed-by on v1 1/3
#2 lore raw

RE: [PATCH 1/3] scsi: aacraid: Implement DropIO sync command

Quoted 26 lines

-----Original Message-----
From: Raghava Aditya Renukunta [mailto:[email protected]]
Sent: Friday, January 19, 2018 6:02 PM
To: [email protected]; [email protected]; linux- [email protected]
Cc: Scott Benesh <[email protected]>; Tom White <[email protected]>; dl-esc-Aacraid Linux Driver <[email protected]>; Guilherme G . Piccoli <[email protected]>; Bart Van Assche <[email protected]>
Subject: [PATCH 1/3] scsi: aacraid: Implement DropIO sync command

IOP_RESET takes longer time to complete, if controller is in a state where we can bring it back with init struct, controller DropIO sync command is implemented.

- If controller is faulted perform standard IOP_RESET in aac_srcv_init.
- If controller is not faulted get adapter properties and extended properties.
- Update the sa_firmware variable and determine if DropIO request is supported.
- Issue DropIO request, and get the number of outstanding commands.
- If all commands are complete with success (CT_OK), consider IOP_RESET is complete.
- If any commands timeout, Perform the IOP_RESET.

Quoted 8 lines
Signed-off-by Raghava Aditya Renukunta

<[email protected]>

---
 drivers/scsi/aacraid/aacraid.h |   4 +
 drivers/scsi/aacraid/src.c     | 167
+++++++++++++++++++++++++++++++++++++++--
 2 files changed, 163 insertions(+), 8 deletions(-)
#3 lore raw

PATCH 2/3 scsi: aacraid: Preserve MSIX mode in the OMR register

In reply to Raghava Aditya Renukunta

Preserve the current MSIX mode value in the OMR before rewriting the OMR to initiate the IOP or Soft Reset.

---
 drivers/scsi/aacraid/src.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
drivers/scsi/aacraid/src.c +22 -0
index df98f37..b05c3cf 100644
@@ -680,6 +680,25 @@ void aac_set_intx_mode(struct aac_dev *dev)
 	}
 }
 
+static void aac_clear_omr(struct aac_dev *dev)
+{
+	u32 omr_value = 0;
+
+	omr_value = src_readl(dev, MUnit.OMR);
+
+	/*
+	 * Check for PCI Errors or Kernel Panic
+	 */
+	if ((omr_value == INVALID_OMR) || (omr_value & KERNEL_PANIC))
+		omr_value = 0;
+
+	/*
+	 * Preserve MSIX Value if any
+	 */
+	src_writel(dev, MUnit.OMR, omr_value & AAC_INT_MODE_MSIX);
+	src_readl(dev, MUnit.OMR);
+}
+
 static void aac_dump_fw_fib_iop_reset(struct aac_dev *dev)
 {
 	__le32 supported_options3;
@@ -740,6 +759,8 @@ static void aac_send_iop_reset(struct aac_dev *dev)
 
 	aac_set_intx_mode(dev);
 
+	aac_clear_omr(dev);
+
 	src_writel(dev, MUnit.IDR, IOP_SRC_RESET_MASK);
 
 	msleep(5000);
@@ -749,6 +770,7 @@ static void aac_send_hardware_soft_reset(struct aac_dev *dev)
 {
 	u_int32_t val;
 
+	aac_clear_omr(dev);
 	val = readl(((char *)(dev->base) + IBW_SWR_OFFSET));
 	val |= 0x01;
 	writel(val, ((char *)(dev->base) + IBW_SWR_OFFSET));
Signature · 1 line
2.9.4
Reviewed-by on v1 2/3
#4 lore raw

RE: [PATCH 2/3] scsi: aacraid: Preserve MSIX mode in the OMR register

Quoted 15 lines

-----Original Message-----
From: Raghava Aditya Renukunta [mailto:[email protected]]
Sent: Friday, January 19, 2018 6:02 PM
To: [email protected]; [email protected]; linux- [email protected]
Cc: Scott Benesh <[email protected]>; Tom White <[email protected]>; dl-esc-Aacraid Linux Driver <[email protected]>; Guilherme G . Piccoli <[email protected]>; Bart Van Assche <[email protected]>
Subject: [PATCH 2/3] scsi: aacraid: Preserve MSIX mode in the OMR register

Preserve the current MSIX mode value in the OMR before rewriting the OMR to initiate the IOP or Soft Reset.

Quoted 7 lines
Signed-off-by Raghava Aditya Renukunta

<[email protected]>

---
 drivers/scsi/aacraid/src.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
#5 lore raw

PATCH 3/3 scsi: aacraid: Auto detect INTx or MSIx mode during sync cmd processing

In reply to Raghava Aditya Renukunta

During sync command processing if legacy INTx status indicates command is not completed, sample the MSIx register and check if it indicates command completion, set controller MSIx enabled flag.

---
 drivers/scsi/aacraid/aacraid.h |  1 +
 drivers/scsi/aacraid/src.c     | 22 ++++++++++++++++------
 2 files changed, 17 insertions(+), 6 deletions(-)
drivers/scsi/aacraid/aacraid.h +1 -0
index 784783b..7834d09 100644
@@ -1231,6 +1231,7 @@ struct src_registers {
 
 #define SRC_ODR_SHIFT		12
 #define SRC_IDR_SHIFT		9
+#define SRC_MSI_READ_MASK	0x1000
 
 typedef void (*fib_callback)(void *ctxt, struct fib *fibctx);
 
drivers/scsi/aacraid/src.c +16 -6
index b05c3cf..f9600b6 100644
@@ -1399,13 +1399,23 @@ void aac_src_access_devreg(struct aac_dev *dev, int mode)
 
 static int aac_src_get_sync_status(struct aac_dev *dev)
 {
+	int msix_val = 0;
+	int legacy_val = 0;
 
-	int val;
+	msix_val = src_readl(dev, MUnit.ODR_MSI) & SRC_MSI_READ_MASK ? 1 : 0;
 
-	if (dev->msi_enabled)
-		val = src_readl(dev, MUnit.ODR_MSI) & 0x1000 ? 1 : 0;
-	else
-		val = src_readl(dev, MUnit.ODR_R) >> SRC_ODR_SHIFT;
+	if (!dev->msi_enabled) {
+		/*
+		 * if Legacy int status indicates cmd is not complete
+		 * sample MSIx register to see if it indiactes cmd complete,
+		 * if yes set the controller in MSIx mode and consider cmd
+		 * completed
+		 */
+		legacy_val = src_readl(dev, MUnit.ODR_R) >> SRC_ODR_SHIFT;
+		if (!(legacy_val & 1) && msix_val)
+			dev->msi_enabled = 1;
+		return legacy_val;
+	}
 
-	return val;
+	return msix_val;
 }
Signature · 1 line
2.9.4
Reviewed-by on v1 3/3
#6 lore raw

RE: [PATCH 3/3] scsi: aacraid: Auto detect INTx or MSIx mode during sync cmd processing

Quoted 13 lines

-----Original Message-----
From: Raghava Aditya Renukunta [mailto:[email protected]]
Sent: Friday, January 19, 2018 6:02 PM
To: [email protected]; [email protected]; linux- [email protected]
Cc: Scott Benesh <[email protected]>; Tom White <[email protected]>; dl-esc-Aacraid Linux Driver <[email protected]>; Guilherme G . Piccoli <[email protected]>; Bart Van Assche <[email protected]>
Subject: [PATCH 3/3] scsi: aacraid: Auto detect INTx or MSIx mode during sync cmd processing

Quoted 8 lines

During sync command processing if legacy INTx status indicates command is not completed, sample the MSIx register and check if it indicates command completion, set controller MSIx enabled flag.

Signed-off-by Raghava Aditya Renukunta

<[email protected]>
---

#7 lore raw
In reply to Raghava Aditya Renukunta

Raghava,

Quoted 8 lines

During Kdump aacraid controller IOP reset is invoked, IOP reset takes approx 40 seconds to bring the controller back up and running. with timeout of 120 seconds and anything more than 2 controllers will cause kdump to timeout.

This patchset implements a new reset mechanism called DropIO, that induces the fw to drop any pending IO in the fw and making the reset process quicker.

This series doesn't apply to my impending 4.17/scsi-queue. Since the latter won't exist until Linus releases rc1, please respin against current linus/master and resubmit.

Thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#8 lore raw
Quoted 27 lines

-----Original Message-----
From: [email protected] [mailto:linux-scsi- [email protected]] On Behalf Of Martin K. Petersen
Sent: Tuesday, February 6, 2018 4:21 PM
To: Raghava Aditya Renukunta <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; Scott Benesh <[email protected]>; Tom White <[email protected]>; dl-esc-Aacraid Linux Driver <[email protected]>; Guilherme G . Piccoli <[email protected]>; Bart Van Assche <[email protected]>
Subject: Re: [PATCH 0/3] scsi: aacraid: Multi controller Kdump IOP reset handling

EXTERNAL EMAIL

Raghava,

Quoted 5 lines

During Kdump aacraid controller IOP reset is invoked, IOP reset takes approx 40 seconds to bring the controller back up and running. with timeout of 120 seconds and anything more than 2 controllers will cause kdump to timeout.

Quoted 7 lines
Quoted 3 lines

This patchset implements a new reset mechanism called DropIO, that induces the fw to drop any pending IO in the fw and making the reset process quicker.

This series doesn't apply to my impending 4.17/scsi-queue. Since the latter won't exist until Linus releases rc1, please respin against current linus/master and resubmit.

Will do Martin.

Thanks,
Raghava Aditya

Quoted 3 lines

Thanks!
--
Martin K. Petersen Oracle Linux Engineering