diff options
author | Sumit Saxena <sumit.saxena@avagotech.com> | 2016-01-28 10:34:35 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-02-23 21:27:02 -0500 |
commit | 3885c26b773750bf2e7e071a5b0b72f079196d60 (patch) | |
tree | 91caff6e651f69e5fa5b10e2820a149a04e9e4b9 /drivers/scsi | |
parent | e3d178ca773ff997c6c94989d0b14a2c0eae761c (diff) |
megaraid_sas: SPERC OCR changes
This patch fixes online controller resets on SRIOV-enabled series of
Avago controllers.
1) Remove late detection heartbeat.
2) Change in the behavior if the FW found in READY/OPERATIONAL state.
Signed-off-by: Uday Lingala <uday.lingala@avagotech.com>
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas_fusion.c | 73 |
1 files changed, 16 insertions, 57 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index e740e2608a37..be9c3f1b9def 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c | |||
@@ -3462,52 +3462,7 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int reason) | |||
3462 | /* Let SR-IOV VF & PF sync up if there was a HB failure */ | 3462 | /* Let SR-IOV VF & PF sync up if there was a HB failure */ |
3463 | if (instance->requestorId && !reason) { | 3463 | if (instance->requestorId && !reason) { |
3464 | msleep(MEGASAS_OCR_SETTLE_TIME_VF); | 3464 | msleep(MEGASAS_OCR_SETTLE_TIME_VF); |
3465 | /* Look for a late HB update after VF settle time */ | 3465 | goto transition_to_ready; |
3466 | if (abs_state == MFI_STATE_OPERATIONAL && | ||
3467 | (instance->hb_host_mem->HB.fwCounter != | ||
3468 | instance->hb_host_mem->HB.driverCounter)) { | ||
3469 | instance->hb_host_mem->HB.driverCounter = | ||
3470 | instance->hb_host_mem->HB.fwCounter; | ||
3471 | dev_warn(&instance->pdev->dev, "SR-IOV:" | ||
3472 | "Late FW heartbeat update for " | ||
3473 | "scsi%d.\n", | ||
3474 | instance->host->host_no); | ||
3475 | } else { | ||
3476 | /* In VF mode, first poll for FW ready */ | ||
3477 | for (i = 0; | ||
3478 | i < (MEGASAS_RESET_WAIT_TIME * 1000); | ||
3479 | i += 20) { | ||
3480 | status_reg = | ||
3481 | instance->instancet-> | ||
3482 | read_fw_status_reg( | ||
3483 | instance->reg_set); | ||
3484 | abs_state = status_reg & | ||
3485 | MFI_STATE_MASK; | ||
3486 | if (abs_state == MFI_STATE_READY) { | ||
3487 | dev_warn(&instance->pdev->dev, | ||
3488 | "SR-IOV: FW was found" | ||
3489 | "to be in ready state " | ||
3490 | "for scsi%d.\n", | ||
3491 | instance->host->host_no); | ||
3492 | break; | ||
3493 | } | ||
3494 | msleep(20); | ||
3495 | } | ||
3496 | if (abs_state != MFI_STATE_READY) { | ||
3497 | dev_warn(&instance->pdev->dev, "SR-IOV: " | ||
3498 | "FW not in ready state after %d" | ||
3499 | " seconds for scsi%d, status_reg = " | ||
3500 | "0x%x.\n", | ||
3501 | MEGASAS_RESET_WAIT_TIME, | ||
3502 | instance->host->host_no, | ||
3503 | status_reg); | ||
3504 | megaraid_sas_kill_hba(instance); | ||
3505 | instance->skip_heartbeat_timer_del = 1; | ||
3506 | atomic_set(&instance->adprecovery, MEGASAS_HW_CRITICAL_ERROR); | ||
3507 | retval = FAILED; | ||
3508 | goto out; | ||
3509 | } | ||
3510 | } | ||
3511 | } | 3466 | } |
3512 | 3467 | ||
3513 | /* Now try to reset the chip */ | 3468 | /* Now try to reset the chip */ |
@@ -3516,25 +3471,28 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int reason) | |||
3516 | if (instance->instancet->adp_reset | 3471 | if (instance->instancet->adp_reset |
3517 | (instance, instance->reg_set)) | 3472 | (instance, instance->reg_set)) |
3518 | continue; | 3473 | continue; |
3519 | 3474 | transition_to_ready: | |
3520 | /* Wait for FW to become ready */ | 3475 | /* Wait for FW to become ready */ |
3521 | if (megasas_transition_to_ready(instance, 1)) { | 3476 | if (megasas_transition_to_ready(instance, 1)) { |
3522 | dev_warn(&instance->pdev->dev, "Failed to " | 3477 | dev_warn(&instance->pdev->dev, |
3523 | "transition controller to ready " | 3478 | "Failed to transition controller to ready for " |
3524 | "for scsi%d.\n", | 3479 | "scsi%d.\n", instance->host->host_no); |
3525 | instance->host->host_no); | 3480 | if (instance->requestorId && !reason) |
3526 | continue; | 3481 | goto fail_kill_adapter; |
3482 | else | ||
3483 | continue; | ||
3527 | } | 3484 | } |
3528 | |||
3529 | megasas_reset_reply_desc(instance); | 3485 | megasas_reset_reply_desc(instance); |
3530 | megasas_fusion_update_can_queue(instance, OCR_CONTEXT); | 3486 | megasas_fusion_update_can_queue(instance, OCR_CONTEXT); |
3531 | 3487 | ||
3532 | if (megasas_ioc_init_fusion(instance)) { | 3488 | if (megasas_ioc_init_fusion(instance)) { |
3533 | dev_warn(&instance->pdev->dev, | 3489 | dev_warn(&instance->pdev->dev, |
3534 | "megasas_ioc_init_fusion() failed!" | 3490 | "megasas_ioc_init_fusion() failed! for " |
3535 | " for scsi%d\n", | 3491 | "scsi%d\n", instance->host->host_no); |
3536 | instance->host->host_no); | 3492 | if (instance->requestorId && !reason) |
3537 | continue; | 3493 | goto fail_kill_adapter; |
3494 | else | ||
3495 | continue; | ||
3538 | } | 3496 | } |
3539 | 3497 | ||
3540 | megasas_refire_mgmt_cmd(instance); | 3498 | megasas_refire_mgmt_cmd(instance); |
@@ -3591,6 +3549,7 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int reason) | |||
3591 | retval = SUCCESS; | 3549 | retval = SUCCESS; |
3592 | goto out; | 3550 | goto out; |
3593 | } | 3551 | } |
3552 | fail_kill_adapter: | ||
3594 | /* Reset failed, kill the adapter */ | 3553 | /* Reset failed, kill the adapter */ |
3595 | dev_warn(&instance->pdev->dev, "Reset failed, killing " | 3554 | dev_warn(&instance->pdev->dev, "Reset failed, killing " |
3596 | "adapter scsi%d.\n", instance->host->host_no); | 3555 | "adapter scsi%d.\n", instance->host->host_no); |