]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
scsi: aacraid: Save adapter fib log before an IOP reset
authorRaghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Thu, 16 Feb 2017 20:51:22 +0000 (12:51 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 22 Feb 2017 23:41:42 +0000 (18:41 -0500)
Currently  the adapter firmware does not save outstanding I/O's log
information  when an IOP reset is triggered. This is problematic when
trying to root cause and debug issues.

Fixed by adding sync command to trigger I/O log file save in the adapter
firmware before issuing an IOP reset.

Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
Reviewed-by: David Carroll <David.Carroll@microsemi.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/aacraid/aachba.c
drivers/scsi/aacraid/aacraid.h
drivers/scsi/aacraid/src.c

index 3ede50f25f46c72796fa094e222247302979e6e6..e3e93def722b045b4c690d5c9490173e2bee5665 100644 (file)
@@ -294,6 +294,10 @@ MODULE_PARM_DESC(aif_timeout, "The duration of time in seconds to wait for"
        "deregistering them. This is typically adjusted for heavily burdened"
        " systems.");
 
+int aac_fib_dump;
+module_param(aac_fib_dump, int, 0644);
+MODULE_PARM_DESC(aac_fib_dump, "Dump controller fibs prior to IOP_RESET 0=off, 1=on");
+
 int numacb = -1;
 module_param(numacb, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(numacb, "Request a limit to the number of adapter control"
index 9281e7295480717e7e6973ee36c9af10f66521da..622fd69b35ccb15aa4cd3cfa8f0cea7748899e51 100644 (file)
@@ -1444,6 +1444,10 @@ struct aac_supplement_adapter_info
 #define AAC_OPTION_VARIABLE_BLOCK_SIZE cpu_to_le32(0x00040000)
 /* 240 simple volume support */
 #define AAC_OPTION_SUPPORTED_240_VOLUMES cpu_to_le32(0x10000000)
+/*
+ * Supports FIB dump sync command send prior to IOP_RESET
+ */
+#define AAC_OPTION_SUPPORTED3_IOP_RESET_FIB_DUMP       cpu_to_le32(0x00004000)
 #define AAC_SIS_VERSION_V3     3
 #define AAC_SIS_SLOT_UNKNOWN   0xFF
 
@@ -2483,6 +2487,7 @@ struct aac_hba_info {
 #define GET_DRIVER_BUFFER_PROPERTIES   0x00000023
 #define RCV_TEMP_READINGS              0x00000025
 #define GET_COMM_PREFERRED_SETTINGS    0x00000026
+#define IOP_RESET_FW_FIB_DUMP          0x00000034
 #define IOP_RESET                      0x00001000
 #define IOP_RESET_ALWAYS               0x00001001
 #define RE_INIT_ADAPTER                        0x000000ee
@@ -2686,4 +2691,5 @@ extern int aac_commit;
 extern int update_interval;
 extern int check_interval;
 extern int aac_check_reset;
+extern int aac_fib_dump;
 #endif
index 71aaabde6b573be4b93f862dc192a5044b131bc2..2e5338dec621fbff89c8a68acc3ba241173f3239 100644 (file)
@@ -679,10 +679,27 @@ void aac_set_intx_mode(struct aac_dev *dev)
        }
 }
 
+static void aac_dump_fw_fib_iop_reset(struct aac_dev *dev)
+{
+       __le32 supported_options3;
+
+       if (!aac_fib_dump)
+               return;
+
+       supported_options3  = dev->supplement_adapter_info.supported_options3;
+       if (!(supported_options3 & AAC_OPTION_SUPPORTED3_IOP_RESET_FIB_DUMP))
+               return;
+
+       aac_adapter_sync_cmd(dev, IOP_RESET_FW_FIB_DUMP,
+                       0, 0, 0,  0, 0, 0, NULL, NULL, NULL, NULL, NULL);
+}
+
 static void aac_send_iop_reset(struct aac_dev *dev, int bled)
 {
        u32 var, reset_mask;
 
+       aac_dump_fw_fib_iop_reset(dev);
+
        bled = aac_adapter_sync_cmd(dev, IOP_RESET_ALWAYS,
                                    0, 0, 0, 0, 0, 0, &var,
                                    &reset_mask, NULL, NULL, NULL);