diff options
Diffstat (limited to 'drivers/scsi/mpt2sas')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_scsih.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c index f2d967c5415e..4dffbec79355 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c +++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c | |||
@@ -516,12 +516,8 @@ _scsih_sas_device_add(struct MPT2SAS_ADAPTER *ioc, | |||
516 | handle = sas_device->handle; | 516 | handle = sas_device->handle; |
517 | parent_handle = sas_device->parent_handle; | 517 | parent_handle = sas_device->parent_handle; |
518 | sas_address = sas_device->sas_address; | 518 | sas_address = sas_device->sas_address; |
519 | if (!mpt2sas_transport_port_add(ioc, handle, parent_handle)) { | 519 | if (!mpt2sas_transport_port_add(ioc, handle, parent_handle)) |
520 | _scsih_sas_device_remove(ioc, sas_device); | 520 | _scsih_sas_device_remove(ioc, sas_device); |
521 | } else if (!sas_device->starget) { | ||
522 | mpt2sas_transport_port_remove(ioc, sas_address, parent_handle); | ||
523 | _scsih_sas_device_remove(ioc, sas_device); | ||
524 | } | ||
525 | } | 521 | } |
526 | 522 | ||
527 | /** | 523 | /** |
@@ -1203,7 +1199,9 @@ scsih_target_destroy(struct scsi_target *starget) | |||
1203 | rphy = dev_to_rphy(starget->dev.parent); | 1199 | rphy = dev_to_rphy(starget->dev.parent); |
1204 | sas_device = mpt2sas_scsih_sas_device_find_by_sas_address(ioc, | 1200 | sas_device = mpt2sas_scsih_sas_device_find_by_sas_address(ioc, |
1205 | rphy->identify.sas_address); | 1201 | rphy->identify.sas_address); |
1206 | if (sas_device) | 1202 | if (sas_device && (sas_device->starget == starget) && |
1203 | (sas_device->id == starget->id) && | ||
1204 | (sas_device->channel == starget->channel)) | ||
1207 | sas_device->starget = NULL; | 1205 | sas_device->starget = NULL; |
1208 | 1206 | ||
1209 | spin_unlock_irqrestore(&ioc->sas_device_lock, flags); | 1207 | spin_unlock_irqrestore(&ioc->sas_device_lock, flags); |
@@ -3924,7 +3922,7 @@ _scsih_sas_broadcast_primative_event(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, | |||
3924 | 3922 | ||
3925 | mpt2sas_scsih_issue_tm(ioc, handle, lun, | 3923 | mpt2sas_scsih_issue_tm(ioc, handle, lun, |
3926 | MPI2_SCSITASKMGMT_TASKTYPE_QUERY_TASK, smid, 30); | 3924 | MPI2_SCSITASKMGMT_TASKTYPE_QUERY_TASK, smid, 30); |
3927 | termination_count += le32_to_cpu(mpi_reply->TerminationCount); | 3925 | ioc->tm_cmds.status = MPT2_CMD_NOT_USED; |
3928 | 3926 | ||
3929 | if ((mpi_reply->IOCStatus == MPI2_IOCSTATUS_SUCCESS) && | 3927 | if ((mpi_reply->IOCStatus == MPI2_IOCSTATUS_SUCCESS) && |
3930 | (mpi_reply->ResponseCode == | 3928 | (mpi_reply->ResponseCode == |
@@ -3934,10 +3932,10 @@ _scsih_sas_broadcast_primative_event(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, | |||
3934 | continue; | 3932 | continue; |
3935 | 3933 | ||
3936 | mpt2sas_scsih_issue_tm(ioc, handle, lun, | 3934 | mpt2sas_scsih_issue_tm(ioc, handle, lun, |
3937 | MPI2_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET, smid, 30); | 3935 | MPI2_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET, 0, 30); |
3936 | ioc->tm_cmds.status = MPT2_CMD_NOT_USED; | ||
3938 | termination_count += le32_to_cpu(mpi_reply->TerminationCount); | 3937 | termination_count += le32_to_cpu(mpi_reply->TerminationCount); |
3939 | } | 3938 | } |
3940 | ioc->tm_cmds.status = MPT2_CMD_NOT_USED; | ||
3941 | ioc->broadcast_aen_busy = 0; | 3939 | ioc->broadcast_aen_busy = 0; |
3942 | mutex_unlock(&ioc->tm_cmds.mutex); | 3940 | mutex_unlock(&ioc->tm_cmds.mutex); |
3943 | 3941 | ||