scsi: smartpqi: add in controller checkpoint for controller lockups.
authorKevin Barnett <kevin.barnett@hpe.com>
Wed, 3 May 2017 23:52:40 +0000 (18:52 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 13 Jun 2017 00:48:02 +0000 (20:48 -0400)
tell smartpqi controller to generate a checkpoint for rare lockup
conditions.

Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/smartpqi/smartpqi.h
drivers/scsi/smartpqi/smartpqi_init.c
drivers/scsi/smartpqi/smartpqi_sis.c
drivers/scsi/smartpqi/smartpqi_sis.h

index b673825f46b51a8a90b2da929c09cb553de935f5..73754caa016116fc8a7e64cd8f12f34479c387f9 100644 (file)
@@ -933,10 +933,10 @@ struct pqi_ctrl_info {
        struct Scsi_Host *scsi_host;
 
        struct mutex    scan_mutex;
+       bool            controller_online : 1;
        u8              inbound_spanning_supported : 1;
        u8              outbound_spanning_supported : 1;
        u8              pqi_mode_enabled : 1;
-       u8              controller_online : 1;
        u8              heartbeat_timer_started : 1;
 
        struct list_head scsi_device_list;
index 735cef55d3a21f17ebbca3df4eec8c01b7bed2ba..14d74e157eb54ff8c69d74ac5f9f2d751b08800c 100644 (file)
@@ -2697,6 +2697,7 @@ static void pqi_take_ctrl_offline(struct pqi_ctrl_info *ctrl_info)
 
        ctrl_info->controller_online = false;
        dev_err(&ctrl_info->pci_dev->dev, "controller offline\n");
+       sis_shutdown_ctrl(ctrl_info);
 
        for (i = 0; i < ctrl_info->num_queue_groups; i++) {
                queue_group = &ctrl_info->queue_groups[i];
index 71408f9e8f758804d93d0f45a1cd0d2bdee47656..c7d9ea10b02a6ecb7639c536bad72ac6bebe0646 100644 (file)
@@ -34,6 +34,7 @@
 #define SIS_REENABLE_SIS_MODE                  0x1
 #define SIS_ENABLE_MSIX                                0x40
 #define SIS_SOFT_RESET                         0x100
+#define SIS_TRIGGER_SHUTDOWN                   0x800000
 #define SIS_CMD_READY                          0x200
 #define SIS_CMD_COMPLETE                       0x1000
 #define SIS_CLEAR_CTRL_TO_HOST_DOORBELL                0x1000
@@ -342,6 +343,12 @@ void sis_soft_reset(struct pqi_ctrl_info *ctrl_info)
                &ctrl_info->registers->sis_host_to_ctrl_doorbell);
 }
 
+void sis_shutdown_ctrl(struct pqi_ctrl_info *ctrl_info)
+{
+       writel(SIS_TRIGGER_SHUTDOWN,
+               &ctrl_info->registers->sis_host_to_ctrl_doorbell);
+}
+
 #define SIS_MODE_READY_TIMEOUT_SECS    30
 
 int sis_reenable_sis_mode(struct pqi_ctrl_info *ctrl_info)
index bd6e7b08338e42e59304de0de3a415a5cccc90aa..7f7b68ca0bd26960b9a4ce93f654a6ce39e14ca1 100644 (file)
@@ -27,6 +27,7 @@ int sis_init_base_struct_addr(struct pqi_ctrl_info *ctrl_info);
 void sis_enable_msix(struct pqi_ctrl_info *ctrl_info);
 void sis_disable_msix(struct pqi_ctrl_info *ctrl_info);
 void sis_soft_reset(struct pqi_ctrl_info *ctrl_info);
+void sis_shutdown_ctrl(struct pqi_ctrl_info *ctrl_info);
 int sis_reenable_sis_mode(struct pqi_ctrl_info *ctrl_info);
 void sis_write_driver_scratch(struct pqi_ctrl_info *ctrl_info, u32 value);
 u32 sis_read_driver_scratch(struct pqi_ctrl_info *ctrl_info);