diff options
author | Shivasharan S <shivasharan.srikanteshwara@broadcom.com> | 2018-06-04 03:45:11 -0700 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-06-18 21:05:32 -0400 |
commit | 9c9db8b792a27d38cbb2a4f51a56e35b4506c897 (patch) | |
tree | 4e50ea8f670eb1426512350bb683b4c2dfb3bfe0 | |
parent | c3b10a55abc943a526aaecd7e860b15671beb906 (diff) | |
download | linux-stable-9c9db8b792a27d38cbb2a4f51a56e35b4506c897.tar.gz linux-stable-9c9db8b792a27d38cbb2a4f51a56e35b4506c897.tar.bz2 linux-stable-9c9db8b792a27d38cbb2a4f51a56e35b4506c897.zip |
scsi: megaraid_sas: Return immediately from wait_for_adapter_operational after kill adapter
While driver is waiting for adapter to become operational, if a kill
adapter is issued, driver can bail out from the wait loop immediately
rather than waiting for the entire 180 seconds.
Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas_base.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index c787fed48ec7..fd2ce75b4d73 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -6846,12 +6846,12 @@ megasas_wait_for_adapter_operational(struct megasas_instance *instance) { int wait_time = MEGASAS_RESET_WAIT_TIME * 2; int i; - - if (atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR) - return 1; + u8 adp_state; for (i = 0; i < wait_time; i++) { - if (atomic_read(&instance->adprecovery) == MEGASAS_HBA_OPERATIONAL) + adp_state = atomic_read(&instance->adprecovery); + if ((adp_state == MEGASAS_HBA_OPERATIONAL) || + (adp_state == MEGASAS_HW_CRITICAL_ERROR)) break; if (!(i % MEGASAS_RESET_NOTICE_INTERVAL)) @@ -6860,9 +6860,10 @@ megasas_wait_for_adapter_operational(struct megasas_instance *instance) msleep(1000); } - if (atomic_read(&instance->adprecovery) != MEGASAS_HBA_OPERATIONAL) { - dev_info(&instance->pdev->dev, "%s timed out while waiting for HBA to recover.\n", - __func__); + if (adp_state != MEGASAS_HBA_OPERATIONAL) { + dev_info(&instance->pdev->dev, + "%s HBA failed to become operational, adp_state %d\n", + __func__, adp_state); return 1; } |