aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion/mptsas.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/message/fusion/mptsas.c')
-rw-r--r--drivers/message/fusion/mptsas.c37
1 files changed, 31 insertions, 6 deletions
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 3efa728fc590..eb6b10eb11d2 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -553,15 +553,21 @@ mptsas_target_reset(MPT_ADAPTER *ioc, u8 channel, u8 id)
553{ 553{
554 MPT_FRAME_HDR *mf; 554 MPT_FRAME_HDR *mf;
555 SCSITaskMgmt_t *pScsiTm; 555 SCSITaskMgmt_t *pScsiTm;
556 if (mpt_set_taskmgmt_in_progress_flag(ioc) != 0)
557 return 0;
558
556 559
557 mf = mpt_get_msg_frame(mptsasDeviceResetCtx, ioc); 560 mf = mpt_get_msg_frame(mptsasDeviceResetCtx, ioc);
558 if (mf == NULL) { 561 if (mf == NULL) {
559 dfailprintk(ioc, printk(MYIOC_s_WARN_FMT 562 dfailprintk(ioc, printk(MYIOC_s_WARN_FMT
560 "%s, no msg frames @%d!!\n", 563 "%s, no msg frames @%d!!\n", ioc->name,
561 ioc->name, __func__, __LINE__)); 564 __func__, __LINE__));
562 return 0; 565 goto out_fail;
563 } 566 }
564 567
568 dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT "TaskMgmt request (mf=%p)\n",
569 ioc->name, mf));
570
565 /* Format the Request 571 /* Format the Request
566 */ 572 */
567 pScsiTm = (SCSITaskMgmt_t *) mf; 573 pScsiTm = (SCSITaskMgmt_t *) mf;
@@ -574,9 +580,18 @@ mptsas_target_reset(MPT_ADAPTER *ioc, u8 channel, u8 id)
574 580
575 DBG_DUMP_TM_REQUEST_FRAME(ioc, (u32 *)mf); 581 DBG_DUMP_TM_REQUEST_FRAME(ioc, (u32 *)mf);
576 582
583 dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT
584 "TaskMgmt type=%d (sas device delete) fw_channel = %d fw_id = %d)\n",
585 ioc->name, MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET, channel, id));
586
577 mpt_put_msg_frame_hi_pri(mptsasDeviceResetCtx, ioc, mf); 587 mpt_put_msg_frame_hi_pri(mptsasDeviceResetCtx, ioc, mf);
578 588
579 return 1; 589 return 1;
590
591 out_fail:
592
593 mpt_clear_taskmgmt_in_progress_flag(ioc);
594 return 0;
580} 595}
581 596
582/** 597/**
@@ -719,9 +734,12 @@ mptsas_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
719 if (!ev) { 734 if (!ev) {
720 dfailprintk(ioc, printk(MYIOC_s_WARN_FMT "%s, failed to allocate mem @%d..!!\n", 735 dfailprintk(ioc, printk(MYIOC_s_WARN_FMT "%s, failed to allocate mem @%d..!!\n",
721 ioc->name,__func__, __LINE__)); 736 ioc->name,__func__, __LINE__));
722 return 0; 737 goto out_fail;
723 } 738 }
724 739
740 dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT "TaskMgmt request (mf=%p)\n",
741 ioc->name, mf));
742
725 INIT_WORK(&ev->work, mptsas_hotplug_work); 743 INIT_WORK(&ev->work, mptsas_hotplug_work);
726 ev->ioc = ioc; 744 ev->ioc = ioc;
727 ev->handle = le16_to_cpu(sas_event_data->DevHandle); 745 ev->handle = le16_to_cpu(sas_event_data->DevHandle);
@@ -734,10 +752,19 @@ mptsas_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
734 sizeof(__le64)); 752 sizeof(__le64));
735 ev->sas_address = le64_to_cpu(sas_address); 753 ev->sas_address = le64_to_cpu(sas_address);
736 ev->device_info = le32_to_cpu(sas_event_data->DeviceInfo); 754 ev->device_info = le32_to_cpu(sas_event_data->DeviceInfo);
755 dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT
756 "TaskMgmt type=%d (sas device delete) fw_channel = %d fw_id = %d)\n",
757 ioc->name, MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET, channel, id));
758
737 ev->event_type = MPTSAS_DEL_DEVICE; 759 ev->event_type = MPTSAS_DEL_DEVICE;
738 schedule_work(&ev->work); 760 schedule_work(&ev->work);
739 kfree(target_reset_list); 761 kfree(target_reset_list);
740 762
763 out_fail:
764
765 mpt_clear_taskmgmt_in_progress_flag(ioc);
766 return 0;
767
741 768
742 /* 769 /*
743 * issue target reset to next device in the queue 770 * issue target reset to next device in the queue
@@ -3291,8 +3318,6 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id)
3291 3318
3292 /* Clear the TM flags 3319 /* Clear the TM flags
3293 */ 3320 */
3294 hd->tmPending = 0;
3295 hd->tmState = TM_STATE_NONE;
3296 hd->abortSCpnt = NULL; 3321 hd->abortSCpnt = NULL;
3297 3322
3298 /* Clear the pointer used to store 3323 /* Clear the pointer used to store