summaryrefslogtreecommitdiff
path: root/drivers/message/fusion/mptscsih.c
diff options
context:
space:
mode:
authorKashyap, Desai <kashyap.desai@lsi.com>2009-09-02 11:45:53 +0530
committerJames Bottomley <James.Bottomley@suse.de>2009-09-12 09:35:28 -0500
commitfea984034b1ccdb26e8163ed5350ce7f0563b136 (patch)
tree5f688a19ba6cd76cd304862e8acdfae1ede3e214 /drivers/message/fusion/mptscsih.c
parentc55b89fba9872ebcd5ac15cdfdad29ffb89329f0 (diff)
[SCSI] mptsas : Send DID_NO_CONNECT for pending IOs of removed device
Driver is modified to return DID_NO_CONNECT for all pending I/O requests for bus type SAS, if it founds the target is removed at the firmware level. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/message/fusion/mptscsih.c')
-rw-r--r--drivers/message/fusion/mptscsih.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index 0e402eb95716..c29578614504 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -628,6 +628,16 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
return 1;
}
+ if (ioc->bus_type == SAS) {
+ VirtDevice *vdevice = sc->device->hostdata;
+
+ if (!vdevice || !vdevice->vtarget ||
+ vdevice->vtarget->deleted) {
+ sc->result = DID_NO_CONNECT << 16;
+ goto out;
+ }
+ }
+
sc->host_scribble = NULL;
sc->result = DID_OK << 16; /* Set default reply as OK */
pScsiReq = (SCSIIORequest_t *) mf;
@@ -892,7 +902,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
#endif
} /* end of address reply case */
-
+out:
/* Unmap the DMA buffers, if any. */
scsi_dma_unmap(sc);