Commit 9c9db8b7 authored by Shivasharan S's avatar Shivasharan S Committed by Martin K. Petersen

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: default avatarShivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent c3b10a55
...@@ -6846,12 +6846,12 @@ megasas_wait_for_adapter_operational(struct megasas_instance *instance) ...@@ -6846,12 +6846,12 @@ megasas_wait_for_adapter_operational(struct megasas_instance *instance)
{ {
int wait_time = MEGASAS_RESET_WAIT_TIME * 2; int wait_time = MEGASAS_RESET_WAIT_TIME * 2;
int i; int i;
u8 adp_state;
if (atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR)
return 1;
for (i = 0; i < wait_time; i++) { 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; break;
if (!(i % MEGASAS_RESET_NOTICE_INTERVAL)) if (!(i % MEGASAS_RESET_NOTICE_INTERVAL))
...@@ -6860,9 +6860,10 @@ megasas_wait_for_adapter_operational(struct megasas_instance *instance) ...@@ -6860,9 +6860,10 @@ megasas_wait_for_adapter_operational(struct megasas_instance *instance)
msleep(1000); msleep(1000);
} }
if (atomic_read(&instance->adprecovery) != MEGASAS_HBA_OPERATIONAL) { if (adp_state != MEGASAS_HBA_OPERATIONAL) {
dev_info(&instance->pdev->dev, "%s timed out while waiting for HBA to recover.\n", dev_info(&instance->pdev->dev,
__func__); "%s HBA failed to become operational, adp_state %d\n",
__func__, adp_state);
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment