diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/bfa/bfa_core.c | 53 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_ioc.c | 11 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_ioc_ct.c | 25 |
3 files changed, 63 insertions, 26 deletions
diff --git a/drivers/scsi/bfa/bfa_core.c b/drivers/scsi/bfa/bfa_core.c index b7c326f7a6d0..837879de72c3 100644 --- a/drivers/scsi/bfa/bfa_core.c +++ b/drivers/scsi/bfa/bfa_core.c | |||
@@ -274,6 +274,15 @@ bfa_iocfc_sm_initing(struct bfa_iocfc_s *iocfc, enum iocfc_event event) | |||
274 | case IOCFC_E_IOC_ENABLED: | 274 | case IOCFC_E_IOC_ENABLED: |
275 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_dconf_read); | 275 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_dconf_read); |
276 | break; | 276 | break; |
277 | |||
278 | case IOCFC_E_DISABLE: | ||
279 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_disabling); | ||
280 | break; | ||
281 | |||
282 | case IOCFC_E_STOP: | ||
283 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_stopping); | ||
284 | break; | ||
285 | |||
277 | case IOCFC_E_IOC_FAILED: | 286 | case IOCFC_E_IOC_FAILED: |
278 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_init_failed); | 287 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_init_failed); |
279 | break; | 288 | break; |
@@ -298,6 +307,15 @@ bfa_iocfc_sm_dconf_read(struct bfa_iocfc_s *iocfc, enum iocfc_event event) | |||
298 | case IOCFC_E_DCONF_DONE: | 307 | case IOCFC_E_DCONF_DONE: |
299 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_init_cfg_wait); | 308 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_init_cfg_wait); |
300 | break; | 309 | break; |
310 | |||
311 | case IOCFC_E_DISABLE: | ||
312 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_disabling); | ||
313 | break; | ||
314 | |||
315 | case IOCFC_E_STOP: | ||
316 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_stopping); | ||
317 | break; | ||
318 | |||
301 | case IOCFC_E_IOC_FAILED: | 319 | case IOCFC_E_IOC_FAILED: |
302 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_init_failed); | 320 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_init_failed); |
303 | break; | 321 | break; |
@@ -322,6 +340,15 @@ bfa_iocfc_sm_init_cfg_wait(struct bfa_iocfc_s *iocfc, enum iocfc_event event) | |||
322 | case IOCFC_E_CFG_DONE: | 340 | case IOCFC_E_CFG_DONE: |
323 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_init_cfg_done); | 341 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_init_cfg_done); |
324 | break; | 342 | break; |
343 | |||
344 | case IOCFC_E_DISABLE: | ||
345 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_disabling); | ||
346 | break; | ||
347 | |||
348 | case IOCFC_E_STOP: | ||
349 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_stopping); | ||
350 | break; | ||
351 | |||
325 | case IOCFC_E_IOC_FAILED: | 352 | case IOCFC_E_IOC_FAILED: |
326 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_init_failed); | 353 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_init_failed); |
327 | break; | 354 | break; |
@@ -433,6 +460,12 @@ bfa_iocfc_sm_stopping(struct bfa_iocfc_s *iocfc, enum iocfc_event event) | |||
433 | bfa_cb_queue(iocfc->bfa, &iocfc->bfa->iocfc.stop_hcb_qe, | 460 | bfa_cb_queue(iocfc->bfa, &iocfc->bfa->iocfc.stop_hcb_qe, |
434 | bfa_iocfc_stop_cb, iocfc->bfa); | 461 | bfa_iocfc_stop_cb, iocfc->bfa); |
435 | break; | 462 | break; |
463 | |||
464 | case IOCFC_E_IOC_ENABLED: | ||
465 | case IOCFC_E_DCONF_DONE: | ||
466 | case IOCFC_E_CFG_DONE: | ||
467 | break; | ||
468 | |||
436 | default: | 469 | default: |
437 | bfa_sm_fault(iocfc->bfa, event); | 470 | bfa_sm_fault(iocfc->bfa, event); |
438 | break; | 471 | break; |
@@ -454,6 +487,15 @@ bfa_iocfc_sm_enabling(struct bfa_iocfc_s *iocfc, enum iocfc_event event) | |||
454 | case IOCFC_E_IOC_ENABLED: | 487 | case IOCFC_E_IOC_ENABLED: |
455 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_cfg_wait); | 488 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_cfg_wait); |
456 | break; | 489 | break; |
490 | |||
491 | case IOCFC_E_DISABLE: | ||
492 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_disabling); | ||
493 | break; | ||
494 | |||
495 | case IOCFC_E_STOP: | ||
496 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_dconf_write); | ||
497 | break; | ||
498 | |||
457 | case IOCFC_E_IOC_FAILED: | 499 | case IOCFC_E_IOC_FAILED: |
458 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_failed); | 500 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_failed); |
459 | 501 | ||
@@ -493,6 +535,13 @@ bfa_iocfc_sm_cfg_wait(struct bfa_iocfc_s *iocfc, enum iocfc_event event) | |||
493 | bfa_iocfc_enable_cb, iocfc->bfa); | 535 | bfa_iocfc_enable_cb, iocfc->bfa); |
494 | iocfc->bfa->iocfc.cb_reqd = BFA_FALSE; | 536 | iocfc->bfa->iocfc.cb_reqd = BFA_FALSE; |
495 | break; | 537 | break; |
538 | case IOCFC_E_DISABLE: | ||
539 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_disabling); | ||
540 | break; | ||
541 | |||
542 | case IOCFC_E_STOP: | ||
543 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_dconf_write); | ||
544 | break; | ||
496 | case IOCFC_E_IOC_FAILED: | 545 | case IOCFC_E_IOC_FAILED: |
497 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_failed); | 546 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_failed); |
498 | if (iocfc->bfa->iocfc.cb_reqd == BFA_FALSE) | 547 | if (iocfc->bfa->iocfc.cb_reqd == BFA_FALSE) |
@@ -524,6 +573,10 @@ bfa_iocfc_sm_disabling(struct bfa_iocfc_s *iocfc, enum iocfc_event event) | |||
524 | case IOCFC_E_IOC_DISABLED: | 573 | case IOCFC_E_IOC_DISABLED: |
525 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_disabled); | 574 | bfa_fsm_set_state(iocfc, bfa_iocfc_sm_disabled); |
526 | break; | 575 | break; |
576 | case IOCFC_E_IOC_ENABLED: | ||
577 | case IOCFC_E_DCONF_DONE: | ||
578 | case IOCFC_E_CFG_DONE: | ||
579 | break; | ||
527 | default: | 580 | default: |
528 | bfa_sm_fault(iocfc->bfa, event); | 581 | bfa_sm_fault(iocfc->bfa, event); |
529 | break; | 582 | break; |
diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c index 75ca8752b9f4..ffc19ac5d721 100644 --- a/drivers/scsi/bfa/bfa_ioc.c +++ b/drivers/scsi/bfa/bfa_ioc.c | |||
@@ -731,8 +731,7 @@ bfa_iocpf_sm_fwcheck_entry(struct bfa_iocpf_s *iocpf) | |||
731 | /* | 731 | /* |
732 | * Unlock the hw semaphore. Should be here only once per boot. | 732 | * Unlock the hw semaphore. Should be here only once per boot. |
733 | */ | 733 | */ |
734 | readl(iocpf->ioc->ioc_regs.ioc_sem_reg); | 734 | bfa_ioc_ownership_reset(iocpf->ioc); |
735 | writel(1, iocpf->ioc->ioc_regs.ioc_sem_reg); | ||
736 | 735 | ||
737 | /* | 736 | /* |
738 | * unlock init semaphore. | 737 | * unlock init semaphore. |
@@ -2923,7 +2922,7 @@ bfa_ioc_poll_fwinit(struct bfa_ioc_s *ioc) | |||
2923 | return; | 2922 | return; |
2924 | } | 2923 | } |
2925 | 2924 | ||
2926 | if (ioc->iocpf.poll_time >= BFA_IOC_TOV) | 2925 | if (ioc->iocpf.poll_time >= (3 * BFA_IOC_TOV)) |
2927 | bfa_iocpf_timeout(ioc); | 2926 | bfa_iocpf_timeout(ioc); |
2928 | else { | 2927 | else { |
2929 | ioc->iocpf.poll_time += BFA_IOC_POLL_TOV; | 2928 | ioc->iocpf.poll_time += BFA_IOC_POLL_TOV; |
@@ -5615,7 +5614,7 @@ bfa_dconf_sm_uninit(struct bfa_dconf_mod_s *dconf, enum bfa_dconf_event event) | |||
5615 | } | 5614 | } |
5616 | bfa_sm_set_state(dconf, bfa_dconf_sm_flash_read); | 5615 | bfa_sm_set_state(dconf, bfa_dconf_sm_flash_read); |
5617 | bfa_timer_start(dconf->bfa, &dconf->timer, | 5616 | bfa_timer_start(dconf->bfa, &dconf->timer, |
5618 | bfa_dconf_timer, dconf, BFA_DCONF_UPDATE_TOV); | 5617 | bfa_dconf_timer, dconf, 2 * BFA_DCONF_UPDATE_TOV); |
5619 | bfa_status = bfa_flash_read_part(BFA_FLASH(dconf->bfa), | 5618 | bfa_status = bfa_flash_read_part(BFA_FLASH(dconf->bfa), |
5620 | BFA_FLASH_PART_DRV, dconf->instance, | 5619 | BFA_FLASH_PART_DRV, dconf->instance, |
5621 | dconf->dconf, | 5620 | dconf->dconf, |
@@ -5655,7 +5654,7 @@ bfa_dconf_sm_flash_read(struct bfa_dconf_mod_s *dconf, | |||
5655 | break; | 5654 | break; |
5656 | case BFA_DCONF_SM_TIMEOUT: | 5655 | case BFA_DCONF_SM_TIMEOUT: |
5657 | bfa_sm_set_state(dconf, bfa_dconf_sm_ready); | 5656 | bfa_sm_set_state(dconf, bfa_dconf_sm_ready); |
5658 | bfa_fsm_send_event(&dconf->bfa->iocfc, IOCFC_E_IOC_FAILED); | 5657 | bfa_ioc_suspend(&dconf->bfa->ioc); |
5659 | break; | 5658 | break; |
5660 | case BFA_DCONF_SM_EXIT: | 5659 | case BFA_DCONF_SM_EXIT: |
5661 | bfa_timer_stop(&dconf->timer); | 5660 | bfa_timer_stop(&dconf->timer); |
@@ -5853,7 +5852,6 @@ bfa_dconf_init_cb(void *arg, bfa_status_t status) | |||
5853 | struct bfa_s *bfa = arg; | 5852 | struct bfa_s *bfa = arg; |
5854 | struct bfa_dconf_mod_s *dconf = BFA_DCONF_MOD(bfa); | 5853 | struct bfa_dconf_mod_s *dconf = BFA_DCONF_MOD(bfa); |
5855 | 5854 | ||
5856 | bfa_sm_send_event(dconf, BFA_DCONF_SM_FLASH_COMP); | ||
5857 | if (status == BFA_STATUS_OK) { | 5855 | if (status == BFA_STATUS_OK) { |
5858 | bfa_dconf_read_data_valid(bfa) = BFA_TRUE; | 5856 | bfa_dconf_read_data_valid(bfa) = BFA_TRUE; |
5859 | if (dconf->dconf->hdr.signature != BFI_DCONF_SIGNATURE) | 5857 | if (dconf->dconf->hdr.signature != BFI_DCONF_SIGNATURE) |
@@ -5861,6 +5859,7 @@ bfa_dconf_init_cb(void *arg, bfa_status_t status) | |||
5861 | if (dconf->dconf->hdr.version != BFI_DCONF_VERSION) | 5859 | if (dconf->dconf->hdr.version != BFI_DCONF_VERSION) |
5862 | dconf->dconf->hdr.version = BFI_DCONF_VERSION; | 5860 | dconf->dconf->hdr.version = BFI_DCONF_VERSION; |
5863 | } | 5861 | } |
5862 | bfa_sm_send_event(dconf, BFA_DCONF_SM_FLASH_COMP); | ||
5864 | bfa_fsm_send_event(&bfa->iocfc, IOCFC_E_DCONF_DONE); | 5863 | bfa_fsm_send_event(&bfa->iocfc, IOCFC_E_DCONF_DONE); |
5865 | } | 5864 | } |
5866 | 5865 | ||
diff --git a/drivers/scsi/bfa/bfa_ioc_ct.c b/drivers/scsi/bfa/bfa_ioc_ct.c index 2eb0c6a2938d..29efbb7484ae 100644 --- a/drivers/scsi/bfa/bfa_ioc_ct.c +++ b/drivers/scsi/bfa/bfa_ioc_ct.c | |||
@@ -57,13 +57,6 @@ bfa_ioc_ct_firmware_lock(struct bfa_ioc_s *ioc) | |||
57 | u32 usecnt; | 57 | u32 usecnt; |
58 | struct bfi_ioc_image_hdr_s fwhdr; | 58 | struct bfi_ioc_image_hdr_s fwhdr; |
59 | 59 | ||
60 | /* | ||
61 | * If bios boot (flash based) -- do not increment usage count | ||
62 | */ | ||
63 | if (bfa_cb_image_get_size(bfa_ioc_asic_gen(ioc)) < | ||
64 | BFA_IOC_FWIMG_MINSZ) | ||
65 | return BFA_TRUE; | ||
66 | |||
67 | bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg); | 60 | bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg); |
68 | usecnt = readl(ioc->ioc_regs.ioc_usage_reg); | 61 | usecnt = readl(ioc->ioc_regs.ioc_usage_reg); |
69 | 62 | ||
@@ -115,13 +108,6 @@ bfa_ioc_ct_firmware_unlock(struct bfa_ioc_s *ioc) | |||
115 | u32 usecnt; | 108 | u32 usecnt; |
116 | 109 | ||
117 | /* | 110 | /* |
118 | * If bios boot (flash based) -- do not decrement usage count | ||
119 | */ | ||
120 | if (bfa_cb_image_get_size(bfa_ioc_asic_gen(ioc)) < | ||
121 | BFA_IOC_FWIMG_MINSZ) | ||
122 | return; | ||
123 | |||
124 | /* | ||
125 | * decrement usage count | 111 | * decrement usage count |
126 | */ | 112 | */ |
127 | bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg); | 113 | bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg); |
@@ -400,13 +386,12 @@ static void | |||
400 | bfa_ioc_ct_ownership_reset(struct bfa_ioc_s *ioc) | 386 | bfa_ioc_ct_ownership_reset(struct bfa_ioc_s *ioc) |
401 | { | 387 | { |
402 | 388 | ||
403 | if (bfa_ioc_is_cna(ioc)) { | 389 | bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg); |
404 | bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg); | 390 | writel(0, ioc->ioc_regs.ioc_usage_reg); |
405 | writel(0, ioc->ioc_regs.ioc_usage_reg); | 391 | readl(ioc->ioc_regs.ioc_usage_sem_reg); |
406 | readl(ioc->ioc_regs.ioc_usage_sem_reg); | 392 | writel(1, ioc->ioc_regs.ioc_usage_sem_reg); |
407 | writel(1, ioc->ioc_regs.ioc_usage_sem_reg); | ||
408 | } | ||
409 | 393 | ||
394 | writel(0, ioc->ioc_regs.ioc_fail_sync); | ||
410 | /* | 395 | /* |
411 | * Read the hw sem reg to make sure that it is locked | 396 | * Read the hw sem reg to make sure that it is locked |
412 | * before we clear it. If it is not locked, writing 1 | 397 | * before we clear it. If it is not locked, writing 1 |