scsi: aacraid: Multi controller Kdump IOP reset handling
Subsystems (2)
v2 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.
Changes in v2:
Respun patchset against Linus Master
Added Dave Carroll's reviewed-by tags
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 | 205 ++++++++++++++++++++++++++++++++++++++--- 2 files changed, 198 insertions(+), 12 deletions(-)
Signature · 1 line
2.9.4
PATCH v2 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.
---
Changes in V2:
Re based on Linus Master
drivers/scsi/aacraid/aacraid.h | 4 + drivers/scsi/aacraid/src.c | 161 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 159 insertions(+), 6 deletions(-)
drivers/scsi/aacraid/aacraid.h +4 -0
@@ -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_devu8 raw_io_64;u8 printf_enabled;u8 in_reset; +u8 in_soft_reset;u8 msi;u8 sa_firmware;int management_fib_count;
@@ -2504,6 +2506,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
@@ -2539,6 +2542,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 +155 -6
196 lines not on this page · raw message
Signature · 1 line
2.9.4
PATCH v2 2/3 scsi: aacraid: Preserve MSIX mode in the OMR register
In reply to Raghava Aditya RenukuntaPreserve the current MSIX mode value in the OMR before rewriting the OMR to initiate the IOP or Soft Reset.
---
Changes in V2:
Re based on Linus Master
drivers/scsi/aacraid/src.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
drivers/scsi/aacraid/src.c +22 -0
@@ -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
PATCH v2 3/3 scsi: aacraid: Auto detect INTx or MSIx mode during sync cmd processing
In reply to Raghava Aditya RenukuntaDuring 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.
---
Changes in V2:
Re based on Linus Master
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
@@ -1231,6 +1231,7 @@ struct src_registers {#define SRC_ODR_SHIFT 12#define SRC_IDR_SHIFT 9 +#define SRC_MSI_READ_MASK 0x1000typedef void (*fib_callback )(void *ctxt,struct fib *fibctx);
drivers/scsi/aacraid/src.c +16 -6
@@ -1405,13 +1405,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
Martin K. Petersen
AppliedRaghava,
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.
Applied to 4.17/scsi-queue. Thanks for rebasing!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering