aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message
diff options
context:
space:
mode:
authorMoore, Eric <Eric.Moore@lsil.com>2006-01-25 20:05:12 -0500
committerJames Bottomley <jejb@mulgrave.(none)>2006-01-31 15:39:38 -0500
commit7d3eecf7b2195c64d26f7e7d105d00e5a6dd702e (patch)
tree9de227b1c38f68e6c7312e85028ebb734457c7cd /drivers/message
parentc73787eecdbe4691d4e3f989052db8b552e1ac34 (diff)
[SCSI] fusion: target reset when drive is being removed
The issuing of the target reset used in device hot removal case so the firmware queue is flushed out off outstanding commands. Signed-off-by: Eric Moore <Eric.Moore@lsil.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/message')
-rw-r--r--drivers/message/fusion/mptsas.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 8e77837c07ec..190bd940bb01 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -324,6 +324,7 @@ mptsas_slave_destroy(struct scsi_device *sdev)
324 struct sas_rphy *rphy; 324 struct sas_rphy *rphy;
325 struct mptsas_portinfo *p; 325 struct mptsas_portinfo *p;
326 int i; 326 int i;
327 VirtDevice *vdev;
327 328
328 /* 329 /*
329 * Handle hotplug removal case. 330 * Handle hotplug removal case.
@@ -347,8 +348,29 @@ mptsas_slave_destroy(struct scsi_device *sdev)
347 out: 348 out:
348 mutex_unlock(&hd->ioc->sas_topology_mutex); 349 mutex_unlock(&hd->ioc->sas_topology_mutex);
349 /* 350 /*
350 * TODO: Issue target reset to flush firmware outstanding commands. 351 * Issue target reset to flush firmware outstanding commands.
351 */ 352 */
353 vdev = sdev->hostdata;
354 if (vdev->configured_lun){
355 if (mptscsih_TMHandler(hd,
356 MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET,
357 vdev->bus_id,
358 vdev->target_id,
359 0, 0, 5 /* 5 second timeout */)
360 < 0){
361
362 /* The TM request failed!
363 * Fatal error case.
364 */
365 printk(MYIOC_s_WARN_FMT
366 "Error processing TaskMgmt id=%d TARGET_RESET\n",
367 hd->ioc->name,
368 vdev->target_id);
369
370 hd->tmPending = 0;
371 hd->tmState = TM_STATE_NONE;
372 }
373 }
352 mptscsih_slave_destroy(sdev); 374 mptscsih_slave_destroy(sdev);
353} 375}
354 376