diff options
| author | Calvin Owens <calvinowens@fb.com> | 2016-07-29 00:38:21 -0400 |
|---|---|---|
| committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-08-08 21:13:48 -0400 |
| commit | 98c56ad32c33f0fd6742502bafe7003e4b8c80ed (patch) | |
| tree | 1953cb1b7d5aa576b3b95f029a1152d8287caf0d | |
| parent | 96902835e7e2c7bf59db28ffd550852610169a2d (diff) | |
mpt3sas: Eliminate dead sleep_flag code
With the exception of a single call to wait_for_doorbell_int(), all this
conditional sleeping code is dead. So delete it.
Signed-off-by: Calvin Owens <calvinowens@fb.com>
Acked-by: Chaitra P B <chaitra.basappa@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| -rw-r--r-- | drivers/scsi/mpt3sas/mpt3sas_base.c | 241 | ||||
| -rw-r--r-- | drivers/scsi/mpt3sas/mpt3sas_base.h | 6 | ||||
| -rw-r--r-- | drivers/scsi/mpt3sas/mpt3sas_config.c | 3 | ||||
| -rw-r--r-- | drivers/scsi/mpt3sas/mpt3sas_ctl.c | 15 | ||||
| -rw-r--r-- | drivers/scsi/mpt3sas/mpt3sas_scsih.c | 21 | ||||
| -rw-r--r-- | drivers/scsi/mpt3sas/mpt3sas_transport.c | 12 |
6 files changed, 120 insertions, 178 deletions
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index 751f13edece0..095618328820 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c | |||
| @@ -98,7 +98,7 @@ MODULE_PARM_DESC(mpt3sas_fwfault_debug, | |||
| 98 | " enable detection of firmware fault and halt firmware - (default=0)"); | 98 | " enable detection of firmware fault and halt firmware - (default=0)"); |
| 99 | 99 | ||
| 100 | static int | 100 | static int |
| 101 | _base_get_ioc_facts(struct MPT3SAS_ADAPTER *ioc, int sleep_flag); | 101 | _base_get_ioc_facts(struct MPT3SAS_ADAPTER *ioc); |
| 102 | 102 | ||
| 103 | /** | 103 | /** |
| 104 | * _scsih_set_fwfault_debug - global setting of ioc->fwfault_debug. | 104 | * _scsih_set_fwfault_debug - global setting of ioc->fwfault_debug. |
| @@ -218,8 +218,7 @@ _base_fault_reset_work(struct work_struct *work) | |||
| 218 | ioc->non_operational_loop = 0; | 218 | ioc->non_operational_loop = 0; |
| 219 | 219 | ||
| 220 | if ((doorbell & MPI2_IOC_STATE_MASK) != MPI2_IOC_STATE_OPERATIONAL) { | 220 | if ((doorbell & MPI2_IOC_STATE_MASK) != MPI2_IOC_STATE_OPERATIONAL) { |
| 221 | rc = mpt3sas_base_hard_reset_handler(ioc, CAN_SLEEP, | 221 | rc = mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER); |
| 222 | FORCE_BIG_HAMMER); | ||
| 223 | pr_warn(MPT3SAS_FMT "%s: hard reset: %s\n", ioc->name, | 222 | pr_warn(MPT3SAS_FMT "%s: hard reset: %s\n", ioc->name, |
| 224 | __func__, (rc == 0) ? "success" : "failed"); | 223 | __func__, (rc == 0) ? "success" : "failed"); |
| 225 | doorbell = mpt3sas_base_get_iocstate(ioc, 0); | 224 | doorbell = mpt3sas_base_get_iocstate(ioc, 0); |
| @@ -2145,7 +2144,7 @@ mpt3sas_base_map_resources(struct MPT3SAS_ADAPTER *ioc) | |||
| 2145 | 2144 | ||
| 2146 | _base_mask_interrupts(ioc); | 2145 | _base_mask_interrupts(ioc); |
| 2147 | 2146 | ||
| 2148 | r = _base_get_ioc_facts(ioc, CAN_SLEEP); | 2147 | r = _base_get_ioc_facts(ioc); |
| 2149 | if (r) | 2148 | if (r) |
| 2150 | goto out_fail; | 2149 | goto out_fail; |
| 2151 | 2150 | ||
| @@ -3172,12 +3171,11 @@ _base_release_memory_pools(struct MPT3SAS_ADAPTER *ioc) | |||
| 3172 | /** | 3171 | /** |
| 3173 | * _base_allocate_memory_pools - allocate start of day memory pools | 3172 | * _base_allocate_memory_pools - allocate start of day memory pools |
| 3174 | * @ioc: per adapter object | 3173 | * @ioc: per adapter object |
| 3175 | * @sleep_flag: CAN_SLEEP or NO_SLEEP | ||
| 3176 | * | 3174 | * |
| 3177 | * Returns 0 success, anything else error | 3175 | * Returns 0 success, anything else error |
| 3178 | */ | 3176 | */ |
| 3179 | static int | 3177 | static int |
| 3180 | _base_allocate_memory_pools(struct MPT3SAS_ADAPTER *ioc, int sleep_flag) | 3178 | _base_allocate_memory_pools(struct MPT3SAS_ADAPTER *ioc) |
| 3181 | { | 3179 | { |
| 3182 | struct mpt3sas_facts *facts; | 3180 | struct mpt3sas_facts *facts; |
| 3183 | u16 max_sge_elements; | 3181 | u16 max_sge_elements; |
| @@ -3647,29 +3645,25 @@ mpt3sas_base_get_iocstate(struct MPT3SAS_ADAPTER *ioc, int cooked) | |||
| 3647 | * _base_wait_on_iocstate - waiting on a particular ioc state | 3645 | * _base_wait_on_iocstate - waiting on a particular ioc state |
| 3648 | * @ioc_state: controller state { READY, OPERATIONAL, or RESET } | 3646 | * @ioc_state: controller state { READY, OPERATIONAL, or RESET } |
| 3649 | * @timeout: timeout in second | 3647 | * @timeout: timeout in second |
| 3650 | * @sleep_flag: CAN_SLEEP or NO_SLEEP | ||
| 3651 | * | 3648 | * |
| 3652 | * Returns 0 for success, non-zero for failure. | 3649 | * Returns 0 for success, non-zero for failure. |
| 3653 | */ | 3650 | */ |
| 3654 | static int | 3651 | static int |
| 3655 | _base_wait_on_iocstate(struct MPT3SAS_ADAPTER *ioc, u32 ioc_state, int timeout, | 3652 | _base_wait_on_iocstate(struct MPT3SAS_ADAPTER *ioc, u32 ioc_state, int timeout) |
| 3656 | int sleep_flag) | ||
| 3657 | { | 3653 | { |
| 3658 | u32 count, cntdn; | 3654 | u32 count, cntdn; |
| 3659 | u32 current_state; | 3655 | u32 current_state; |
| 3660 | 3656 | ||
| 3661 | count = 0; | 3657 | count = 0; |
| 3662 | cntdn = (sleep_flag == CAN_SLEEP) ? 1000*timeout : 2000*timeout; | 3658 | cntdn = 1000 * timeout; |
| 3663 | do { | 3659 | do { |
| 3664 | current_state = mpt3sas_base_get_iocstate(ioc, 1); | 3660 | current_state = mpt3sas_base_get_iocstate(ioc, 1); |
| 3665 | if (current_state == ioc_state) | 3661 | if (current_state == ioc_state) |
| 3666 | return 0; | 3662 | return 0; |
| 3667 | if (count && current_state == MPI2_IOC_STATE_FAULT) | 3663 | if (count && current_state == MPI2_IOC_STATE_FAULT) |
| 3668 | break; | 3664 | break; |
| 3669 | if (sleep_flag == CAN_SLEEP) | 3665 | |
| 3670 | usleep_range(1000, 1500); | 3666 | usleep_range(1000, 1500); |
| 3671 | else | ||
| 3672 | udelay(500); | ||
| 3673 | count++; | 3667 | count++; |
| 3674 | } while (--cntdn); | 3668 | } while (--cntdn); |
| 3675 | 3669 | ||
| @@ -3681,24 +3675,22 @@ _base_wait_on_iocstate(struct MPT3SAS_ADAPTER *ioc, u32 ioc_state, int timeout, | |||
| 3681 | * a write to the doorbell) | 3675 | * a write to the doorbell) |
| 3682 | * @ioc: per adapter object | 3676 | * @ioc: per adapter object |
| 3683 | * @timeout: timeout in second | 3677 | * @timeout: timeout in second |
| 3684 | * @sleep_flag: CAN_SLEEP or NO_SLEEP | ||
| 3685 | * | 3678 | * |
| 3686 | * Returns 0 for success, non-zero for failure. | 3679 | * Returns 0 for success, non-zero for failure. |
| 3687 | * | 3680 | * |
| 3688 | * Notes: MPI2_HIS_IOC2SYS_DB_STATUS - set to one when IOC writes to doorbell. | 3681 | * Notes: MPI2_HIS_IOC2SYS_DB_STATUS - set to one when IOC writes to doorbell. |
| 3689 | */ | 3682 | */ |
| 3690 | static int | 3683 | static int |
| 3691 | _base_diag_reset(struct MPT3SAS_ADAPTER *ioc, int sleep_flag); | 3684 | _base_diag_reset(struct MPT3SAS_ADAPTER *ioc); |
| 3692 | 3685 | ||
| 3693 | static int | 3686 | static int |
| 3694 | _base_wait_for_doorbell_int(struct MPT3SAS_ADAPTER *ioc, int timeout, | 3687 | _base_wait_for_doorbell_int(struct MPT3SAS_ADAPTER *ioc, int timeout) |
| 3695 | int sleep_flag) | ||
| 3696 | { | 3688 | { |
| 3697 | u32 cntdn, count; | 3689 | u32 cntdn, count; |
| 3698 | u32 int_status; | 3690 | u32 int_status; |
| 3699 | 3691 | ||
| 3700 | count = 0; | 3692 | count = 0; |
| 3701 | cntdn = (sleep_flag == CAN_SLEEP) ? 1000*timeout : 2000*timeout; | 3693 | cntdn = 1000 * timeout; |
| 3702 | do { | 3694 | do { |
| 3703 | int_status = readl(&ioc->chip->HostInterruptStatus); | 3695 | int_status = readl(&ioc->chip->HostInterruptStatus); |
| 3704 | if (int_status & MPI2_HIS_IOC2SYS_DB_STATUS) { | 3696 | if (int_status & MPI2_HIS_IOC2SYS_DB_STATUS) { |
| @@ -3707,10 +3699,35 @@ _base_wait_for_doorbell_int(struct MPT3SAS_ADAPTER *ioc, int timeout, | |||
| 3707 | ioc->name, __func__, count, timeout)); | 3699 | ioc->name, __func__, count, timeout)); |
| 3708 | return 0; | 3700 | return 0; |
| 3709 | } | 3701 | } |
| 3710 | if (sleep_flag == CAN_SLEEP) | 3702 | |
| 3711 | usleep_range(1000, 1500); | 3703 | usleep_range(1000, 1500); |
| 3712 | else | 3704 | count++; |
| 3713 | udelay(500); | 3705 | } while (--cntdn); |
| 3706 | |||
| 3707 | pr_err(MPT3SAS_FMT | ||
| 3708 | "%s: failed due to timeout count(%d), int_status(%x)!\n", | ||
| 3709 | ioc->name, __func__, count, int_status); | ||
| 3710 | return -EFAULT; | ||
| 3711 | } | ||
| 3712 | |||
| 3713 | static int | ||
| 3714 | _base_spin_on_doorbell_int(struct MPT3SAS_ADAPTER *ioc, int timeout) | ||
| 3715 | { | ||
| 3716 | u32 cntdn, count; | ||
| 3717 | u32 int_status; | ||
| 3718 | |||
| 3719 | count = 0; | ||
| 3720 | cntdn = 2000 * timeout; | ||
| 3721 | do { | ||
| 3722 | int_status = readl(&ioc->chip->HostInterruptStatus); | ||
| 3723 | if (int_status & MPI2_HIS_IOC2SYS_DB_STATUS) { | ||
| 3724 | dhsprintk(ioc, pr_info(MPT3SAS_FMT | ||
| 3725 | "%s: successful count(%d), timeout(%d)\n", | ||
| 3726 | ioc->name, __func__, count, timeout)); | ||
| 3727 | return 0; | ||
| 3728 | } | ||
| 3729 | |||
| 3730 | udelay(500); | ||
| 3714 | count++; | 3731 | count++; |
| 3715 | } while (--cntdn); | 3732 | } while (--cntdn); |
| 3716 | 3733 | ||
| @@ -3718,13 +3735,13 @@ _base_wait_for_doorbell_int(struct MPT3SAS_ADAPTER *ioc, int timeout, | |||
| 3718 | "%s: failed due to timeout count(%d), int_status(%x)!\n", | 3735 | "%s: failed due to timeout count(%d), int_status(%x)!\n", |
| 3719 | ioc->name, __func__, count, int_status); | 3736 | ioc->name, __func__, count, int_status); |
| 3720 | return -EFAULT; | 3737 | return -EFAULT; |
| 3738 | |||
| 3721 | } | 3739 | } |
| 3722 | 3740 | ||
| 3723 | /** | 3741 | /** |
| 3724 | * _base_wait_for_doorbell_ack - waiting for controller to read the doorbell. | 3742 | * _base_wait_for_doorbell_ack - waiting for controller to read the doorbell. |
| 3725 | * @ioc: per adapter object | 3743 | * @ioc: per adapter object |
| 3726 | * @timeout: timeout in second | 3744 | * @timeout: timeout in second |
| 3727 | * @sleep_flag: CAN_SLEEP or NO_SLEEP | ||
| 3728 | * | 3745 | * |
| 3729 | * Returns 0 for success, non-zero for failure. | 3746 | * Returns 0 for success, non-zero for failure. |
| 3730 | * | 3747 | * |
| @@ -3732,15 +3749,14 @@ _base_wait_for_doorbell_int(struct MPT3SAS_ADAPTER *ioc, int timeout, | |||
| 3732 | * doorbell. | 3749 | * doorbell. |
| 3733 | */ | 3750 | */ |
| 3734 | static int | 3751 | static int |
| 3735 | _base_wait_for_doorbell_ack(struct MPT3SAS_ADAPTER *ioc, int timeout, | 3752 | _base_wait_for_doorbell_ack(struct MPT3SAS_ADAPTER *ioc, int timeout) |
| 3736 | int sleep_flag) | ||
| 3737 | { | 3753 | { |
| 3738 | u32 cntdn, count; | 3754 | u32 cntdn, count; |
| 3739 | u32 int_status; | 3755 | u32 int_status; |
| 3740 | u32 doorbell; | 3756 | u32 doorbell; |
| 3741 | 3757 | ||
| 3742 | count = 0; | 3758 | count = 0; |
| 3743 | cntdn = (sleep_flag == CAN_SLEEP) ? 1000*timeout : 2000*timeout; | 3759 | cntdn = 1000 * timeout; |
| 3744 | do { | 3760 | do { |
| 3745 | int_status = readl(&ioc->chip->HostInterruptStatus); | 3761 | int_status = readl(&ioc->chip->HostInterruptStatus); |
| 3746 | if (!(int_status & MPI2_HIS_SYS2IOC_DB_STATUS)) { | 3762 | if (!(int_status & MPI2_HIS_SYS2IOC_DB_STATUS)) { |
| @@ -3758,10 +3774,7 @@ _base_wait_for_doorbell_ack(struct MPT3SAS_ADAPTER *ioc, int timeout, | |||
| 3758 | } else if (int_status == 0xFFFFFFFF) | 3774 | } else if (int_status == 0xFFFFFFFF) |
| 3759 | goto out; | 3775 | goto out; |
| 3760 | 3776 | ||
| 3761 | if (sleep_flag == CAN_SLEEP) | 3777 | usleep_range(1000, 1500); |
| 3762 | usleep_range(1000, 1500); | ||
| 3763 | else | ||
| 3764 | udelay(500); | ||
| 3765 | count++; | 3778 | count++; |
| 3766 | } while (--cntdn); | 3779 | } while (--cntdn); |
| 3767 | 3780 | ||
| @@ -3776,20 +3789,18 @@ _base_wait_for_doorbell_ack(struct MPT3SAS_ADAPTER *ioc, int timeout, | |||
| 3776 | * _base_wait_for_doorbell_not_used - waiting for doorbell to not be in use | 3789 | * _base_wait_for_doorbell_not_used - waiting for doorbell to not be in use |
| 3777 | * @ioc: per adapter object | 3790 | * @ioc: per adapter object |
| 3778 | * @timeout: timeout in second | 3791 | * @timeout: timeout in second |
| 3779 | * @sleep_flag: CAN_SLEEP or NO_SLEEP | ||
| 3780 | * | 3792 | * |
| 3781 | * Returns 0 for success, non-zero for failure. | 3793 | * Returns 0 for success, non-zero for failure. |
| 3782 | * | 3794 | * |
| 3783 | */ | 3795 | */ |
| 3784 | static int | 3796 | static int |
| 3785 | _base_wait_for_doorbell_not_used(struct MPT3SAS_ADAPTER *ioc, int timeout, | 3797 | _base_wait_for_doorbell_not_used(struct MPT3SAS_ADAPTER *ioc, int timeout) |
| 3786 | int sleep_flag) | ||
| 3787 | { | 3798 | { |
| 3788 | u32 cntdn, count; | 3799 | u32 cntdn, count; |
| 3789 | u32 doorbell_reg; | 3800 | u32 doorbell_reg; |
| 3790 | 3801 | ||
| 3791 | count = 0; | 3802 | count = 0; |
| 3792 | cntdn = (sleep_flag == CAN_SLEEP) ? 1000*timeout : 2000*timeout; | 3803 | cntdn = 1000 * timeout; |
| 3793 | do { | 3804 | do { |
| 3794 | doorbell_reg = readl(&ioc->chip->Doorbell); | 3805 | doorbell_reg = readl(&ioc->chip->Doorbell); |
| 3795 | if (!(doorbell_reg & MPI2_DOORBELL_USED)) { | 3806 | if (!(doorbell_reg & MPI2_DOORBELL_USED)) { |
| @@ -3798,10 +3809,8 @@ _base_wait_for_doorbell_not_used(struct MPT3SAS_ADAPTER *ioc, int timeout, | |||
| 3798 | ioc->name, __func__, count, timeout)); | 3809 | ioc->name, __func__, count, timeout)); |
| 3799 | return 0; | 3810 | return 0; |
| 3800 | } | 3811 | } |
| 3801 | if (sleep_flag == CAN_SLEEP) | 3812 | |
| 3802 | usleep_range(1000, 1500); | 3813 | usleep_range(1000, 1500); |
| 3803 | else | ||
| 3804 | udelay(500); | ||
| 3805 | count++; | 3814 | count++; |
| 3806 | } while (--cntdn); | 3815 | } while (--cntdn); |
| 3807 | 3816 | ||
| @@ -3816,13 +3825,11 @@ _base_wait_for_doorbell_not_used(struct MPT3SAS_ADAPTER *ioc, int timeout, | |||
| 3816 | * @ioc: per adapter object | 3825 | * @ioc: per adapter object |
| 3817 | * @reset_type: currently only supports: MPI2_FUNCTION_IOC_MESSAGE_UNIT_RESET | 3826 | * @reset_type: currently only supports: MPI2_FUNCTION_IOC_MESSAGE_UNIT_RESET |
| 3818 | * @timeout: timeout in second | 3827 | * @timeout: timeout in second |
| 3819 | * @sleep_flag: CAN_SLEEP or NO_SLEEP | ||
| 3820 | * | 3828 | * |
| 3821 | * Returns 0 for success, non-zero for failure. | 3829 | * Returns 0 for success, non-zero for failure. |
| 3822 | */ | 3830 | */ |
| 3823 | static int | 3831 | static int |
| 3824 | _base_send_ioc_reset(struct MPT3SAS_ADAPTER *ioc, u8 reset_type, int timeout, | 3832 | _base_send_ioc_reset(struct MPT3SAS_ADAPTER *ioc, u8 reset_type, int timeout) |
| 3825 | int sleep_flag) | ||
| 3826 | { | 3833 | { |
| 3827 | u32 ioc_state; | 3834 | u32 ioc_state; |
| 3828 | int r = 0; | 3835 | int r = 0; |
| @@ -3841,12 +3848,11 @@ _base_send_ioc_reset(struct MPT3SAS_ADAPTER *ioc, u8 reset_type, int timeout, | |||
| 3841 | 3848 | ||
| 3842 | writel(reset_type << MPI2_DOORBELL_FUNCTION_SHIFT, | 3849 | writel(reset_type << MPI2_DOORBELL_FUNCTION_SHIFT, |
| 3843 | &ioc->chip->Doorbell); | 3850 | &ioc->chip->Doorbell); |
| 3844 | if ((_base_wait_for_doorbell_ack(ioc, 15, sleep_flag))) { | 3851 | if ((_base_wait_for_doorbell_ack(ioc, 15))) { |
| 3845 | r = -EFAULT; | 3852 | r = -EFAULT; |
| 3846 | goto out; | 3853 | goto out; |
| 3847 | } | 3854 | } |
| 3848 | ioc_state = _base_wait_on_iocstate(ioc, MPI2_IOC_STATE_READY, | 3855 | ioc_state = _base_wait_on_iocstate(ioc, MPI2_IOC_STATE_READY, timeout); |
| 3849 | timeout, sleep_flag); | ||
| 3850 | if (ioc_state) { | 3856 | if (ioc_state) { |
| 3851 | pr_err(MPT3SAS_FMT | 3857 | pr_err(MPT3SAS_FMT |
| 3852 | "%s: failed going to ready state (ioc_state=0x%x)\n", | 3858 | "%s: failed going to ready state (ioc_state=0x%x)\n", |
| @@ -3868,13 +3874,12 @@ _base_send_ioc_reset(struct MPT3SAS_ADAPTER *ioc, u8 reset_type, int timeout, | |||
| 3868 | * @reply_bytes: reply length | 3874 | * @reply_bytes: reply length |
| 3869 | * @reply: pointer to reply payload | 3875 | * @reply: pointer to reply payload |
| 3870 | * @timeout: timeout in second | 3876 | * @timeout: timeout in second |
| 3871 | * @sleep_flag: CAN_SLEEP or NO_SLEEP | ||
| 3872 | * | 3877 | * |
| 3873 | * Returns 0 for success, non-zero for failure. | 3878 | * Returns 0 for success, non-zero for failure. |
| 3874 | */ | 3879 | */ |
| 3875 | static int | 3880 | static int |
| 3876 | _base_handshake_req_reply_wait(struct MPT3SAS_ADAPTER *ioc, int request_bytes, | 3881 | _base_handshake_req_reply_wait(struct MPT3SAS_ADAPTER *ioc, int request_bytes, |
| 3877 | u32 *request, int reply_bytes, u16 *reply, int timeout, int sleep_flag) | 3882 | u32 *request, int reply_bytes, u16 *reply, int timeout) |
| 3878 | { | 3883 | { |
| 3879 | MPI2DefaultReply_t *default_reply = (MPI2DefaultReply_t *)reply; | 3884 | MPI2DefaultReply_t *default_reply = (MPI2DefaultReply_t *)reply; |
| 3880 | int i; | 3885 | int i; |
| @@ -3900,7 +3905,7 @@ _base_handshake_req_reply_wait(struct MPT3SAS_ADAPTER *ioc, int request_bytes, | |||
| 3900 | ((request_bytes/4)<<MPI2_DOORBELL_ADD_DWORDS_SHIFT)), | 3905 | ((request_bytes/4)<<MPI2_DOORBELL_ADD_DWORDS_SHIFT)), |
| 3901 | &ioc->chip->Doorbell); | 3906 | &ioc->chip->Doorbell); |
| 3902 | 3907 | ||
| 3903 | if ((_base_wait_for_doorbell_int(ioc, 5, NO_SLEEP))) { | 3908 | if ((_base_spin_on_doorbell_int(ioc, 5))) { |
| 3904 | pr_err(MPT3SAS_FMT | 3909 | pr_err(MPT3SAS_FMT |
| 3905 | "doorbell handshake int failed (line=%d)\n", | 3910 | "doorbell handshake int failed (line=%d)\n", |
| 3906 | ioc->name, __LINE__); | 3911 | ioc->name, __LINE__); |
| @@ -3908,7 +3913,7 @@ _base_handshake_req_reply_wait(struct MPT3SAS_ADAPTER *ioc, int request_bytes, | |||
| 3908 | } | 3913 | } |
| 3909 | writel(0, &ioc->chip->HostInterruptStatus); | 3914 | writel(0, &ioc->chip->HostInterruptStatus); |
| 3910 | 3915 | ||
| 3911 | if ((_base_wait_for_doorbell_ack(ioc, 5, sleep_flag))) { | 3916 | if ((_base_wait_for_doorbell_ack(ioc, 5))) { |
| 3912 | pr_err(MPT3SAS_FMT | 3917 | pr_err(MPT3SAS_FMT |
| 3913 | "doorbell handshake ack failed (line=%d)\n", | 3918 | "doorbell handshake ack failed (line=%d)\n", |
| 3914 | ioc->name, __LINE__); | 3919 | ioc->name, __LINE__); |
| @@ -3918,7 +3923,7 @@ _base_handshake_req_reply_wait(struct MPT3SAS_ADAPTER *ioc, int request_bytes, | |||
| 3918 | /* send message 32-bits at a time */ | 3923 | /* send message 32-bits at a time */ |
| 3919 | for (i = 0, failed = 0; i < request_bytes/4 && !failed; i++) { | 3924 | for (i = 0, failed = 0; i < request_bytes/4 && !failed; i++) { |
| 3920 | writel(cpu_to_le32(request[i]), &ioc->chip->Doorbell); | 3925 | writel(cpu_to_le32(request[i]), &ioc->chip->Doorbell); |
| 3921 | if ((_base_wait_for_doorbell_ack(ioc, 5, sleep_flag))) | 3926 | if ((_base_wait_for_doorbell_ack(ioc, 5))) |
| 3922 | failed = 1; | 3927 | failed = 1; |
| 3923 | } | 3928 | } |
| 3924 | 3929 | ||
| @@ -3930,7 +3935,7 @@ _base_handshake_req_reply_wait(struct MPT3SAS_ADAPTER *ioc, int request_bytes, | |||
| 3930 | } | 3935 | } |
| 3931 | 3936 | ||
| 3932 | /* now wait for the reply */ | 3937 | /* now wait for the reply */ |
| 3933 | if ((_base_wait_for_doorbell_int(ioc, timeout, sleep_flag))) { | 3938 | if ((_base_wait_for_doorbell_int(ioc, timeout))) { |
| 3934 | pr_err(MPT3SAS_FMT | 3939 | pr_err(MPT3SAS_FMT |
| 3935 | "doorbell handshake int failed (line=%d)\n", | 3940 | "doorbell handshake int failed (line=%d)\n", |
| 3936 | ioc->name, __LINE__); | 3941 | ioc->name, __LINE__); |
| @@ -3941,7 +3946,7 @@ _base_handshake_req_reply_wait(struct MPT3SAS_ADAPTER *ioc, int request_bytes, | |||
| 3941 | reply[0] = le16_to_cpu(readl(&ioc->chip->Doorbell) | 3946 | reply[0] = le16_to_cpu(readl(&ioc->chip->Doorbell) |
| 3942 | & MPI2_DOORBELL_DATA_MASK); | 3947 | & MPI2_DOORBELL_DATA_MASK); |
| 3943 | writel(0, &ioc->chip->HostInterruptStatus); | 3948 | writel(0, &ioc->chip->HostInterruptStatus); |
| 3944 | if ((_base_wait_for_doorbell_int(ioc, 5, sleep_flag))) { | 3949 | if ((_base_wait_for_doorbell_int(ioc, 5))) { |
| 3945 | pr_err(MPT3SAS_FMT | 3950 | pr_err(MPT3SAS_FMT |
| 3946 | "doorbell handshake int failed (line=%d)\n", | 3951 | "doorbell handshake int failed (line=%d)\n", |
| 3947 | ioc->name, __LINE__); | 3952 | ioc->name, __LINE__); |
| @@ -3952,7 +3957,7 @@ _base_handshake_req_reply_wait(struct MPT3SAS_ADAPTER *ioc, int request_bytes, | |||
| 3952 | writel(0, &ioc->chip->HostInterruptStatus); | 3957 | writel(0, &ioc->chip->HostInterruptStatus); |
| 3953 | 3958 | ||
| 3954 | for (i = 2; i < default_reply->MsgLength * 2; i++) { | 3959 | for (i = 2; i < default_reply->MsgLength * 2; i++) { |
| 3955 | if ((_base_wait_for_doorbell_int(ioc, 5, sleep_flag))) { | 3960 | if ((_base_wait_for_doorbell_int(ioc, 5))) { |
| 3956 | pr_err(MPT3SAS_FMT | 3961 | pr_err(MPT3SAS_FMT |
| 3957 | "doorbell handshake int failed (line=%d)\n", | 3962 | "doorbell handshake int failed (line=%d)\n", |
| 3958 | ioc->name, __LINE__); | 3963 | ioc->name, __LINE__); |
| @@ -3966,8 +3971,8 @@ _base_handshake_req_reply_wait(struct MPT3SAS_ADAPTER *ioc, int request_bytes, | |||
| 3966 | writel(0, &ioc->chip->HostInterruptStatus); | 3971 | writel(0, &ioc->chip->HostInterruptStatus); |
| 3967 | } | 3972 | } |
| 3968 | 3973 | ||
| 3969 | _base_wait_for_doorbell_int(ioc, 5, sleep_flag); | 3974 | _base_wait_for_doorbell_int(ioc, 5); |
| 3970 | if (_base_wait_for_doorbell_not_used(ioc, 5, sleep_flag) != 0) { | 3975 | if (_base_wait_for_doorbell_not_used(ioc, 5) != 0) { |
| 3971 | dhsprintk(ioc, pr_info(MPT3SAS_FMT | 3976 | dhsprintk(ioc, pr_info(MPT3SAS_FMT |
| 3972 | "doorbell is in use (line=%d)\n", ioc->name, __LINE__)); | 3977 | "doorbell is in use (line=%d)\n", ioc->name, __LINE__)); |
| 3973 | } | 3978 | } |
| @@ -4082,8 +4087,7 @@ mpt3sas_base_sas_iounit_control(struct MPT3SAS_ADAPTER *ioc, | |||
| 4082 | 4087 | ||
| 4083 | issue_host_reset: | 4088 | issue_host_reset: |
| 4084 | if (issue_reset) | 4089 | if (issue_reset) |
| 4085 | mpt3sas_base_hard_reset_handler(ioc, CAN_SLEEP, | 4090 | mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER); |
| 4086 | FORCE_BIG_HAMMER); | ||
| 4087 | ioc->base_cmds.status = MPT3_CMD_NOT_USED; | 4091 | ioc->base_cmds.status = MPT3_CMD_NOT_USED; |
| 4088 | rc = -EFAULT; | 4092 | rc = -EFAULT; |
| 4089 | out: | 4093 | out: |
| @@ -4180,8 +4184,7 @@ mpt3sas_base_scsi_enclosure_processor(struct MPT3SAS_ADAPTER *ioc, | |||
| 4180 | 4184 | ||
| 4181 | issue_host_reset: | 4185 | issue_host_reset: |
| 4182 | if (issue_reset) | 4186 | if (issue_reset) |
| 4183 | mpt3sas_base_hard_reset_handler(ioc, CAN_SLEEP, | 4187 | mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER); |
| 4184 | FORCE_BIG_HAMMER); | ||
| 4185 | ioc->base_cmds.status = MPT3_CMD_NOT_USED; | 4188 | ioc->base_cmds.status = MPT3_CMD_NOT_USED; |
| 4186 | rc = -EFAULT; | 4189 | rc = -EFAULT; |
| 4187 | out: | 4190 | out: |
| @@ -4192,12 +4195,11 @@ mpt3sas_base_scsi_enclosure_processor(struct MPT3SAS_ADAPTER *ioc, | |||
| 4192 | /** | 4195 | /** |
| 4193 | * _base_get_port_facts - obtain port facts reply and save in ioc | 4196 | * _base_get_port_facts - obtain port facts reply and save in ioc |
| 4194 | * @ioc: per adapter object | 4197 | * @ioc: per adapter object |
| 4195 | * @sleep_flag: CAN_SLEEP or NO_SLEEP | ||
| 4196 | * | 4198 | * |
| 4197 | * Returns 0 for success, non-zero for failure. | 4199 | * Returns 0 for success, non-zero for failure. |
| 4198 | */ | 4200 | */ |
| 4199 | static int | 4201 | static int |
| 4200 | _base_get_port_facts(struct MPT3SAS_ADAPTER *ioc, int port, int sleep_flag) | 4202 | _base_get_port_facts(struct MPT3SAS_ADAPTER *ioc, int port) |
| 4201 | { | 4203 | { |
| 4202 | Mpi2PortFactsRequest_t mpi_request; | 4204 | Mpi2PortFactsRequest_t mpi_request; |
| 4203 | Mpi2PortFactsReply_t mpi_reply; | 4205 | Mpi2PortFactsReply_t mpi_reply; |
| @@ -4213,7 +4215,7 @@ _base_get_port_facts(struct MPT3SAS_ADAPTER *ioc, int port, int sleep_flag) | |||
| 4213 | mpi_request.Function = MPI2_FUNCTION_PORT_FACTS; | 4215 | mpi_request.Function = MPI2_FUNCTION_PORT_FACTS; |
| 4214 | mpi_request.PortNumber = port; | 4216 | mpi_request.PortNumber = port; |
| 4215 | r = _base_handshake_req_reply_wait(ioc, mpi_request_sz, | 4217 | r = _base_handshake_req_reply_wait(ioc, mpi_request_sz, |
| 4216 | (u32 *)&mpi_request, mpi_reply_sz, (u16 *)&mpi_reply, 5, CAN_SLEEP); | 4218 | (u32 *)&mpi_request, mpi_reply_sz, (u16 *)&mpi_reply, 5); |
| 4217 | 4219 | ||
| 4218 | if (r != 0) { | 4220 | if (r != 0) { |
| 4219 | pr_err(MPT3SAS_FMT "%s: handshake failed (r=%d)\n", | 4221 | pr_err(MPT3SAS_FMT "%s: handshake failed (r=%d)\n", |
| @@ -4236,13 +4238,11 @@ _base_get_port_facts(struct MPT3SAS_ADAPTER *ioc, int port, int sleep_flag) | |||
| 4236 | * _base_wait_for_iocstate - Wait until the card is in READY or OPERATIONAL | 4238 | * _base_wait_for_iocstate - Wait until the card is in READY or OPERATIONAL |
| 4237 | * @ioc: per adapter object | 4239 | * @ioc: per adapter object |
| 4238 | * @timeout: | 4240 | * @timeout: |
| 4239 | * @sleep_flag: CAN_SLEEP or NO_SLEEP | ||
| 4240 | * | 4241 | * |
| 4241 | * Returns 0 for success, non-zero for failure. | 4242 | * Returns 0 for success, non-zero for failure. |
| 4242 | */ | 4243 | */ |
| 4243 | static int | 4244 | static int |
| 4244 | _base_wait_for_iocstate(struct MPT3SAS_ADAPTER *ioc, int timeout, | 4245 | _base_wait_for_iocstate(struct MPT3SAS_ADAPTER *ioc, int timeout) |
| 4245 | int sleep_flag) | ||
| 4246 | { | 4246 | { |
| 4247 | u32 ioc_state; | 4247 | u32 ioc_state; |
| 4248 | int rc; | 4248 | int rc; |
| @@ -4276,8 +4276,7 @@ _base_wait_for_iocstate(struct MPT3SAS_ADAPTER *ioc, int timeout, | |||
| 4276 | goto issue_diag_reset; | 4276 | goto issue_diag_reset; |
| 4277 | } | 4277 | } |
| 4278 | 4278 | ||
| 4279 | ioc_state = _base_wait_on_iocstate(ioc, MPI2_IOC_STATE_READY, | 4279 | ioc_state = _base_wait_on_iocstate(ioc, MPI2_IOC_STATE_READY, timeout); |
| 4280 | timeout, sleep_flag); | ||
| 4281 | if (ioc_state) { | 4280 | if (ioc_state) { |
| 4282 | dfailprintk(ioc, printk(MPT3SAS_FMT | 4281 | dfailprintk(ioc, printk(MPT3SAS_FMT |
| 4283 | "%s: failed going to ready state (ioc_state=0x%x)\n", | 4282 | "%s: failed going to ready state (ioc_state=0x%x)\n", |
| @@ -4286,19 +4285,18 @@ _base_wait_for_iocstate(struct MPT3SAS_ADAPTER *ioc, int timeout, | |||
| 4286 | } | 4285 | } |
| 4287 | 4286 | ||
| 4288 | issue_diag_reset: | 4287 | issue_diag_reset: |
| 4289 | rc = _base_diag_reset(ioc, sleep_flag); | 4288 | rc = _base_diag_reset(ioc); |
| 4290 | return rc; | 4289 | return rc; |
| 4291 | } | 4290 | } |
| 4292 | 4291 | ||
| 4293 | /** | 4292 | /** |
| 4294 | * _base_get_ioc_facts - obtain ioc facts reply and save in ioc | 4293 | * _base_get_ioc_facts - obtain ioc facts reply and save in ioc |
| 4295 | * @ioc: per adapter object | 4294 | * @ioc: per adapter object |
| 4296 | * @sleep_flag: CAN_SLEEP or NO_SLEEP | ||
| 4297 | * | 4295 | * |
| 4298 | * Returns 0 for success, non-zero for failure. | 4296 | * Returns 0 for success, non-zero for failure. |
| 4299 | */ | 4297 | */ |
| 4300 | static int | 4298 | static int |
| 4301 | _base_get_ioc_facts(struct MPT3SAS_ADAPTER *ioc, int sleep_flag) | 4299 | _base_get_ioc_facts(struct MPT3SAS_ADAPTER *ioc) |
| 4302 | { | 4300 | { |
| 4303 | Mpi2IOCFactsRequest_t mpi_request; | 4301 | Mpi2IOCFactsRequest_t mpi_request; |
| 4304 | Mpi2IOCFactsReply_t mpi_reply; | 4302 | Mpi2IOCFactsReply_t mpi_reply; |
| @@ -4308,7 +4306,7 @@ _base_get_ioc_facts(struct MPT3SAS_ADAPTER *ioc, int sleep_flag) | |||
| 4308 | dinitprintk(ioc, pr_info(MPT3SAS_FMT "%s\n", ioc->name, | 4306 | dinitprintk(ioc, pr_info(MPT3SAS_FMT "%s\n", ioc->name, |
| 4309 | __func__)); | 4307 | __func__)); |
| 4310 | 4308 | ||
| 4311 | r = _base_wait_for_iocstate(ioc, 10, sleep_flag); | 4309 | r = _base_wait_for_iocstate(ioc, 10); |
| 4312 | if (r) { | 4310 | if (r) { |
| 4313 | dfailprintk(ioc, printk(MPT3SAS_FMT | 4311 | dfailprintk(ioc, printk(MPT3SAS_FMT |
| 4314 | "%s: failed getting to correct state\n", | 4312 | "%s: failed getting to correct state\n", |
| @@ -4320,7 +4318,7 @@ _base_get_ioc_facts(struct MPT3SAS_ADAPTER *ioc, int sleep_flag) | |||
| 4320 | memset(&mpi_request, 0, mpi_request_sz); | 4318 | memset(&mpi_request, 0, mpi_request_sz); |
| 4321 | mpi_request.Function = MPI2_FUNCTION_IOC_FACTS; | 4319 | mpi_request.Function = MPI2_FUNCTION_IOC_FACTS; |
| 4322 | r = _base_handshake_req_reply_wait(ioc, mpi_request_sz, | 4320 | r = _base_handshake_req_reply_wait(ioc, mpi_request_sz, |
| 4323 | (u32 *)&mpi_request, mpi_reply_sz, (u16 *)&mpi_reply, 5, CAN_SLEEP); | 4321 | (u32 *)&mpi_request, mpi_reply_sz, (u16 *)&mpi_reply, 5); |
| 4324 | 4322 | ||
| 4325 | if (r != 0) { | 4323 | if (r != 0) { |
| 4326 | pr_err(MPT3SAS_FMT "%s: handshake failed (r=%d)\n", | 4324 | pr_err(MPT3SAS_FMT "%s: handshake failed (r=%d)\n", |
| @@ -4380,12 +4378,11 @@ _base_get_ioc_facts(struct MPT3SAS_ADAPTER *ioc, int sleep_flag) | |||
| 4380 | /** | 4378 | /** |
| 4381 | * _base_send_ioc_init - send ioc_init to firmware | 4379 | * _base_send_ioc_init - send ioc_init to firmware |
| 4382 | * @ioc: per adapter object | 4380 | * @ioc: per adapter object |
| 4383 | * @sleep_flag: CAN_SLEEP or NO_SLEEP | ||
| 4384 | * | 4381 | * |
| 4385 | * Returns 0 for success, non-zero for failure. | 4382 | * Returns 0 for success, non-zero for failure. |
| 4386 | */ | 4383 | */ |
| 4387 | static int | 4384 | static int |
| 4388 | _base_send_ioc_init(struct MPT3SAS_ADAPTER *ioc, int sleep_flag) | 4385 | _base_send_ioc_init(struct MPT3SAS_ADAPTER *ioc) |
| 4389 | { | 4386 | { |
| 4390 | Mpi2IOCInitRequest_t mpi_request; | 4387 | Mpi2IOCInitRequest_t mpi_request; |
| 4391 | Mpi2IOCInitReply_t mpi_reply; | 4388 | Mpi2IOCInitReply_t mpi_reply; |
| @@ -4468,8 +4465,7 @@ _base_send_ioc_init(struct MPT3SAS_ADAPTER *ioc, int sleep_flag) | |||
| 4468 | 4465 | ||
| 4469 | r = _base_handshake_req_reply_wait(ioc, | 4466 | r = _base_handshake_req_reply_wait(ioc, |
| 4470 | sizeof(Mpi2IOCInitRequest_t), (u32 *)&mpi_request, | 4467 | sizeof(Mpi2IOCInitRequest_t), (u32 *)&mpi_request, |
| 4471 | sizeof(Mpi2IOCInitReply_t), (u16 *)&mpi_reply, 10, | 4468 | sizeof(Mpi2IOCInitReply_t), (u16 *)&mpi_reply, 10); |
| 4472 | sleep_flag); | ||
| 4473 | 4469 | ||
| 4474 | if (r != 0) { | 4470 | if (r != 0) { |
| 4475 | pr_err(MPT3SAS_FMT "%s: handshake failed (r=%d)\n", | 4471 | pr_err(MPT3SAS_FMT "%s: handshake failed (r=%d)\n", |
| @@ -4544,12 +4540,11 @@ mpt3sas_port_enable_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, | |||
| 4544 | /** | 4540 | /** |
| 4545 | * _base_send_port_enable - send port_enable(discovery stuff) to firmware | 4541 | * _base_send_port_enable - send port_enable(discovery stuff) to firmware |
| 4546 | * @ioc: per adapter object | 4542 | * @ioc: per adapter object |
| 4547 | * @sleep_flag: CAN_SLEEP or NO_SLEEP | ||
| 4548 | * | 4543 | * |
| 4549 | * Returns 0 for success, non-zero for failure. | 4544 | * Returns 0 for success, non-zero for failure. |
| 4550 | */ | 4545 | */ |
| 4551 | static int | 4546 | static int |
| 4552 | _base_send_port_enable(struct MPT3SAS_ADAPTER *ioc, int sleep_flag) | 4547 | _base_send_port_enable(struct MPT3SAS_ADAPTER *ioc) |
| 4553 | { | 4548 | { |
| 4554 | Mpi2PortEnableRequest_t *mpi_request; | 4549 | Mpi2PortEnableRequest_t *mpi_request; |
| 4555 | Mpi2PortEnableReply_t *mpi_reply; | 4550 | Mpi2PortEnableReply_t *mpi_reply; |
| @@ -4726,12 +4721,11 @@ _base_unmask_events(struct MPT3SAS_ADAPTER *ioc, u16 event) | |||
| 4726 | /** | 4721 | /** |
| 4727 | * _base_event_notification - send event notification | 4722 | * _base_event_notification - send event notification |
| 4728 | * @ioc: per adapter object | 4723 | * @ioc: per adapter object |
| 4729 | * @sleep_flag: CAN_SLEEP or NO_SLEEP | ||
| 4730 | * | 4724 | * |
| 4731 | * Returns 0 for success, non-zero for failure. | 4725 | * Returns 0 for success, non-zero for failure. |
| 4732 | */ | 4726 | */ |
| 4733 | static int | 4727 | static int |
| 4734 | _base_event_notification(struct MPT3SAS_ADAPTER *ioc, int sleep_flag) | 4728 | _base_event_notification(struct MPT3SAS_ADAPTER *ioc) |
| 4735 | { | 4729 | { |
| 4736 | Mpi2EventNotificationRequest_t *mpi_request; | 4730 | Mpi2EventNotificationRequest_t *mpi_request; |
| 4737 | unsigned long timeleft; | 4731 | unsigned long timeleft; |
| @@ -4816,19 +4810,18 @@ mpt3sas_base_validate_event_type(struct MPT3SAS_ADAPTER *ioc, u32 *event_type) | |||
| 4816 | return; | 4810 | return; |
| 4817 | 4811 | ||
| 4818 | mutex_lock(&ioc->base_cmds.mutex); | 4812 | mutex_lock(&ioc->base_cmds.mutex); |
| 4819 | _base_event_notification(ioc, CAN_SLEEP); | 4813 | _base_event_notification(ioc); |
| 4820 | mutex_unlock(&ioc->base_cmds.mutex); | 4814 | mutex_unlock(&ioc->base_cmds.mutex); |
| 4821 | } | 4815 | } |
| 4822 | 4816 | ||
| 4823 | /** | 4817 | /** |
| 4824 | * _base_diag_reset - the "big hammer" start of day reset | 4818 | * _base_diag_reset - the "big hammer" start of day reset |
| 4825 | * @ioc: per adapter object | 4819 | * @ioc: per adapter object |
| 4826 | * @sleep_flag: CAN_SLEEP or NO_SLEEP | ||
| 4827 | * | 4820 | * |
| 4828 | * Returns 0 for success, non-zero for failure. | 4821 | * Returns 0 for success, non-zero for failure. |
| 4829 | */ | 4822 | */ |
| 4830 | static int | 4823 | static int |
| 4831 | _base_diag_reset(struct MPT3SAS_ADAPTER *ioc, int sleep_flag) | 4824 | _base_diag_reset(struct MPT3SAS_ADAPTER *ioc) |
| 4832 | { | 4825 | { |
| 4833 | u32 host_diagnostic; | 4826 | u32 host_diagnostic; |
| 4834 | u32 ioc_state; | 4827 | u32 ioc_state; |
| @@ -4856,10 +4849,7 @@ _base_diag_reset(struct MPT3SAS_ADAPTER *ioc, int sleep_flag) | |||
| 4856 | writel(MPI2_WRSEQ_6TH_KEY_VALUE, &ioc->chip->WriteSequence); | 4849 | writel(MPI2_WRSEQ_6TH_KEY_VALUE, &ioc->chip->WriteSequence); |
| 4857 | 4850 | ||
| 4858 | /* wait 100 msec */ | 4851 | /* wait 100 msec */ |
| 4859 | if (sleep_flag == CAN_SLEEP) | 4852 | msleep(100); |
| 4860 | msleep(100); | ||
| 4861 | else | ||
| 4862 | mdelay(100); | ||
| 4863 | 4853 | ||
| 4864 | if (count++ > 20) | 4854 | if (count++ > 20) |
| 4865 | goto out; | 4855 | goto out; |
| @@ -4879,10 +4869,7 @@ _base_diag_reset(struct MPT3SAS_ADAPTER *ioc, int sleep_flag) | |||
| 4879 | &ioc->chip->HostDiagnostic); | 4869 | &ioc->chip->HostDiagnostic); |
| 4880 | 4870 | ||
| 4881 | /*This delay allows the chip PCIe hardware time to finish reset tasks*/ | 4871 | /*This delay allows the chip PCIe hardware time to finish reset tasks*/ |
| 4882 | if (sleep_flag == CAN_SLEEP) | 4872 | msleep(MPI2_HARD_RESET_PCIE_FIRST_READ_DELAY_MICRO_SEC/1000); |
| 4883 | msleep(MPI2_HARD_RESET_PCIE_FIRST_READ_DELAY_MICRO_SEC/1000); | ||
| 4884 | else | ||
| 4885 | mdelay(MPI2_HARD_RESET_PCIE_FIRST_READ_DELAY_MICRO_SEC/1000); | ||
| 4886 | 4873 | ||
| 4887 | /* Approximately 300 second max wait */ | 4874 | /* Approximately 300 second max wait */ |
| 4888 | for (count = 0; count < (300000000 / | 4875 | for (count = 0; count < (300000000 / |
| @@ -4895,13 +4882,7 @@ _base_diag_reset(struct MPT3SAS_ADAPTER *ioc, int sleep_flag) | |||
| 4895 | if (!(host_diagnostic & MPI2_DIAG_RESET_ADAPTER)) | 4882 | if (!(host_diagnostic & MPI2_DIAG_RESET_ADAPTER)) |
| 4896 | break; | 4883 | break; |
| 4897 | 4884 | ||
| 4898 | /* Wait to pass the second read delay window */ | 4885 | msleep(MPI2_HARD_RESET_PCIE_SECOND_READ_DELAY_MICRO_SEC / 1000); |
| 4899 | if (sleep_flag == CAN_SLEEP) | ||
| 4900 | msleep(MPI2_HARD_RESET_PCIE_SECOND_READ_DELAY_MICRO_SEC | ||
| 4901 | / 1000); | ||
| 4902 | else | ||
| 4903 | mdelay(MPI2_HARD_RESET_PCIE_SECOND_READ_DELAY_MICRO_SEC | ||
| 4904 | / 1000); | ||
| 4905 | } | 4886 | } |
| 4906 | 4887 | ||
| 4907 | if (host_diagnostic & MPI2_DIAG_HCB_MODE) { | 4888 | if (host_diagnostic & MPI2_DIAG_HCB_MODE) { |
| @@ -4930,8 +4911,7 @@ _base_diag_reset(struct MPT3SAS_ADAPTER *ioc, int sleep_flag) | |||
| 4930 | 4911 | ||
| 4931 | drsprintk(ioc, pr_info(MPT3SAS_FMT | 4912 | drsprintk(ioc, pr_info(MPT3SAS_FMT |
| 4932 | "Wait for FW to go to the READY state\n", ioc->name)); | 4913 | "Wait for FW to go to the READY state\n", ioc->name)); |
| 4933 | ioc_state = _base_wait_on_iocstate(ioc, MPI2_IOC_STATE_READY, 20, | 4914 | ioc_state = _base_wait_on_iocstate(ioc, MPI2_IOC_STATE_READY, 20); |
| 4934 | sleep_flag); | ||
| 4935 | if (ioc_state) { | 4915 | if (ioc_state) { |
| 4936 | pr_err(MPT3SAS_FMT | 4916 | pr_err(MPT3SAS_FMT |
| 4937 | "%s: failed going to ready state (ioc_state=0x%x)\n", | 4917 | "%s: failed going to ready state (ioc_state=0x%x)\n", |
| @@ -4950,14 +4930,12 @@ _base_diag_reset(struct MPT3SAS_ADAPTER *ioc, int sleep_flag) | |||
| 4950 | /** | 4930 | /** |
| 4951 | * _base_make_ioc_ready - put controller in READY state | 4931 | * _base_make_ioc_ready - put controller in READY state |
| 4952 | * @ioc: per adapter object | 4932 | * @ioc: per adapter object |
| 4953 | * @sleep_flag: CAN_SLEEP or NO_SLEEP | ||
| 4954 | * @type: FORCE_BIG_HAMMER or SOFT_RESET | 4933 | * @type: FORCE_BIG_HAMMER or SOFT_RESET |
| 4955 | * | 4934 | * |
| 4956 | * Returns 0 for success, non-zero for failure. | 4935 | * Returns 0 for success, non-zero for failure. |
| 4957 | */ | 4936 | */ |
| 4958 | static int | 4937 | static int |
| 4959 | _base_make_ioc_ready(struct MPT3SAS_ADAPTER *ioc, int sleep_flag, | 4938 | _base_make_ioc_ready(struct MPT3SAS_ADAPTER *ioc, enum reset_type type) |
| 4960 | enum reset_type type) | ||
| 4961 | { | 4939 | { |
| 4962 | u32 ioc_state; | 4940 | u32 ioc_state; |
| 4963 | int rc; | 4941 | int rc; |
| @@ -4984,10 +4962,7 @@ _base_make_ioc_ready(struct MPT3SAS_ADAPTER *ioc, int sleep_flag, | |||
| 4984 | ioc->name, __func__, ioc_state); | 4962 | ioc->name, __func__, ioc_state); |
| 4985 | return -EFAULT; | 4963 | return -EFAULT; |
| 4986 | } | 4964 | } |
| 4987 | if (sleep_flag == CAN_SLEEP) | 4965 | ssleep(1); |
| 4988 | ssleep(1); | ||
| 4989 | else | ||
| 4990 | mdelay(1000); | ||
| 4991 | ioc_state = mpt3sas_base_get_iocstate(ioc, 0); | 4966 | ioc_state = mpt3sas_base_get_iocstate(ioc, 0); |
| 4992 | } | 4967 | } |
| 4993 | } | 4968 | } |
| @@ -5013,24 +4988,23 @@ _base_make_ioc_ready(struct MPT3SAS_ADAPTER *ioc, int sleep_flag, | |||
| 5013 | 4988 | ||
| 5014 | if ((ioc_state & MPI2_IOC_STATE_MASK) == MPI2_IOC_STATE_OPERATIONAL) | 4989 | if ((ioc_state & MPI2_IOC_STATE_MASK) == MPI2_IOC_STATE_OPERATIONAL) |
| 5015 | if (!(_base_send_ioc_reset(ioc, | 4990 | if (!(_base_send_ioc_reset(ioc, |
| 5016 | MPI2_FUNCTION_IOC_MESSAGE_UNIT_RESET, 15, CAN_SLEEP))) { | 4991 | MPI2_FUNCTION_IOC_MESSAGE_UNIT_RESET, 15))) { |
| 5017 | return 0; | 4992 | return 0; |
| 5018 | } | 4993 | } |
| 5019 | 4994 | ||
| 5020 | issue_diag_reset: | 4995 | issue_diag_reset: |
| 5021 | rc = _base_diag_reset(ioc, CAN_SLEEP); | 4996 | rc = _base_diag_reset(ioc); |
| 5022 | return rc; | 4997 | return rc; |
| 5023 | } | 4998 | } |
| 5024 | 4999 | ||
| 5025 | /** | 5000 | /** |
| 5026 | * _base_make_ioc_operational - put controller in OPERATIONAL state | 5001 | * _base_make_ioc_operational - put controller in OPERATIONAL state |
| 5027 | * @ioc: per adapter object | 5002 | * @ioc: per adapter object |
| 5028 | * @sleep_flag: CAN_SLEEP or NO_SLEEP | ||
| 5029 | * | 5003 | * |
| 5030 | * Returns 0 for success, non-zero for failure. | 5004 | * Returns 0 for success, non-zero for failure. |
| 5031 | */ | 5005 | */ |
| 5032 | static int | 5006 | static int |
| 5033 | _base_make_ioc_operational(struct MPT3SAS_ADAPTER *ioc, int sleep_flag) | 5007 | _base_make_ioc_operational(struct MPT3SAS_ADAPTER *ioc) |
| 5034 | { | 5008 | { |
| 5035 | int r, i, index; | 5009 | int r, i, index; |
| 5036 | unsigned long flags; | 5010 | unsigned long flags; |
| @@ -5149,7 +5123,7 @@ _base_make_ioc_operational(struct MPT3SAS_ADAPTER *ioc, int sleep_flag) | |||
| 5149 | } | 5123 | } |
| 5150 | skip_init_reply_post_free_queue: | 5124 | skip_init_reply_post_free_queue: |
| 5151 | 5125 | ||
| 5152 | r = _base_send_ioc_init(ioc, sleep_flag); | 5126 | r = _base_send_ioc_init(ioc); |
| 5153 | if (r) | 5127 | if (r) |
| 5154 | return r; | 5128 | return r; |
| 5155 | 5129 | ||
| @@ -5175,13 +5149,11 @@ _base_make_ioc_operational(struct MPT3SAS_ADAPTER *ioc, int sleep_flag) | |||
| 5175 | skip_init_reply_post_host_index: | 5149 | skip_init_reply_post_host_index: |
| 5176 | 5150 | ||
| 5177 | _base_unmask_interrupts(ioc); | 5151 | _base_unmask_interrupts(ioc); |
| 5178 | r = _base_event_notification(ioc, sleep_flag); | 5152 | r = _base_event_notification(ioc); |
| 5179 | if (r) | 5153 | if (r) |
| 5180 | return r; | 5154 | return r; |
| 5181 | 5155 | ||
| 5182 | if (sleep_flag == CAN_SLEEP) | 5156 | _base_static_config_pages(ioc); |
| 5183 | _base_static_config_pages(ioc); | ||
| 5184 | |||
| 5185 | 5157 | ||
| 5186 | if (ioc->is_driver_loading) { | 5158 | if (ioc->is_driver_loading) { |
| 5187 | 5159 | ||
| @@ -5200,7 +5172,7 @@ _base_make_ioc_operational(struct MPT3SAS_ADAPTER *ioc, int sleep_flag) | |||
| 5200 | return r; /* scan_start and scan_finished support */ | 5172 | return r; /* scan_start and scan_finished support */ |
| 5201 | } | 5173 | } |
| 5202 | 5174 | ||
| 5203 | r = _base_send_port_enable(ioc, sleep_flag); | 5175 | r = _base_send_port_enable(ioc); |
| 5204 | if (r) | 5176 | if (r) |
| 5205 | return r; | 5177 | return r; |
| 5206 | 5178 | ||
| @@ -5224,7 +5196,7 @@ mpt3sas_base_free_resources(struct MPT3SAS_ADAPTER *ioc) | |||
| 5224 | if (ioc->chip_phys && ioc->chip) { | 5196 | if (ioc->chip_phys && ioc->chip) { |
| 5225 | _base_mask_interrupts(ioc); | 5197 | _base_mask_interrupts(ioc); |
| 5226 | ioc->shost_recovery = 1; | 5198 | ioc->shost_recovery = 1; |
| 5227 | _base_make_ioc_ready(ioc, CAN_SLEEP, SOFT_RESET); | 5199 | _base_make_ioc_ready(ioc, SOFT_RESET); |
| 5228 | ioc->shost_recovery = 0; | 5200 | ioc->shost_recovery = 0; |
| 5229 | } | 5201 | } |
| 5230 | 5202 | ||
| @@ -5292,7 +5264,7 @@ mpt3sas_base_attach(struct MPT3SAS_ADAPTER *ioc) | |||
| 5292 | } | 5264 | } |
| 5293 | 5265 | ||
| 5294 | pci_set_drvdata(ioc->pdev, ioc->shost); | 5266 | pci_set_drvdata(ioc->pdev, ioc->shost); |
| 5295 | r = _base_get_ioc_facts(ioc, CAN_SLEEP); | 5267 | r = _base_get_ioc_facts(ioc); |
| 5296 | if (r) | 5268 | if (r) |
| 5297 | goto out_free_resources; | 5269 | goto out_free_resources; |
| 5298 | 5270 | ||
| @@ -5326,7 +5298,7 @@ mpt3sas_base_attach(struct MPT3SAS_ADAPTER *ioc) | |||
| 5326 | ioc->build_sg_mpi = &_base_build_sg; | 5298 | ioc->build_sg_mpi = &_base_build_sg; |
| 5327 | ioc->build_zero_len_sge_mpi = &_base_build_zero_len_sge; | 5299 | ioc->build_zero_len_sge_mpi = &_base_build_zero_len_sge; |
| 5328 | 5300 | ||
| 5329 | r = _base_make_ioc_ready(ioc, CAN_SLEEP, SOFT_RESET); | 5301 | r = _base_make_ioc_ready(ioc, SOFT_RESET); |
| 5330 | if (r) | 5302 | if (r) |
| 5331 | goto out_free_resources; | 5303 | goto out_free_resources; |
| 5332 | 5304 | ||
| @@ -5338,12 +5310,12 @@ mpt3sas_base_attach(struct MPT3SAS_ADAPTER *ioc) | |||
| 5338 | } | 5310 | } |
| 5339 | 5311 | ||
| 5340 | for (i = 0 ; i < ioc->facts.NumberOfPorts; i++) { | 5312 | for (i = 0 ; i < ioc->facts.NumberOfPorts; i++) { |
| 5341 | r = _base_get_port_facts(ioc, i, CAN_SLEEP); | 5313 | r = _base_get_port_facts(ioc, i); |
| 5342 | if (r) | 5314 | if (r) |
| 5343 | goto out_free_resources; | 5315 | goto out_free_resources; |
| 5344 | } | 5316 | } |
| 5345 | 5317 | ||
| 5346 | r = _base_allocate_memory_pools(ioc, CAN_SLEEP); | 5318 | r = _base_allocate_memory_pools(ioc); |
| 5347 | if (r) | 5319 | if (r) |
| 5348 | goto out_free_resources; | 5320 | goto out_free_resources; |
| 5349 | 5321 | ||
| @@ -5429,7 +5401,7 @@ mpt3sas_base_attach(struct MPT3SAS_ADAPTER *ioc) | |||
| 5429 | if (ioc->hba_mpi_version_belonged == MPI26_VERSION) | 5401 | if (ioc->hba_mpi_version_belonged == MPI26_VERSION) |
| 5430 | _base_unmask_events(ioc, MPI2_EVENT_ACTIVE_CABLE_EXCEPTION); | 5402 | _base_unmask_events(ioc, MPI2_EVENT_ACTIVE_CABLE_EXCEPTION); |
| 5431 | 5403 | ||
| 5432 | r = _base_make_ioc_operational(ioc, CAN_SLEEP); | 5404 | r = _base_make_ioc_operational(ioc); |
| 5433 | if (r) | 5405 | if (r) |
| 5434 | goto out_free_resources; | 5406 | goto out_free_resources; |
| 5435 | 5407 | ||
| @@ -5565,21 +5537,18 @@ _base_reset_handler(struct MPT3SAS_ADAPTER *ioc, int reset_phase) | |||
| 5565 | /** | 5537 | /** |
| 5566 | * _wait_for_commands_to_complete - reset controller | 5538 | * _wait_for_commands_to_complete - reset controller |
| 5567 | * @ioc: Pointer to MPT_ADAPTER structure | 5539 | * @ioc: Pointer to MPT_ADAPTER structure |
| 5568 | * @sleep_flag: CAN_SLEEP or NO_SLEEP | ||
| 5569 | * | 5540 | * |
| 5570 | * This function waiting(3s) for all pending commands to complete | 5541 | * This function waiting(3s) for all pending commands to complete |
| 5571 | * prior to putting controller in reset. | 5542 | * prior to putting controller in reset. |
| 5572 | */ | 5543 | */ |
| 5573 | static void | 5544 | static void |
| 5574 | _wait_for_commands_to_complete(struct MPT3SAS_ADAPTER *ioc, int sleep_flag) | 5545 | _wait_for_commands_to_complete(struct MPT3SAS_ADAPTER *ioc) |
| 5575 | { | 5546 | { |
| 5576 | u32 ioc_state; | 5547 | u32 ioc_state; |
| 5577 | unsigned long flags; | 5548 | unsigned long flags; |
| 5578 | u16 i; | 5549 | u16 i; |
| 5579 | 5550 | ||
| 5580 | ioc->pending_io_count = 0; | 5551 | ioc->pending_io_count = 0; |
| 5581 | if (sleep_flag != CAN_SLEEP) | ||
| 5582 | return; | ||
| 5583 | 5552 | ||
| 5584 | ioc_state = mpt3sas_base_get_iocstate(ioc, 0); | 5553 | ioc_state = mpt3sas_base_get_iocstate(ioc, 0); |
| 5585 | if ((ioc_state & MPI2_IOC_STATE_MASK) != MPI2_IOC_STATE_OPERATIONAL) | 5554 | if ((ioc_state & MPI2_IOC_STATE_MASK) != MPI2_IOC_STATE_OPERATIONAL) |
| @@ -5602,13 +5571,12 @@ _wait_for_commands_to_complete(struct MPT3SAS_ADAPTER *ioc, int sleep_flag) | |||
| 5602 | /** | 5571 | /** |
| 5603 | * mpt3sas_base_hard_reset_handler - reset controller | 5572 | * mpt3sas_base_hard_reset_handler - reset controller |
| 5604 | * @ioc: Pointer to MPT_ADAPTER structure | 5573 | * @ioc: Pointer to MPT_ADAPTER structure |
| 5605 | * @sleep_flag: CAN_SLEEP or NO_SLEEP | ||
| 5606 | * @type: FORCE_BIG_HAMMER or SOFT_RESET | 5574 | * @type: FORCE_BIG_HAMMER or SOFT_RESET |
| 5607 | * | 5575 | * |
| 5608 | * Returns 0 for success, non-zero for failure. | 5576 | * Returns 0 for success, non-zero for failure. |
| 5609 | */ | 5577 | */ |
| 5610 | int | 5578 | int |
| 5611 | mpt3sas_base_hard_reset_handler(struct MPT3SAS_ADAPTER *ioc, int sleep_flag, | 5579 | mpt3sas_base_hard_reset_handler(struct MPT3SAS_ADAPTER *ioc, |
| 5612 | enum reset_type type) | 5580 | enum reset_type type) |
| 5613 | { | 5581 | { |
| 5614 | int r; | 5582 | int r; |
| @@ -5629,13 +5597,6 @@ mpt3sas_base_hard_reset_handler(struct MPT3SAS_ADAPTER *ioc, int sleep_flag, | |||
| 5629 | if (mpt3sas_fwfault_debug) | 5597 | if (mpt3sas_fwfault_debug) |
| 5630 | mpt3sas_halt_firmware(ioc); | 5598 | mpt3sas_halt_firmware(ioc); |
| 5631 | 5599 | ||
| 5632 | /* TODO - What we really should be doing is pulling | ||
| 5633 | * out all the code associated with NO_SLEEP; its never used. | ||
| 5634 | * That is legacy code from mpt fusion driver, ported over. | ||
| 5635 | * I will leave this BUG_ON here for now till its been resolved. | ||
| 5636 | */ | ||
| 5637 | BUG_ON(sleep_flag == NO_SLEEP); | ||
| 5638 | |||
| 5639 | /* wait for an active reset in progress to complete */ | 5600 | /* wait for an active reset in progress to complete */ |
| 5640 | if (!mutex_trylock(&ioc->reset_in_progress_mutex)) { | 5601 | if (!mutex_trylock(&ioc->reset_in_progress_mutex)) { |
| 5641 | do { | 5602 | do { |
| @@ -5660,9 +5621,9 @@ mpt3sas_base_hard_reset_handler(struct MPT3SAS_ADAPTER *ioc, int sleep_flag, | |||
| 5660 | is_fault = 1; | 5621 | is_fault = 1; |
| 5661 | } | 5622 | } |
| 5662 | _base_reset_handler(ioc, MPT3_IOC_PRE_RESET); | 5623 | _base_reset_handler(ioc, MPT3_IOC_PRE_RESET); |
| 5663 | _wait_for_commands_to_complete(ioc, sleep_flag); | 5624 | _wait_for_commands_to_complete(ioc); |
| 5664 | _base_mask_interrupts(ioc); | 5625 | _base_mask_interrupts(ioc); |
| 5665 | r = _base_make_ioc_ready(ioc, sleep_flag, type); | 5626 | r = _base_make_ioc_ready(ioc, type); |
| 5666 | if (r) | 5627 | if (r) |
| 5667 | goto out; | 5628 | goto out; |
| 5668 | _base_reset_handler(ioc, MPT3_IOC_AFTER_RESET); | 5629 | _base_reset_handler(ioc, MPT3_IOC_AFTER_RESET); |
| @@ -5675,7 +5636,7 @@ mpt3sas_base_hard_reset_handler(struct MPT3SAS_ADAPTER *ioc, int sleep_flag, | |||
| 5675 | r = -EFAULT; | 5636 | r = -EFAULT; |
| 5676 | goto out; | 5637 | goto out; |
| 5677 | } | 5638 | } |
| 5678 | r = _base_get_ioc_facts(ioc, CAN_SLEEP); | 5639 | r = _base_get_ioc_facts(ioc); |
| 5679 | if (r) | 5640 | if (r) |
| 5680 | goto out; | 5641 | goto out; |
| 5681 | 5642 | ||
| @@ -5684,7 +5645,7 @@ mpt3sas_base_hard_reset_handler(struct MPT3SAS_ADAPTER *ioc, int sleep_flag, | |||
| 5684 | "Please reboot the system and ensure that the correct" | 5645 | "Please reboot the system and ensure that the correct" |
| 5685 | " firmware version is running\n", ioc->name); | 5646 | " firmware version is running\n", ioc->name); |
| 5686 | 5647 | ||
| 5687 | r = _base_make_ioc_operational(ioc, sleep_flag); | 5648 | r = _base_make_ioc_operational(ioc); |
| 5688 | if (!r) | 5649 | if (!r) |
| 5689 | _base_reset_handler(ioc, MPT3_IOC_DONE_RESET); | 5650 | _base_reset_handler(ioc, MPT3_IOC_DONE_RESET); |
| 5690 | 5651 | ||
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h index f0baafd9cccc..3e71bc1b4a80 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.h +++ b/drivers/scsi/mpt3sas/mpt3sas_base.h | |||
| @@ -119,10 +119,6 @@ | |||
| 119 | 119 | ||
| 120 | #define MPT_MAX_CALLBACKS 32 | 120 | #define MPT_MAX_CALLBACKS 32 |
| 121 | 121 | ||
| 122 | |||
| 123 | #define CAN_SLEEP 1 | ||
| 124 | #define NO_SLEEP 0 | ||
| 125 | |||
| 126 | #define INTERNAL_CMDS_COUNT 10 /* reserved cmds */ | 122 | #define INTERNAL_CMDS_COUNT 10 /* reserved cmds */ |
| 127 | /* reserved for issuing internally framed scsi io cmds */ | 123 | /* reserved for issuing internally framed scsi io cmds */ |
| 128 | #define INTERNAL_SCSIIO_CMDS_COUNT 3 | 124 | #define INTERNAL_SCSIIO_CMDS_COUNT 3 |
| @@ -1219,7 +1215,7 @@ int mpt3sas_base_attach(struct MPT3SAS_ADAPTER *ioc); | |||
| 1219 | void mpt3sas_base_detach(struct MPT3SAS_ADAPTER *ioc); | 1215 | void mpt3sas_base_detach(struct MPT3SAS_ADAPTER *ioc); |
| 1220 | int mpt3sas_base_map_resources(struct MPT3SAS_ADAPTER *ioc); | 1216 | int mpt3sas_base_map_resources(struct MPT3SAS_ADAPTER *ioc); |
| 1221 | void mpt3sas_base_free_resources(struct MPT3SAS_ADAPTER *ioc); | 1217 | void mpt3sas_base_free_resources(struct MPT3SAS_ADAPTER *ioc); |
| 1222 | int mpt3sas_base_hard_reset_handler(struct MPT3SAS_ADAPTER *ioc, int sleep_flag, | 1218 | int mpt3sas_base_hard_reset_handler(struct MPT3SAS_ADAPTER *ioc, |
| 1223 | enum reset_type type); | 1219 | enum reset_type type); |
| 1224 | 1220 | ||
| 1225 | void *mpt3sas_base_get_msg_frame(struct MPT3SAS_ADAPTER *ioc, u16 smid); | 1221 | void *mpt3sas_base_get_msg_frame(struct MPT3SAS_ADAPTER *ioc, u16 smid); |
diff --git a/drivers/scsi/mpt3sas/mpt3sas_config.c b/drivers/scsi/mpt3sas/mpt3sas_config.c index a6914ec99cc0..022f27f3ef6e 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_config.c +++ b/drivers/scsi/mpt3sas/mpt3sas_config.c | |||
| @@ -491,8 +491,7 @@ _config_request(struct MPT3SAS_ADAPTER *ioc, Mpi2ConfigRequest_t | |||
| 491 | mutex_unlock(&ioc->config_cmds.mutex); | 491 | mutex_unlock(&ioc->config_cmds.mutex); |
| 492 | 492 | ||
| 493 | if (issue_host_reset) | 493 | if (issue_host_reset) |
| 494 | mpt3sas_base_hard_reset_handler(ioc, CAN_SLEEP, | 494 | mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER); |
| 495 | FORCE_BIG_HAMMER); | ||
| 496 | return r; | 495 | return r; |
| 497 | } | 496 | } |
| 498 | 497 | ||
diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c b/drivers/scsi/mpt3sas/mpt3sas_ctl.c index 75ae533ac8d9..c924012d62d1 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c +++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c | |||
| @@ -1005,8 +1005,7 @@ _ctl_do_mpt_command(struct MPT3SAS_ADAPTER *ioc, struct mpt3_ioctl_command karg, | |||
| 1005 | le16_to_cpu(mpi_request->FunctionDependent1), 0, 0, | 1005 | le16_to_cpu(mpi_request->FunctionDependent1), 0, 0, |
| 1006 | 0, MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET, 0, 30); | 1006 | 0, MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET, 0, 30); |
| 1007 | } else | 1007 | } else |
| 1008 | mpt3sas_base_hard_reset_handler(ioc, CAN_SLEEP, | 1008 | mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER); |
| 1009 | FORCE_BIG_HAMMER); | ||
| 1010 | } | 1009 | } |
| 1011 | 1010 | ||
| 1012 | out: | 1011 | out: |
| @@ -1219,8 +1218,7 @@ _ctl_do_reset(struct MPT3SAS_ADAPTER *ioc, void __user *arg) | |||
| 1219 | dctlprintk(ioc, pr_info(MPT3SAS_FMT "%s: enter\n", ioc->name, | 1218 | dctlprintk(ioc, pr_info(MPT3SAS_FMT "%s: enter\n", ioc->name, |
| 1220 | __func__)); | 1219 | __func__)); |
| 1221 | 1220 | ||
| 1222 | retval = mpt3sas_base_hard_reset_handler(ioc, CAN_SLEEP, | 1221 | retval = mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER); |
| 1223 | FORCE_BIG_HAMMER); | ||
| 1224 | pr_info(MPT3SAS_FMT "host reset: %s\n", | 1222 | pr_info(MPT3SAS_FMT "host reset: %s\n", |
| 1225 | ioc->name, ((!retval) ? "SUCCESS" : "FAILED")); | 1223 | ioc->name, ((!retval) ? "SUCCESS" : "FAILED")); |
| 1226 | return 0; | 1224 | return 0; |
| @@ -1537,8 +1535,7 @@ _ctl_diag_register_2(struct MPT3SAS_ADAPTER *ioc, | |||
| 1537 | 1535 | ||
| 1538 | issue_host_reset: | 1536 | issue_host_reset: |
| 1539 | if (issue_reset) | 1537 | if (issue_reset) |
| 1540 | mpt3sas_base_hard_reset_handler(ioc, CAN_SLEEP, | 1538 | mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER); |
| 1541 | FORCE_BIG_HAMMER); | ||
| 1542 | 1539 | ||
| 1543 | out: | 1540 | out: |
| 1544 | 1541 | ||
| @@ -1973,8 +1970,7 @@ _ctl_diag_release(struct MPT3SAS_ADAPTER *ioc, void __user *arg) | |||
| 1973 | rc = mpt3sas_send_diag_release(ioc, buffer_type, &issue_reset); | 1970 | rc = mpt3sas_send_diag_release(ioc, buffer_type, &issue_reset); |
| 1974 | 1971 | ||
| 1975 | if (issue_reset) | 1972 | if (issue_reset) |
| 1976 | mpt3sas_base_hard_reset_handler(ioc, CAN_SLEEP, | 1973 | mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER); |
| 1977 | FORCE_BIG_HAMMER); | ||
| 1978 | 1974 | ||
| 1979 | return rc; | 1975 | return rc; |
| 1980 | } | 1976 | } |
| @@ -2154,8 +2150,7 @@ _ctl_diag_read_buffer(struct MPT3SAS_ADAPTER *ioc, void __user *arg) | |||
| 2154 | 2150 | ||
| 2155 | issue_host_reset: | 2151 | issue_host_reset: |
| 2156 | if (issue_reset) | 2152 | if (issue_reset) |
| 2157 | mpt3sas_base_hard_reset_handler(ioc, CAN_SLEEP, | 2153 | mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER); |
| 2158 | FORCE_BIG_HAMMER); | ||
| 2159 | 2154 | ||
| 2160 | out: | 2155 | out: |
| 2161 | 2156 | ||
diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index c93a7ba858ec..22d75a2a6672 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c | |||
| @@ -2241,16 +2241,14 @@ mpt3sas_scsih_issue_tm(struct MPT3SAS_ADAPTER *ioc, u16 handle, uint channel, | |||
| 2241 | if (ioc_state & MPI2_DOORBELL_USED) { | 2241 | if (ioc_state & MPI2_DOORBELL_USED) { |
| 2242 | dhsprintk(ioc, pr_info(MPT3SAS_FMT | 2242 | dhsprintk(ioc, pr_info(MPT3SAS_FMT |
| 2243 | "unexpected doorbell active!\n", ioc->name)); | 2243 | "unexpected doorbell active!\n", ioc->name)); |
| 2244 | rc = mpt3sas_base_hard_reset_handler(ioc, CAN_SLEEP, | 2244 | rc = mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER); |
| 2245 | FORCE_BIG_HAMMER); | ||
| 2246 | return (!rc) ? SUCCESS : FAILED; | 2245 | return (!rc) ? SUCCESS : FAILED; |
| 2247 | } | 2246 | } |
| 2248 | 2247 | ||
| 2249 | if ((ioc_state & MPI2_IOC_STATE_MASK) == MPI2_IOC_STATE_FAULT) { | 2248 | if ((ioc_state & MPI2_IOC_STATE_MASK) == MPI2_IOC_STATE_FAULT) { |
| 2250 | mpt3sas_base_fault_info(ioc, ioc_state & | 2249 | mpt3sas_base_fault_info(ioc, ioc_state & |
| 2251 | MPI2_DOORBELL_DATA_MASK); | 2250 | MPI2_DOORBELL_DATA_MASK); |
| 2252 | rc = mpt3sas_base_hard_reset_handler(ioc, CAN_SLEEP, | 2251 | rc = mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER); |
| 2253 | FORCE_BIG_HAMMER); | ||
| 2254 | return (!rc) ? SUCCESS : FAILED; | 2252 | return (!rc) ? SUCCESS : FAILED; |
| 2255 | } | 2253 | } |
| 2256 | 2254 | ||
| @@ -2292,8 +2290,8 @@ mpt3sas_scsih_issue_tm(struct MPT3SAS_ADAPTER *ioc, u16 handle, uint channel, | |||
| 2292 | _debug_dump_mf(mpi_request, | 2290 | _debug_dump_mf(mpi_request, |
| 2293 | sizeof(Mpi2SCSITaskManagementRequest_t)/4); | 2291 | sizeof(Mpi2SCSITaskManagementRequest_t)/4); |
| 2294 | if (!(ioc->tm_cmds.status & MPT3_CMD_RESET)) { | 2292 | if (!(ioc->tm_cmds.status & MPT3_CMD_RESET)) { |
| 2295 | rc = mpt3sas_base_hard_reset_handler(ioc, CAN_SLEEP, | 2293 | rc = mpt3sas_base_hard_reset_handler(ioc, |
| 2296 | FORCE_BIG_HAMMER); | 2294 | FORCE_BIG_HAMMER); |
| 2297 | rc = (!rc) ? SUCCESS : FAILED; | 2295 | rc = (!rc) ? SUCCESS : FAILED; |
| 2298 | goto out; | 2296 | goto out; |
| 2299 | } | 2297 | } |
| @@ -2638,8 +2636,7 @@ scsih_host_reset(struct scsi_cmnd *scmd) | |||
| 2638 | goto out; | 2636 | goto out; |
| 2639 | } | 2637 | } |
| 2640 | 2638 | ||
| 2641 | retval = mpt3sas_base_hard_reset_handler(ioc, CAN_SLEEP, | 2639 | retval = mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER); |
| 2642 | FORCE_BIG_HAMMER); | ||
| 2643 | r = (retval < 0) ? FAILED : SUCCESS; | 2640 | r = (retval < 0) ? FAILED : SUCCESS; |
| 2644 | out: | 2641 | out: |
| 2645 | pr_info(MPT3SAS_FMT "host reset: %s scmd(%p)\n", | 2642 | pr_info(MPT3SAS_FMT "host reset: %s scmd(%p)\n", |
| @@ -6295,8 +6292,7 @@ _scsih_ir_fastpath(struct MPT3SAS_ADAPTER *ioc, u16 handle, u8 phys_disk_num) | |||
| 6295 | mutex_unlock(&ioc->scsih_cmds.mutex); | 6292 | mutex_unlock(&ioc->scsih_cmds.mutex); |
| 6296 | 6293 | ||
| 6297 | if (issue_reset) | 6294 | if (issue_reset) |
| 6298 | mpt3sas_base_hard_reset_handler(ioc, CAN_SLEEP, | 6295 | mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER); |
| 6299 | FORCE_BIG_HAMMER); | ||
| 6300 | return rc; | 6296 | return rc; |
| 6301 | } | 6297 | } |
| 6302 | 6298 | ||
| @@ -8914,7 +8910,7 @@ scsih_resume(struct pci_dev *pdev) | |||
| 8914 | if (r) | 8910 | if (r) |
| 8915 | return r; | 8911 | return r; |
| 8916 | 8912 | ||
| 8917 | mpt3sas_base_hard_reset_handler(ioc, CAN_SLEEP, SOFT_RESET); | 8913 | mpt3sas_base_hard_reset_handler(ioc, SOFT_RESET); |
| 8918 | scsi_unblock_requests(shost); | 8914 | scsi_unblock_requests(shost); |
| 8919 | mpt3sas_base_start_watchdog(ioc); | 8915 | mpt3sas_base_start_watchdog(ioc); |
| 8920 | return 0; | 8916 | return 0; |
| @@ -8985,8 +8981,7 @@ scsih_pci_slot_reset(struct pci_dev *pdev) | |||
| 8985 | if (rc) | 8981 | if (rc) |
| 8986 | return PCI_ERS_RESULT_DISCONNECT; | 8982 | return PCI_ERS_RESULT_DISCONNECT; |
| 8987 | 8983 | ||
| 8988 | rc = mpt3sas_base_hard_reset_handler(ioc, CAN_SLEEP, | 8984 | rc = mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER); |
| 8989 | FORCE_BIG_HAMMER); | ||
| 8990 | 8985 | ||
| 8991 | pr_warn(MPT3SAS_FMT "hard reset: %s\n", ioc->name, | 8986 | pr_warn(MPT3SAS_FMT "hard reset: %s\n", ioc->name, |
| 8992 | (rc == 0) ? "success" : "failed"); | 8987 | (rc == 0) ? "success" : "failed"); |
diff --git a/drivers/scsi/mpt3sas/mpt3sas_transport.c b/drivers/scsi/mpt3sas/mpt3sas_transport.c index ff93286bc32f..f58a8c61fdec 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_transport.c +++ b/drivers/scsi/mpt3sas/mpt3sas_transport.c | |||
| @@ -446,8 +446,7 @@ _transport_expander_report_manufacture(struct MPT3SAS_ADAPTER *ioc, | |||
| 446 | 446 | ||
| 447 | issue_host_reset: | 447 | issue_host_reset: |
| 448 | if (issue_reset) | 448 | if (issue_reset) |
| 449 | mpt3sas_base_hard_reset_handler(ioc, CAN_SLEEP, | 449 | mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER); |
| 450 | FORCE_BIG_HAMMER); | ||
| 451 | out: | 450 | out: |
| 452 | ioc->transport_cmds.status = MPT3_CMD_NOT_USED; | 451 | ioc->transport_cmds.status = MPT3_CMD_NOT_USED; |
| 453 | if (data_out) | 452 | if (data_out) |
| @@ -1253,8 +1252,7 @@ _transport_get_expander_phy_error_log(struct MPT3SAS_ADAPTER *ioc, | |||
| 1253 | 1252 | ||
| 1254 | issue_host_reset: | 1253 | issue_host_reset: |
| 1255 | if (issue_reset) | 1254 | if (issue_reset) |
| 1256 | mpt3sas_base_hard_reset_handler(ioc, CAN_SLEEP, | 1255 | mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER); |
| 1257 | FORCE_BIG_HAMMER); | ||
| 1258 | out: | 1256 | out: |
| 1259 | ioc->transport_cmds.status = MPT3_CMD_NOT_USED; | 1257 | ioc->transport_cmds.status = MPT3_CMD_NOT_USED; |
| 1260 | if (data_out) | 1258 | if (data_out) |
| @@ -1564,8 +1562,7 @@ _transport_expander_phy_control(struct MPT3SAS_ADAPTER *ioc, | |||
| 1564 | 1562 | ||
| 1565 | issue_host_reset: | 1563 | issue_host_reset: |
| 1566 | if (issue_reset) | 1564 | if (issue_reset) |
| 1567 | mpt3sas_base_hard_reset_handler(ioc, CAN_SLEEP, | 1565 | mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER); |
| 1568 | FORCE_BIG_HAMMER); | ||
| 1569 | out: | 1566 | out: |
| 1570 | ioc->transport_cmds.status = MPT3_CMD_NOT_USED; | 1567 | ioc->transport_cmds.status = MPT3_CMD_NOT_USED; |
| 1571 | if (data_out) | 1568 | if (data_out) |
| @@ -2103,8 +2100,7 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
| 2103 | 2100 | ||
| 2104 | issue_host_reset: | 2101 | issue_host_reset: |
| 2105 | if (issue_reset) { | 2102 | if (issue_reset) { |
| 2106 | mpt3sas_base_hard_reset_handler(ioc, CAN_SLEEP, | 2103 | mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER); |
| 2107 | FORCE_BIG_HAMMER); | ||
| 2108 | rc = -ETIMEDOUT; | 2104 | rc = -ETIMEDOUT; |
| 2109 | } | 2105 | } |
| 2110 | 2106 | ||
