Patch to fix timeouts during multi-path failover with LSILogic adapter on RedHat 4.0 Update 3 & 4. Patch is needed for other distributions as well - for example current Linus's 2.6.19 kernel needs it. diff -urN linux-2.6.9.orig/drivers/message/fusion/mptbase.c linux-2.6.9/drivers/message/fusion/mptbase.c --- linux-2.6.9.orig/drivers/message/fusion/mptbase.c 2006-12-15 11:13:47.000000000 -0800 +++ linux-2.6.9/drivers/message/fusion/mptbase.c 2006-12-15 11:43:01.000000000 -0800 @@ -1435,12 +1435,21 @@ ioc->bus_type = SPI; /* 1030 Chip Fix. Disable Split transactions * for PCIX. Set MOST bits to zero if Rev < C0( = 8). + * + * Also detect VMware's LSILogic emulation - it does + * not have PCI-X capability at offset 0x68 (and does + * not need disabling split transactions although it + * reports itself as revision 1). */ pci_read_config_byte(pdev, PCI_CLASS_REVISION, &revision); if (revision < C0_1030) { - pci_read_config_byte(pdev, 0x6a, &pcixcmd); - pcixcmd &= 0x8F; - pci_write_config_byte(pdev, 0x6a, pcixcmd); + if (pci_find_capability(pdev, PCI_CAP_ID_PCIX) == 0x68) { + pci_read_config_byte(pdev, 0x6a, &pcixcmd); + pcixcmd &= 0x8F; + pci_write_config_byte(pdev, 0x6a, pcixcmd); + } else { + ioc->isVMware = 1; + } } } else if (pdev->device == MPI_MANUFACTPAGE_DEVID_1030_53C1035) { diff -urN linux-2.6.9.orig/drivers/message/fusion/mptbase.h linux-2.6.9/drivers/message/fusion/mptbase.h --- linux-2.6.9.orig/drivers/message/fusion/mptbase.h 2006-12-15 11:13:47.000000000 -0800 +++ linux-2.6.9/drivers/message/fusion/mptbase.h 2006-12-15 11:40:47.000000000 -0800 @@ -673,7 +673,8 @@ u8 upload_fw; /* If set, do a fw upload */ u8 reload_fw; /* Force a FW Reload on next reset */ u8 NBShiftFactor; /* NB Shift Factor based on Block Size (Facts) */ - u8 pad1[4]; + u8 isVMware; + u8 pad1[3]; int DoneCtx; int TaskCtx; int InternalCtx; diff -urN linux-2.6.9.orig/drivers/message/fusion/mptscsi.c linux-2.6.9/drivers/message/fusion/mptscsi.c --- linux-2.6.9.orig/drivers/message/fusion/mptscsi.c 2006-12-15 11:13:47.000000000 -0800 +++ linux-2.6.9/drivers/message/fusion/mptscsi.c 2006-12-15 11:49:18.000000000 -0800 @@ -773,7 +773,12 @@ sc->resid=0; case MPI_IOCSTATUS_SCSI_RECOVERED_ERROR: /* 0x0040 */ case MPI_IOCSTATUS_SUCCESS: /* 0x0000 */ - if (scsi_status == MPI_SCSI_STATUS_BUSY) + /* + * In the case of emulated adapter busy status may be reported + * for minutes when storage path switch occurs in the firmware. + * We definitely do not want to give up after standard timeout. + */ + if (scsi_status == MPI_SCSI_STATUS_BUSY && !ioc->isVMware) sc->result = (DID_BUS_BUSY << 16) | scsi_status; else sc->result = (DID_OK << 16) | scsi_status; @@ -810,6 +815,7 @@ * Not real sure here either so do nothing... */ } + /* Perhaps this wanted to test scsi_status and not sc->result? */ if (sc->result == MPI_SCSI_STATUS_TASK_SET_FULL) mptscsih_report_queue_full(sc, pScsiReply, pScsiReq);