aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_scsih.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index d0d66726ff69..c81e84291d2e 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -4308,11 +4308,43 @@ static void
4308_scsih_sas_device_status_change_event(struct MPT2SAS_ADAPTER *ioc, 4308_scsih_sas_device_status_change_event(struct MPT2SAS_ADAPTER *ioc,
4309 struct fw_event_work *fw_event) 4309 struct fw_event_work *fw_event)
4310{ 4310{
4311 struct MPT2SAS_TARGET *target_priv_data;
4312 struct _sas_device *sas_device;
4313 __le64 sas_address;
4314 unsigned long flags;
4315 Mpi2EventDataSasDeviceStatusChange_t *event_data =
4316 fw_event->event_data;
4317
4311#ifdef CONFIG_SCSI_MPT2SAS_LOGGING 4318#ifdef CONFIG_SCSI_MPT2SAS_LOGGING
4312 if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) 4319 if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK)
4313 _scsih_sas_device_status_change_event_debug(ioc, 4320 _scsih_sas_device_status_change_event_debug(ioc,
4314 fw_event->event_data); 4321 event_data);
4315#endif 4322#endif
4323
4324 if (!(event_data->ReasonCode ==
4325 MPI2_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET &&
4326 event_data->ReasonCode ==
4327 MPI2_EVENT_SAS_DEV_STAT_RC_CMP_INTERNAL_DEV_RESET))
4328 return;
4329
4330 spin_lock_irqsave(&ioc->sas_device_lock, flags);
4331 sas_address = le64_to_cpu(event_data->SASAddress);
4332 sas_device = mpt2sas_scsih_sas_device_find_by_sas_address(ioc,
4333 sas_address);
4334 spin_unlock_irqrestore(&ioc->sas_device_lock, flags);
4335
4336 if (!sas_device || !sas_device->starget)
4337 return;
4338
4339 target_priv_data = sas_device->starget->hostdata;
4340 if (!target_priv_data)
4341 return;
4342
4343 if (event_data->ReasonCode ==
4344 MPI2_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET)
4345 target_priv_data->tm_busy = 1;
4346 else
4347 target_priv_data->tm_busy = 0;
4316} 4348}
4317 4349
4318#ifdef CONFIG_SCSI_MPT2SAS_LOGGING 4350#ifdef CONFIG_SCSI_MPT2SAS_LOGGING