diff options
author | Eric Moore <eric.moore@lsi.com> | 2007-06-15 19:27:21 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-06-17 17:11:49 -0400 |
commit | cc78d30af0823f33069fb4813c47571d4e0675a2 (patch) | |
tree | 547562aa89f1373684bcfd499146f3455429fc55 /drivers/message/fusion/mptscsih.c | |
parent | 958d4a32077f1d7d863e67f40f81c577c3c0c037 (diff) |
[SCSI] mpt fusion: fix for mounted raid volume filesytem that goes read-only
If there is IO going to the volume while a hidden disk is being torn down,
there is a case where we would return a DID_NO_CONNECT for IO sent to the
volume. The end result is the volume goes read-only. This problem is due to the
fact the firmware mapped target ids saved in per device object is phys_disk_num
for hidden raid components, and target_id for the volume. There is a single
case when both phys_disk_num and target_id are equal, so enters this issue. We
fix this issue by checking the tflags when the device is torned down,
insuring the IO being completed is meant for hidden raid component, not the
volume. In addition to this fix, there are a couple other cases to address
hidden raid components. For instance task_abort and device reset are not
supported by mpt fw for hidden raid components, a bus reset would be required
or target reset to volume.
Signed-off-by: Eric Moore <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/message/fusion/mptscsih.c')
-rw-r--r-- | drivers/message/fusion/mptscsih.c | 53 |
1 files changed, 45 insertions, 8 deletions
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index f0456d26a4af..d35617376f87 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c | |||
@@ -447,7 +447,12 @@ mptscsih_issue_sep_command(MPT_ADAPTER *ioc, VirtTarget *vtarget, | |||
447 | MPT_FRAME_HDR *mf; | 447 | MPT_FRAME_HDR *mf; |
448 | SEPRequest_t *SEPMsg; | 448 | SEPRequest_t *SEPMsg; |
449 | 449 | ||
450 | if (ioc->bus_type == FC) | 450 | if (ioc->bus_type != SAS) |
451 | return; | ||
452 | |||
453 | /* Not supported for hidden raid components | ||
454 | */ | ||
455 | if (vtarget->tflags & MPT_TARGET_FLAGS_RAID_COMPONENT) | ||
451 | return; | 456 | return; |
452 | 457 | ||
453 | if ((mf = mpt_get_msg_frame(ioc->InternalCtx, ioc)) == NULL) { | 458 | if ((mf = mpt_get_msg_frame(ioc->InternalCtx, ioc)) == NULL) { |
@@ -991,14 +996,19 @@ mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, VirtDevice *vdevice) | |||
991 | mf = (SCSIIORequest_t *)MPT_INDEX_2_MFPTR(hd->ioc, ii); | 996 | mf = (SCSIIORequest_t *)MPT_INDEX_2_MFPTR(hd->ioc, ii); |
992 | if (mf == NULL) | 997 | if (mf == NULL) |
993 | continue; | 998 | continue; |
999 | /* If the device is a hidden raid component, then its | ||
1000 | * expected that the mf->function will be RAID_SCSI_IO | ||
1001 | */ | ||
1002 | if (vdevice->vtarget->tflags & | ||
1003 | MPT_TARGET_FLAGS_RAID_COMPONENT && mf->Function != | ||
1004 | MPI_FUNCTION_RAID_SCSI_IO_PASSTHROUGH) | ||
1005 | continue; | ||
1006 | |||
994 | int_to_scsilun(vdevice->lun, &lun); | 1007 | int_to_scsilun(vdevice->lun, &lun); |
995 | if ((mf->Bus != vdevice->vtarget->channel) || | 1008 | if ((mf->Bus != vdevice->vtarget->channel) || |
996 | (mf->TargetID != vdevice->vtarget->id) || | 1009 | (mf->TargetID != vdevice->vtarget->id) || |
997 | memcmp(lun.scsi_lun, mf->LUN, 8)) | 1010 | memcmp(lun.scsi_lun, mf->LUN, 8)) |
998 | continue; | 1011 | continue; |
999 | dsprintk(( "search_running: found (sc=%p, mf = %p) " | ||
1000 | "channel %d id %d, lun %d \n", hd->ScsiLookup[ii], | ||
1001 | mf, mf->Bus, mf->TargetID, vdevice->lun)); | ||
1002 | 1012 | ||
1003 | /* Cleanup | 1013 | /* Cleanup |
1004 | */ | 1014 | */ |
@@ -1008,9 +1018,11 @@ mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, VirtDevice *vdevice) | |||
1008 | if ((unsigned char *)mf != sc->host_scribble) | 1018 | if ((unsigned char *)mf != sc->host_scribble) |
1009 | continue; | 1019 | continue; |
1010 | scsi_dma_unmap(sc); | 1020 | scsi_dma_unmap(sc); |
1011 | |||
1012 | sc->host_scribble = NULL; | 1021 | sc->host_scribble = NULL; |
1013 | sc->result = DID_NO_CONNECT << 16; | 1022 | sc->result = DID_NO_CONNECT << 16; |
1023 | dsprintk(( "search_running: found (sc=%p, mf = %p) " | ||
1024 | "channel %d id %d, lun %d \n", sc, mf, | ||
1025 | vdevice->vtarget->channel, vdevice->vtarget->id, vdevice->lun)); | ||
1014 | sc->scsi_done(sc); | 1026 | sc->scsi_done(sc); |
1015 | } | 1027 | } |
1016 | } | 1028 | } |
@@ -1756,6 +1768,16 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) | |||
1756 | goto out; | 1768 | goto out; |
1757 | } | 1769 | } |
1758 | 1770 | ||
1771 | /* Task aborts are not supported for hidden raid components. | ||
1772 | */ | ||
1773 | if (vdevice->vtarget->tflags & MPT_TARGET_FLAGS_RAID_COMPONENT) { | ||
1774 | dtmprintk((MYIOC_s_DEBUG_FMT "task abort: hidden raid " | ||
1775 | "component (sc=%p)\n", ioc->name, SCpnt)); | ||
1776 | SCpnt->result = DID_RESET << 16; | ||
1777 | retval = FAILED; | ||
1778 | goto out; | ||
1779 | } | ||
1780 | |||
1759 | /* Find this command | 1781 | /* Find this command |
1760 | */ | 1782 | */ |
1761 | if ((scpnt_idx = SCPNT_TO_LOOKUP_IDX(SCpnt)) < 0) { | 1783 | if ((scpnt_idx = SCPNT_TO_LOOKUP_IDX(SCpnt)) < 0) { |
@@ -1849,6 +1871,13 @@ mptscsih_dev_reset(struct scsi_cmnd * SCpnt) | |||
1849 | goto out; | 1871 | goto out; |
1850 | } | 1872 | } |
1851 | 1873 | ||
1874 | /* Target reset to hidden raid component is not supported | ||
1875 | */ | ||
1876 | if (vdevice->vtarget->tflags & MPT_TARGET_FLAGS_RAID_COMPONENT) { | ||
1877 | retval = FAILED; | ||
1878 | goto out; | ||
1879 | } | ||
1880 | |||
1852 | retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET, | 1881 | retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET, |
1853 | vdevice->vtarget->channel, vdevice->vtarget->id, 0, 0, | 1882 | vdevice->vtarget->channel, vdevice->vtarget->id, 0, 0, |
1854 | mptscsih_get_tm_timeout(ioc)); | 1883 | mptscsih_get_tm_timeout(ioc)); |
@@ -3131,6 +3160,16 @@ mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, VirtDevice *vdevice) | |||
3131 | { | 3160 | { |
3132 | INTERNAL_CMD iocmd; | 3161 | INTERNAL_CMD iocmd; |
3133 | 3162 | ||
3163 | /* Ignore hidden raid components, this is handled when the command | ||
3164 | * is sent to the volume | ||
3165 | */ | ||
3166 | if (vdevice->vtarget->tflags & MPT_TARGET_FLAGS_RAID_COMPONENT) | ||
3167 | return; | ||
3168 | |||
3169 | if (vdevice->vtarget->type != TYPE_DISK || vdevice->vtarget->deleted || | ||
3170 | !vdevice->configured_lun) | ||
3171 | return; | ||
3172 | |||
3134 | /* Following parameters will not change | 3173 | /* Following parameters will not change |
3135 | * in this routine. | 3174 | * in this routine. |
3136 | */ | 3175 | */ |
@@ -3145,9 +3184,7 @@ mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, VirtDevice *vdevice) | |||
3145 | iocmd.id = vdevice->vtarget->id; | 3184 | iocmd.id = vdevice->vtarget->id; |
3146 | iocmd.lun = vdevice->lun; | 3185 | iocmd.lun = vdevice->lun; |
3147 | 3186 | ||
3148 | if ((vdevice->vtarget->type == TYPE_DISK) && | 3187 | mptscsih_do_cmd(hd, &iocmd); |
3149 | (vdevice->configured_lun)) | ||
3150 | mptscsih_do_cmd(hd, &iocmd); | ||
3151 | } | 3188 | } |
3152 | 3189 | ||
3153 | EXPORT_SYMBOL(mptscsih_remove); | 3190 | EXPORT_SYMBOL(mptscsih_remove); |