diff options
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_base.c')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_base.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c index 57bcd5c9dcff..9e590265a020 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.c +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c | |||
@@ -2057,9 +2057,9 @@ _base_allocate_memory_pools(struct MPT2SAS_ADAPTER *ioc, int sleep_flag) | |||
2057 | /* adjust hba_queue_depth, reply_free_queue_depth, | 2057 | /* adjust hba_queue_depth, reply_free_queue_depth, |
2058 | * and queue_size | 2058 | * and queue_size |
2059 | */ | 2059 | */ |
2060 | ioc->hba_queue_depth -= queue_diff; | 2060 | ioc->hba_queue_depth -= (queue_diff / 2); |
2061 | ioc->reply_free_queue_depth -= queue_diff; | 2061 | ioc->reply_free_queue_depth -= (queue_diff / 2); |
2062 | queue_size -= queue_diff; | 2062 | queue_size = facts->MaxReplyDescriptorPostQueueDepth; |
2063 | } | 2063 | } |
2064 | ioc->reply_post_queue_depth = queue_size; | 2064 | ioc->reply_post_queue_depth = queue_size; |
2065 | 2065 | ||
@@ -3662,6 +3662,11 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc) | |||
3662 | ioc->scsih_cmds.status = MPT2_CMD_NOT_USED; | 3662 | ioc->scsih_cmds.status = MPT2_CMD_NOT_USED; |
3663 | mutex_init(&ioc->scsih_cmds.mutex); | 3663 | mutex_init(&ioc->scsih_cmds.mutex); |
3664 | 3664 | ||
3665 | /* scsih internal command bits */ | ||
3666 | ioc->scsih_cmds.reply = kzalloc(ioc->reply_sz, GFP_KERNEL); | ||
3667 | ioc->scsih_cmds.status = MPT2_CMD_NOT_USED; | ||
3668 | mutex_init(&ioc->scsih_cmds.mutex); | ||
3669 | |||
3665 | /* task management internal command bits */ | 3670 | /* task management internal command bits */ |
3666 | ioc->tm_cmds.reply = kzalloc(ioc->reply_sz, GFP_KERNEL); | 3671 | ioc->tm_cmds.reply = kzalloc(ioc->reply_sz, GFP_KERNEL); |
3667 | ioc->tm_cmds.status = MPT2_CMD_NOT_USED; | 3672 | ioc->tm_cmds.status = MPT2_CMD_NOT_USED; |
@@ -3786,6 +3791,8 @@ mpt2sas_base_detach(struct MPT2SAS_ADAPTER *ioc) | |||
3786 | static void | 3791 | static void |
3787 | _base_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase) | 3792 | _base_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase) |
3788 | { | 3793 | { |
3794 | mpt2sas_scsih_reset_handler(ioc, reset_phase); | ||
3795 | mpt2sas_ctl_reset_handler(ioc, reset_phase); | ||
3789 | switch (reset_phase) { | 3796 | switch (reset_phase) { |
3790 | case MPT2_IOC_PRE_RESET: | 3797 | case MPT2_IOC_PRE_RESET: |
3791 | dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: " | 3798 | dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: " |
@@ -3816,8 +3823,6 @@ _base_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase) | |||
3816 | "MPT2_IOC_DONE_RESET\n", ioc->name, __func__)); | 3823 | "MPT2_IOC_DONE_RESET\n", ioc->name, __func__)); |
3817 | break; | 3824 | break; |
3818 | } | 3825 | } |
3819 | mpt2sas_scsih_reset_handler(ioc, reset_phase); | ||
3820 | mpt2sas_ctl_reset_handler(ioc, reset_phase); | ||
3821 | } | 3826 | } |
3822 | 3827 | ||
3823 | /** | 3828 | /** |
@@ -3871,6 +3876,7 @@ mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag, | |||
3871 | { | 3876 | { |
3872 | int r; | 3877 | int r; |
3873 | unsigned long flags; | 3878 | unsigned long flags; |
3879 | u8 pe_complete = ioc->wait_for_port_enable_to_complete; | ||
3874 | 3880 | ||
3875 | dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: enter\n", ioc->name, | 3881 | dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: enter\n", ioc->name, |
3876 | __func__)); | 3882 | __func__)); |
@@ -3913,6 +3919,14 @@ mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag, | |||
3913 | if (r) | 3919 | if (r) |
3914 | goto out; | 3920 | goto out; |
3915 | _base_reset_handler(ioc, MPT2_IOC_AFTER_RESET); | 3921 | _base_reset_handler(ioc, MPT2_IOC_AFTER_RESET); |
3922 | |||
3923 | /* If this hard reset is called while port enable is active, then | ||
3924 | * there is no reason to call make_ioc_operational | ||
3925 | */ | ||
3926 | if (pe_complete) { | ||
3927 | r = -EFAULT; | ||
3928 | goto out; | ||
3929 | } | ||
3916 | r = _base_make_ioc_operational(ioc, sleep_flag); | 3930 | r = _base_make_ioc_operational(ioc, sleep_flag); |
3917 | if (!r) | 3931 | if (!r) |
3918 | _base_reset_handler(ioc, MPT2_IOC_DONE_RESET); | 3932 | _base_reset_handler(ioc, MPT2_IOC_DONE_RESET); |