]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[SCSI] megaraid_sas: Add driver workaround for PERC5/1068 kdump kernel panic
authoradam radford <aradford@gmail.com>
Sun, 9 Oct 2011 01:15:19 +0000 (18:15 -0700)
committerJames Bottomley <JBottomley@Parallels.com>
Sun, 16 Oct 2011 16:22:05 +0000 (11:22 -0500)
The following patch for megaraid_sas adds a driver workaround for
PERC5/1068 based controller FW that keeps a command from the main
kernel that the driver cannot cancel which was causing a kernel panic
in shutdown of the kdump kernel.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/megaraid/megaraid_sas.h
drivers/scsi/megaraid/megaraid_sas_base.c

index 9ffb92daa58b172e821fbb16b517d7924b596938..7375fde2ab4f2343ded4ebb9f1a76f6746815986 100644 (file)
 #define MFI_CMD_ABORT                          0x06
 #define MFI_CMD_SMP                            0x07
 #define MFI_CMD_STP                            0x08
+#define MFI_CMD_INVALID                                0xff
 
 #define MR_DCMD_CTRL_GET_INFO                  0x01010000
 #define MR_DCMD_LD_GET_LIST                    0x03010000
index ec09d5c2ed90e521ce08a91a957847d8d77e99c1..de2f47c439c79d137a14df16fd227579818e44b2 100644 (file)
@@ -215,6 +215,10 @@ megasas_return_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd)
 
        cmd->scmd = NULL;
        cmd->frame_count = 0;
+       if ((instance->pdev->device != PCI_DEVICE_ID_LSI_FUSION) &&
+           (instance->pdev->device != PCI_DEVICE_ID_LSI_INVADER) &&
+           (reset_devices))
+               cmd->frame->hdr.cmd = MFI_CMD_INVALID;
        list_add_tail(&cmd->list, &instance->cmd_pool);
 
        spin_unlock_irqrestore(&instance->cmd_pool_lock, flags);
@@ -2165,7 +2169,16 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd,
                cmd->scmd->SCp.ptr = NULL;
 
        switch (hdr->cmd) {
-
+       case MFI_CMD_INVALID:
+               /* Some older 1068 controller FW may keep a pended
+                  MR_DCMD_CTRL_EVENT_GET_INFO left over from the main kernel
+                  when booting the kdump kernel.  Ignore this command to
+                  prevent a kernel panic on shutdown of the kdump kernel. */
+               printk(KERN_WARNING "megaraid_sas: MFI_CMD_INVALID command "
+                      "completed.\n");
+               printk(KERN_WARNING "megaraid_sas: If you have a controller "
+                      "other than PERC5, please upgrade your firmware.\n");
+               break;
        case MFI_CMD_PD_SCSI_IO:
        case MFI_CMD_LD_SCSI_IO:
 
@@ -2934,6 +2947,10 @@ static int megasas_create_frame_pool(struct megasas_instance *instance)
                memset(cmd->frame, 0, total_sz);
                cmd->frame->io.context = cmd->index;
                cmd->frame->io.pad_0 = 0;
+               if ((instance->pdev->device != PCI_DEVICE_ID_LSI_FUSION) &&
+                   (instance->pdev->device != PCI_DEVICE_ID_LSI_INVADER) &&
+                   (reset_devices))
+                       cmd->frame->hdr.cmd = MFI_CMD_INVALID;
        }
 
        return 0;