diff options
-rw-r--r-- | drivers/message/fusion/mptbase.c | 13 | ||||
-rw-r--r-- | drivers/message/fusion/mptbase.h | 2 | ||||
-rw-r--r-- | drivers/message/fusion/mptfc.c | 1 | ||||
-rw-r--r-- | drivers/message/fusion/mptsas.c | 141 | ||||
-rw-r--r-- | drivers/message/fusion/mptsas.h | 1 | ||||
-rw-r--r-- | drivers/message/fusion/mptscsih.c | 19 | ||||
-rw-r--r-- | drivers/message/fusion/mptscsih.h | 1 | ||||
-rw-r--r-- | drivers/message/fusion/mptspi.c | 1 |
8 files changed, 105 insertions, 74 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index af862bf6386f..ae203eca831f 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c | |||
@@ -6243,6 +6243,7 @@ mpt_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) | |||
6243 | { | 6243 | { |
6244 | switch (reset_phase) { | 6244 | switch (reset_phase) { |
6245 | case MPT_IOC_SETUP_RESET: | 6245 | case MPT_IOC_SETUP_RESET: |
6246 | ioc->taskmgmt_quiesce_io = 1; | ||
6246 | dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT | 6247 | dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
6247 | "%s: MPT_IOC_SETUP_RESET\n", ioc->name, __func__)); | 6248 | "%s: MPT_IOC_SETUP_RESET\n", ioc->name, __func__)); |
6248 | break; | 6249 | break; |
@@ -6595,8 +6596,11 @@ mpt_set_taskmgmt_in_progress_flag(MPT_ADAPTER *ioc) | |||
6595 | } | 6596 | } |
6596 | retval = 0; | 6597 | retval = 0; |
6597 | ioc->taskmgmt_in_progress = 1; | 6598 | ioc->taskmgmt_in_progress = 1; |
6598 | if (ioc->alt_ioc) | 6599 | ioc->taskmgmt_quiesce_io = 1; |
6600 | if (ioc->alt_ioc) { | ||
6599 | ioc->alt_ioc->taskmgmt_in_progress = 1; | 6601 | ioc->alt_ioc->taskmgmt_in_progress = 1; |
6602 | ioc->alt_ioc->taskmgmt_quiesce_io = 1; | ||
6603 | } | ||
6600 | out: | 6604 | out: |
6601 | spin_unlock_irqrestore(&ioc->taskmgmt_lock, flags); | 6605 | spin_unlock_irqrestore(&ioc->taskmgmt_lock, flags); |
6602 | return retval; | 6606 | return retval; |
@@ -6615,8 +6619,11 @@ mpt_clear_taskmgmt_in_progress_flag(MPT_ADAPTER *ioc) | |||
6615 | 6619 | ||
6616 | spin_lock_irqsave(&ioc->taskmgmt_lock, flags); | 6620 | spin_lock_irqsave(&ioc->taskmgmt_lock, flags); |
6617 | ioc->taskmgmt_in_progress = 0; | 6621 | ioc->taskmgmt_in_progress = 0; |
6618 | if (ioc->alt_ioc) | 6622 | ioc->taskmgmt_quiesce_io = 0; |
6623 | if (ioc->alt_ioc) { | ||
6619 | ioc->alt_ioc->taskmgmt_in_progress = 0; | 6624 | ioc->alt_ioc->taskmgmt_in_progress = 0; |
6625 | ioc->alt_ioc->taskmgmt_quiesce_io = 0; | ||
6626 | } | ||
6620 | spin_unlock_irqrestore(&ioc->taskmgmt_lock, flags); | 6627 | spin_unlock_irqrestore(&ioc->taskmgmt_lock, flags); |
6621 | } | 6628 | } |
6622 | EXPORT_SYMBOL(mpt_clear_taskmgmt_in_progress_flag); | 6629 | EXPORT_SYMBOL(mpt_clear_taskmgmt_in_progress_flag); |
@@ -6731,9 +6738,11 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag) | |||
6731 | 6738 | ||
6732 | spin_lock_irqsave(&ioc->taskmgmt_lock, flags); | 6739 | spin_lock_irqsave(&ioc->taskmgmt_lock, flags); |
6733 | ioc->ioc_reset_in_progress = 0; | 6740 | ioc->ioc_reset_in_progress = 0; |
6741 | ioc->taskmgmt_quiesce_io = 0; | ||
6734 | ioc->taskmgmt_in_progress = 0; | 6742 | ioc->taskmgmt_in_progress = 0; |
6735 | if (ioc->alt_ioc) { | 6743 | if (ioc->alt_ioc) { |
6736 | ioc->alt_ioc->ioc_reset_in_progress = 0; | 6744 | ioc->alt_ioc->ioc_reset_in_progress = 0; |
6745 | ioc->alt_ioc->taskmgmt_quiesce_io = 0; | ||
6737 | ioc->alt_ioc->taskmgmt_in_progress = 0; | 6746 | ioc->alt_ioc->taskmgmt_in_progress = 0; |
6738 | } | 6747 | } |
6739 | spin_unlock_irqrestore(&ioc->taskmgmt_lock, flags); | 6748 | spin_unlock_irqrestore(&ioc->taskmgmt_lock, flags); |
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h index 2129aff294d5..a0bf7d88fcfc 100644 --- a/drivers/message/fusion/mptbase.h +++ b/drivers/message/fusion/mptbase.h | |||
@@ -713,6 +713,7 @@ typedef struct _MPT_ADAPTER | |||
713 | MPT_MGMT taskmgmt_cmds; | 713 | MPT_MGMT taskmgmt_cmds; |
714 | spinlock_t taskmgmt_lock; /* diagnostic reset lock */ | 714 | spinlock_t taskmgmt_lock; /* diagnostic reset lock */ |
715 | int taskmgmt_in_progress; | 715 | int taskmgmt_in_progress; |
716 | u8 taskmgmt_quiesce_io; | ||
716 | u8 ioc_reset_in_progress; | 717 | u8 ioc_reset_in_progress; |
717 | struct work_struct sas_persist_task; | 718 | struct work_struct sas_persist_task; |
718 | 719 | ||
@@ -855,7 +856,6 @@ typedef struct _MPT_SCSI_HOST { | |||
855 | * OS callbacks. freeQ is the free pool. | 856 | * OS callbacks. freeQ is the free pool. |
856 | */ | 857 | */ |
857 | u8 tmPending; | 858 | u8 tmPending; |
858 | u8 resetPending; | ||
859 | u8 negoNvram; /* DV disabled, nego NVRAM */ | 859 | u8 negoNvram; /* DV disabled, nego NVRAM */ |
860 | u8 pad1; | 860 | u8 pad1; |
861 | u8 tmState; | 861 | u8 tmState; |
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index d09387134145..a53b33214cde 100644 --- a/drivers/message/fusion/mptfc.c +++ b/drivers/message/fusion/mptfc.c | |||
@@ -1292,7 +1292,6 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1292 | */ | 1292 | */ |
1293 | hd->tmPending = 0; | 1293 | hd->tmPending = 0; |
1294 | hd->tmState = TM_STATE_NONE; | 1294 | hd->tmState = TM_STATE_NONE; |
1295 | hd->resetPending = 0; | ||
1296 | hd->abortSCpnt = NULL; | 1295 | hd->abortSCpnt = NULL; |
1297 | 1296 | ||
1298 | /* Clear the pointer used to store | 1297 | /* Clear the pointer used to store |
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 16c4232c37de..3efa728fc590 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c | |||
@@ -93,6 +93,7 @@ static u8 mptsasDoneCtx = MPT_MAX_PROTOCOL_DRIVERS; | |||
93 | static u8 mptsasTaskCtx = MPT_MAX_PROTOCOL_DRIVERS; | 93 | static u8 mptsasTaskCtx = MPT_MAX_PROTOCOL_DRIVERS; |
94 | static u8 mptsasInternalCtx = MPT_MAX_PROTOCOL_DRIVERS; /* Used only for internal commands */ | 94 | static u8 mptsasInternalCtx = MPT_MAX_PROTOCOL_DRIVERS; /* Used only for internal commands */ |
95 | static u8 mptsasMgmtCtx = MPT_MAX_PROTOCOL_DRIVERS; | 95 | static u8 mptsasMgmtCtx = MPT_MAX_PROTOCOL_DRIVERS; |
96 | static u8 mptsasDeviceResetCtx = MPT_MAX_PROTOCOL_DRIVERS; | ||
96 | 97 | ||
97 | static void mptsas_hotplug_work(struct work_struct *work); | 98 | static void mptsas_hotplug_work(struct work_struct *work); |
98 | 99 | ||
@@ -523,10 +524,12 @@ mptsas_find_vtarget(MPT_ADAPTER *ioc, u8 channel, u8 id) | |||
523 | VirtTarget *vtarget = NULL; | 524 | VirtTarget *vtarget = NULL; |
524 | 525 | ||
525 | shost_for_each_device(sdev, ioc->sh) { | 526 | shost_for_each_device(sdev, ioc->sh) { |
526 | if ((vdevice = sdev->hostdata) == NULL) | 527 | vdevice = sdev->hostdata; |
528 | if ((vdevice == NULL) || | ||
529 | (vdevice->vtarget == NULL)) | ||
527 | continue; | 530 | continue; |
528 | if (vdevice->vtarget->id == id && | 531 | if (vdevice->vtarget->id == id && |
529 | vdevice->vtarget->channel == channel) | 532 | vdevice->vtarget->channel == channel) |
530 | vtarget = vdevice->vtarget; | 533 | vtarget = vdevice->vtarget; |
531 | } | 534 | } |
532 | return vtarget; | 535 | return vtarget; |
@@ -551,9 +554,11 @@ mptsas_target_reset(MPT_ADAPTER *ioc, u8 channel, u8 id) | |||
551 | MPT_FRAME_HDR *mf; | 554 | MPT_FRAME_HDR *mf; |
552 | SCSITaskMgmt_t *pScsiTm; | 555 | SCSITaskMgmt_t *pScsiTm; |
553 | 556 | ||
554 | if ((mf = mpt_get_msg_frame(ioc->TaskCtx, ioc)) == NULL) { | 557 | mf = mpt_get_msg_frame(mptsasDeviceResetCtx, ioc); |
555 | dfailprintk(ioc, printk(MYIOC_s_WARN_FMT "%s, no msg frames @%d!!\n", | 558 | if (mf == NULL) { |
556 | ioc->name,__func__, __LINE__)); | 559 | dfailprintk(ioc, printk(MYIOC_s_WARN_FMT |
560 | "%s, no msg frames @%d!!\n", | ||
561 | ioc->name, __func__, __LINE__)); | ||
557 | return 0; | 562 | return 0; |
558 | } | 563 | } |
559 | 564 | ||
@@ -569,7 +574,7 @@ mptsas_target_reset(MPT_ADAPTER *ioc, u8 channel, u8 id) | |||
569 | 574 | ||
570 | DBG_DUMP_TM_REQUEST_FRAME(ioc, (u32 *)mf); | 575 | DBG_DUMP_TM_REQUEST_FRAME(ioc, (u32 *)mf); |
571 | 576 | ||
572 | mpt_put_msg_frame_hi_pri(ioc->TaskCtx, ioc, mf); | 577 | mpt_put_msg_frame_hi_pri(mptsasDeviceResetCtx, ioc, mf); |
573 | 578 | ||
574 | return 1; | 579 | return 1; |
575 | } | 580 | } |
@@ -605,8 +610,9 @@ mptsas_target_reset_queue(MPT_ADAPTER *ioc, | |||
605 | target_reset_list = kzalloc(sizeof(*target_reset_list), | 610 | target_reset_list = kzalloc(sizeof(*target_reset_list), |
606 | GFP_ATOMIC); | 611 | GFP_ATOMIC); |
607 | if (!target_reset_list) { | 612 | if (!target_reset_list) { |
608 | dfailprintk(ioc, printk(MYIOC_s_WARN_FMT "%s, failed to allocate mem @%d..!!\n", | 613 | dfailprintk(ioc, printk(MYIOC_s_WARN_FMT |
609 | ioc->name,__func__, __LINE__)); | 614 | "%s, failed to allocate mem @%d..!!\n", |
615 | ioc->name, __func__, __LINE__)); | ||
610 | return; | 616 | return; |
611 | } | 617 | } |
612 | 618 | ||
@@ -614,55 +620,94 @@ mptsas_target_reset_queue(MPT_ADAPTER *ioc, | |||
614 | sizeof(*sas_event_data)); | 620 | sizeof(*sas_event_data)); |
615 | list_add_tail(&target_reset_list->list, &hd->target_reset_list); | 621 | list_add_tail(&target_reset_list->list, &hd->target_reset_list); |
616 | 622 | ||
617 | if (hd->resetPending) | 623 | target_reset_list->time_count = jiffies; |
618 | return; | ||
619 | 624 | ||
620 | if (mptsas_target_reset(ioc, channel, id)) { | 625 | if (mptsas_target_reset(ioc, channel, id)) { |
621 | target_reset_list->target_reset_issued = 1; | 626 | target_reset_list->target_reset_issued = 1; |
622 | hd->resetPending = 1; | ||
623 | } | 627 | } |
624 | } | 628 | } |
625 | 629 | ||
626 | /** | 630 | /** |
627 | * mptsas_dev_reset_complete | 631 | * mptsas_taskmgmt_complete - Completion for TARGET_RESET after |
628 | * | 632 | * NOT_RESPONDING_EVENT, enable work queue to finish off removing device |
629 | * Completion for TARGET_RESET after NOT_RESPONDING_EVENT, | 633 | * from upper layers. then send next TARGET_RESET in the queue. |
630 | * enable work queue to finish off removing device from upper layers. | 634 | * @ioc: Pointer to MPT_ADAPTER structure |
631 | * then send next TARGET_RESET in the queue. | ||
632 | * | ||
633 | * @ioc | ||
634 | * | 635 | * |
635 | **/ | 636 | **/ |
636 | static void | 637 | static int |
637 | mptsas_dev_reset_complete(MPT_ADAPTER *ioc) | 638 | mptsas_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) |
638 | { | 639 | { |
639 | MPT_SCSI_HOST *hd = shost_priv(ioc->sh); | 640 | MPT_SCSI_HOST *hd = shost_priv(ioc->sh); |
640 | struct list_head *head = &hd->target_reset_list; | 641 | struct list_head *head = &hd->target_reset_list; |
641 | struct mptsas_target_reset_event *target_reset_list; | ||
642 | struct mptsas_hotplug_event *ev; | 642 | struct mptsas_hotplug_event *ev; |
643 | EVENT_DATA_SAS_DEVICE_STATUS_CHANGE *sas_event_data; | 643 | EVENT_DATA_SAS_DEVICE_STATUS_CHANGE *sas_event_data; |
644 | u8 id, channel; | 644 | u8 id, channel; |
645 | __le64 sas_address; | 645 | __le64 sas_address; |
646 | struct mptsas_target_reset_event *target_reset_list; | ||
647 | SCSITaskMgmtReply_t *pScsiTmReply; | ||
648 | |||
649 | dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT "TaskMgmt completed: " | ||
650 | "(mf = %p, mr = %p)\n", ioc->name, mf, mr)); | ||
651 | |||
652 | pScsiTmReply = (SCSITaskMgmtReply_t *)mr; | ||
653 | if (pScsiTmReply) { | ||
654 | dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT | ||
655 | "\tTaskMgmt completed: fw_channel = %d, fw_id = %d,\n" | ||
656 | "\ttask_type = 0x%02X, iocstatus = 0x%04X " | ||
657 | "loginfo = 0x%08X,\n\tresponse_code = 0x%02X, " | ||
658 | "term_cmnds = %d\n", ioc->name, | ||
659 | pScsiTmReply->Bus, pScsiTmReply->TargetID, | ||
660 | pScsiTmReply->TaskType, | ||
661 | le16_to_cpu(pScsiTmReply->IOCStatus), | ||
662 | le32_to_cpu(pScsiTmReply->IOCLogInfo), | ||
663 | pScsiTmReply->ResponseCode, | ||
664 | le32_to_cpu(pScsiTmReply->TerminationCount))); | ||
665 | |||
666 | if (pScsiTmReply->ResponseCode) | ||
667 | mptscsih_taskmgmt_response_code(ioc, | ||
668 | pScsiTmReply->ResponseCode); | ||
669 | } | ||
670 | |||
671 | if (pScsiTmReply && (pScsiTmReply->TaskType == | ||
672 | MPI_SCSITASKMGMT_TASKTYPE_QUERY_TASK || pScsiTmReply->TaskType == | ||
673 | MPI_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET)) { | ||
674 | ioc->taskmgmt_cmds.status |= MPT_MGMT_STATUS_COMMAND_GOOD; | ||
675 | ioc->taskmgmt_cmds.status |= MPT_MGMT_STATUS_RF_VALID; | ||
676 | memcpy(ioc->taskmgmt_cmds.reply, mr, | ||
677 | min(MPT_DEFAULT_FRAME_SIZE, 4 * mr->u.reply.MsgLength)); | ||
678 | if (ioc->taskmgmt_cmds.status & MPT_MGMT_STATUS_PENDING) { | ||
679 | ioc->taskmgmt_cmds.status &= ~MPT_MGMT_STATUS_PENDING; | ||
680 | complete(&ioc->taskmgmt_cmds.done); | ||
681 | return 1; | ||
682 | } | ||
683 | return 0; | ||
684 | } | ||
685 | |||
686 | mpt_clear_taskmgmt_in_progress_flag(ioc); | ||
646 | 687 | ||
647 | if (list_empty(head)) | 688 | if (list_empty(head)) |
648 | return; | 689 | return 1; |
690 | |||
691 | target_reset_list = list_entry(head->next, | ||
692 | struct mptsas_target_reset_event, list); | ||
649 | 693 | ||
650 | target_reset_list = list_entry(head->next, struct mptsas_target_reset_event, list); | 694 | dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
695 | "TaskMgmt: completed (%d seconds)\n", | ||
696 | ioc->name, jiffies_to_msecs(jiffies - | ||
697 | target_reset_list->time_count)/1000)); | ||
651 | 698 | ||
652 | sas_event_data = &target_reset_list->sas_event_data; | 699 | sas_event_data = &target_reset_list->sas_event_data; |
653 | id = sas_event_data->TargetID; | 700 | id = pScsiTmReply->TargetID; |
654 | channel = sas_event_data->Bus; | 701 | channel = pScsiTmReply->Bus; |
655 | hd->resetPending = 0; | 702 | target_reset_list->time_count = jiffies; |
656 | 703 | ||
657 | /* | 704 | /* |
658 | * retry target reset | 705 | * retry target reset |
659 | */ | 706 | */ |
660 | if (!target_reset_list->target_reset_issued) { | 707 | if (!target_reset_list->target_reset_issued) { |
661 | if (mptsas_target_reset(ioc, channel, id)) { | 708 | if (mptsas_target_reset(ioc, channel, id)) |
662 | target_reset_list->target_reset_issued = 1; | 709 | target_reset_list->target_reset_issued = 1; |
663 | hd->resetPending = 1; | 710 | return 1; |
664 | } | ||
665 | return; | ||
666 | } | 711 | } |
667 | 712 | ||
668 | /* | 713 | /* |
@@ -674,7 +719,7 @@ mptsas_dev_reset_complete(MPT_ADAPTER *ioc) | |||
674 | if (!ev) { | 719 | if (!ev) { |
675 | dfailprintk(ioc, printk(MYIOC_s_WARN_FMT "%s, failed to allocate mem @%d..!!\n", | 720 | dfailprintk(ioc, printk(MYIOC_s_WARN_FMT "%s, failed to allocate mem @%d..!!\n", |
676 | ioc->name,__func__, __LINE__)); | 721 | ioc->name,__func__, __LINE__)); |
677 | return; | 722 | return 0; |
678 | } | 723 | } |
679 | 724 | ||
680 | INIT_WORK(&ev->work, mptsas_hotplug_work); | 725 | INIT_WORK(&ev->work, mptsas_hotplug_work); |
@@ -693,40 +738,26 @@ mptsas_dev_reset_complete(MPT_ADAPTER *ioc) | |||
693 | schedule_work(&ev->work); | 738 | schedule_work(&ev->work); |
694 | kfree(target_reset_list); | 739 | kfree(target_reset_list); |
695 | 740 | ||
741 | |||
696 | /* | 742 | /* |
697 | * issue target reset to next device in the queue | 743 | * issue target reset to next device in the queue |
698 | */ | 744 | */ |
699 | 745 | ||
700 | head = &hd->target_reset_list; | 746 | head = &hd->target_reset_list; |
701 | if (list_empty(head)) | 747 | if (list_empty(head)) |
702 | return; | 748 | return 1; |
703 | 749 | ||
704 | target_reset_list = list_entry(head->next, struct mptsas_target_reset_event, | 750 | target_reset_list = list_entry(head->next, struct mptsas_target_reset_event, |
705 | list); | 751 | list); |
706 | 752 | ||
707 | sas_event_data = &target_reset_list->sas_event_data; | 753 | id = target_reset_list->sas_event_data.TargetID; |
708 | id = sas_event_data->TargetID; | 754 | channel = target_reset_list->sas_event_data.Bus; |
709 | channel = sas_event_data->Bus; | 755 | target_reset_list->time_count = jiffies; |
710 | 756 | ||
711 | if (mptsas_target_reset(ioc, channel, id)) { | 757 | if (mptsas_target_reset(ioc, channel, id)) |
712 | target_reset_list->target_reset_issued = 1; | 758 | target_reset_list->target_reset_issued = 1; |
713 | hd->resetPending = 1; | ||
714 | } | ||
715 | } | ||
716 | 759 | ||
717 | /** | 760 | return 1; |
718 | * mptsas_taskmgmt_complete | ||
719 | * | ||
720 | * @ioc | ||
721 | * @mf | ||
722 | * @mr | ||
723 | * | ||
724 | **/ | ||
725 | static int | ||
726 | mptsas_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) | ||
727 | { | ||
728 | mptsas_dev_reset_complete(ioc); | ||
729 | return mptscsih_taskmgmt_complete(ioc, mf, mr); | ||
730 | } | 761 | } |
731 | 762 | ||
732 | /** | 763 | /** |
@@ -3262,7 +3293,6 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
3262 | */ | 3293 | */ |
3263 | hd->tmPending = 0; | 3294 | hd->tmPending = 0; |
3264 | hd->tmState = TM_STATE_NONE; | 3295 | hd->tmState = TM_STATE_NONE; |
3265 | hd->resetPending = 0; | ||
3266 | hd->abortSCpnt = NULL; | 3296 | hd->abortSCpnt = NULL; |
3267 | 3297 | ||
3268 | /* Clear the pointer used to store | 3298 | /* Clear the pointer used to store |
@@ -3381,10 +3411,12 @@ mptsas_init(void) | |||
3381 | return -ENODEV; | 3411 | return -ENODEV; |
3382 | 3412 | ||
3383 | mptsasDoneCtx = mpt_register(mptscsih_io_done, MPTSAS_DRIVER); | 3413 | mptsasDoneCtx = mpt_register(mptscsih_io_done, MPTSAS_DRIVER); |
3384 | mptsasTaskCtx = mpt_register(mptsas_taskmgmt_complete, MPTSAS_DRIVER); | 3414 | mptsasTaskCtx = mpt_register(mptscsih_taskmgmt_complete, MPTSAS_DRIVER); |
3385 | mptsasInternalCtx = | 3415 | mptsasInternalCtx = |
3386 | mpt_register(mptscsih_scandv_complete, MPTSAS_DRIVER); | 3416 | mpt_register(mptscsih_scandv_complete, MPTSAS_DRIVER); |
3387 | mptsasMgmtCtx = mpt_register(mptsas_mgmt_done, MPTSAS_DRIVER); | 3417 | mptsasMgmtCtx = mpt_register(mptsas_mgmt_done, MPTSAS_DRIVER); |
3418 | mptsasDeviceResetCtx = | ||
3419 | mpt_register(mptsas_taskmgmt_complete, MPTSAS_DRIVER); | ||
3388 | 3420 | ||
3389 | mpt_event_register(mptsasDoneCtx, mptsas_event_process); | 3421 | mpt_event_register(mptsasDoneCtx, mptsas_event_process); |
3390 | mpt_reset_register(mptsasDoneCtx, mptsas_ioc_reset); | 3422 | mpt_reset_register(mptsasDoneCtx, mptsas_ioc_reset); |
@@ -3409,6 +3441,7 @@ mptsas_exit(void) | |||
3409 | mpt_deregister(mptsasInternalCtx); | 3441 | mpt_deregister(mptsasInternalCtx); |
3410 | mpt_deregister(mptsasTaskCtx); | 3442 | mpt_deregister(mptsasTaskCtx); |
3411 | mpt_deregister(mptsasDoneCtx); | 3443 | mpt_deregister(mptsasDoneCtx); |
3444 | mpt_deregister(mptsasDeviceResetCtx); | ||
3412 | } | 3445 | } |
3413 | 3446 | ||
3414 | module_init(mptsas_init); | 3447 | module_init(mptsas_init); |
diff --git a/drivers/message/fusion/mptsas.h b/drivers/message/fusion/mptsas.h index 2b544e0877e6..bf528a5b59b1 100644 --- a/drivers/message/fusion/mptsas.h +++ b/drivers/message/fusion/mptsas.h | |||
@@ -53,6 +53,7 @@ struct mptsas_target_reset_event { | |||
53 | struct list_head list; | 53 | struct list_head list; |
54 | EVENT_DATA_SAS_DEVICE_STATUS_CHANGE sas_event_data; | 54 | EVENT_DATA_SAS_DEVICE_STATUS_CHANGE sas_event_data; |
55 | u8 target_reset_issued; | 55 | u8 target_reset_issued; |
56 | unsigned long time_count; | ||
56 | }; | 57 | }; |
57 | 58 | ||
58 | enum mptsas_hotplug_action { | 59 | enum mptsas_hotplug_action { |
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index 2463731ed355..a6a2bbda2f18 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c | |||
@@ -99,7 +99,7 @@ int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, | |||
99 | int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset); | 99 | int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset); |
100 | int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply); | 100 | int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply); |
101 | 101 | ||
102 | static void | 102 | void |
103 | mptscsih_taskmgmt_response_code(MPT_ADAPTER *ioc, u8 response_code); | 103 | mptscsih_taskmgmt_response_code(MPT_ADAPTER *ioc, u8 response_code); |
104 | static int mptscsih_get_completion_code(MPT_ADAPTER *ioc, | 104 | static int mptscsih_get_completion_code(MPT_ADAPTER *ioc, |
105 | MPT_FRAME_HDR *req, MPT_FRAME_HDR *reply); | 105 | MPT_FRAME_HDR *req, MPT_FRAME_HDR *reply); |
@@ -1304,7 +1304,7 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | |||
1304 | dmfprintk(ioc, printk(MYIOC_s_DEBUG_FMT "qcmd: SCpnt=%p, done()=%p\n", | 1304 | dmfprintk(ioc, printk(MYIOC_s_DEBUG_FMT "qcmd: SCpnt=%p, done()=%p\n", |
1305 | ioc->name, SCpnt, done)); | 1305 | ioc->name, SCpnt, done)); |
1306 | 1306 | ||
1307 | if (hd->resetPending) { | 1307 | if (ioc->taskmgmt_quiesce_io) { |
1308 | dtmprintk(ioc, printk(MYIOC_s_WARN_FMT "qcmd: SCpnt=%p timeout + 60HZ\n", | 1308 | dtmprintk(ioc, printk(MYIOC_s_WARN_FMT "qcmd: SCpnt=%p timeout + 60HZ\n", |
1309 | ioc->name, SCpnt)); | 1309 | ioc->name, SCpnt)); |
1310 | return SCSI_MLQUEUE_HOST_BUSY; | 1310 | return SCSI_MLQUEUE_HOST_BUSY; |
@@ -1709,11 +1709,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) | |||
1709 | goto out; | 1709 | goto out; |
1710 | } | 1710 | } |
1711 | 1711 | ||
1712 | if (hd->resetPending) { | ||
1713 | retval = FAILED; | ||
1714 | goto out; | ||
1715 | } | ||
1716 | |||
1717 | if (hd->timeouts < -1) | 1712 | if (hd->timeouts < -1) |
1718 | hd->timeouts++; | 1713 | hd->timeouts++; |
1719 | 1714 | ||
@@ -1782,11 +1777,6 @@ mptscsih_dev_reset(struct scsi_cmnd * SCpnt) | |||
1782 | ioc->name, SCpnt); | 1777 | ioc->name, SCpnt); |
1783 | scsi_print_command(SCpnt); | 1778 | scsi_print_command(SCpnt); |
1784 | 1779 | ||
1785 | if (hd->resetPending) { | ||
1786 | retval = FAILED; | ||
1787 | goto out; | ||
1788 | } | ||
1789 | |||
1790 | vdevice = SCpnt->device->hostdata; | 1780 | vdevice = SCpnt->device->hostdata; |
1791 | if (!vdevice || !vdevice->vtarget) { | 1781 | if (!vdevice || !vdevice->vtarget) { |
1792 | retval = 0; | 1782 | retval = 0; |
@@ -1967,7 +1957,7 @@ mptscsih_taskmgmt_reply(MPT_ADAPTER *ioc, u8 type, | |||
1967 | } | 1957 | } |
1968 | 1958 | ||
1969 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 1959 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
1970 | static void | 1960 | void |
1971 | mptscsih_taskmgmt_response_code(MPT_ADAPTER *ioc, u8 response_code) | 1961 | mptscsih_taskmgmt_response_code(MPT_ADAPTER *ioc, u8 response_code) |
1972 | { | 1962 | { |
1973 | char *desc; | 1963 | char *desc; |
@@ -2001,6 +1991,7 @@ mptscsih_taskmgmt_response_code(MPT_ADAPTER *ioc, u8 response_code) | |||
2001 | printk(MYIOC_s_INFO_FMT "Response Code(0x%08x): F/W: %s\n", | 1991 | printk(MYIOC_s_INFO_FMT "Response Code(0x%08x): F/W: %s\n", |
2002 | ioc->name, response_code, desc); | 1992 | ioc->name, response_code, desc); |
2003 | } | 1993 | } |
1994 | EXPORT_SYMBOL(mptscsih_taskmgmt_response_code); | ||
2004 | 1995 | ||
2005 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 1996 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
2006 | /** | 1997 | /** |
@@ -2442,12 +2433,10 @@ mptscsih_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) | |||
2442 | case MPT_IOC_SETUP_RESET: | 2433 | case MPT_IOC_SETUP_RESET: |
2443 | dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT | 2434 | dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
2444 | "%s: MPT_IOC_SETUP_RESET\n", ioc->name, __func__)); | 2435 | "%s: MPT_IOC_SETUP_RESET\n", ioc->name, __func__)); |
2445 | hd->resetPending = 1; | ||
2446 | break; | 2436 | break; |
2447 | case MPT_IOC_PRE_RESET: | 2437 | case MPT_IOC_PRE_RESET: |
2448 | dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT | 2438 | dtmprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
2449 | "%s: MPT_IOC_PRE_RESET\n", ioc->name, __func__)); | 2439 | "%s: MPT_IOC_PRE_RESET\n", ioc->name, __func__)); |
2450 | hd->resetPending = 0; | ||
2451 | mptscsih_flush_running_cmds(hd); | 2440 | mptscsih_flush_running_cmds(hd); |
2452 | break; | 2441 | break; |
2453 | case MPT_IOC_POST_RESET: | 2442 | case MPT_IOC_POST_RESET: |
diff --git a/drivers/message/fusion/mptscsih.h b/drivers/message/fusion/mptscsih.h index 6ac5d4a5c4e8..91e9e9fcd0e4 100644 --- a/drivers/message/fusion/mptscsih.h +++ b/drivers/message/fusion/mptscsih.h | |||
@@ -132,3 +132,4 @@ extern void mptscsih_timer_expired(unsigned long data); | |||
132 | extern u8 mptscsih_raid_id_to_num(MPT_ADAPTER *ioc, u8 channel, u8 id); | 132 | extern u8 mptscsih_raid_id_to_num(MPT_ADAPTER *ioc, u8 channel, u8 id); |
133 | extern int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, u8 channel, u8 id); | 133 | extern int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, u8 channel, u8 id); |
134 | extern struct device_attribute *mptscsih_host_attrs[]; | 134 | extern struct device_attribute *mptscsih_host_attrs[]; |
135 | extern void mptscsih_taskmgmt_response_code(MPT_ADAPTER *ioc, u8 response_code); | ||
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index e94c76dbe780..8b940740292e 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c | |||
@@ -1476,7 +1476,6 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1476 | */ | 1476 | */ |
1477 | hd->tmPending = 0; | 1477 | hd->tmPending = 0; |
1478 | hd->tmState = TM_STATE_NONE; | 1478 | hd->tmState = TM_STATE_NONE; |
1479 | hd->resetPending = 0; | ||
1480 | hd->abortSCpnt = NULL; | 1479 | hd->abortSCpnt = NULL; |
1481 | 1480 | ||
1482 | /* Clear the pointer used to store | 1481 | /* Clear the pointer used to store |