diff options
author | Krishna Gudipati <kgudipat@brocade.com> | 2010-12-13 19:23:27 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-12-21 13:37:17 -0500 |
commit | 15821f05b78dbeb2f897d1d22576449103a4d8d5 (patch) | |
tree | d71a92b42ceba66e2cd33d5494b05f378cae0476 /drivers/scsi/bfa/bfa_fcpim.c | |
parent | b704495c6707013806d1b66507a967896e2b4a7c (diff) |
[SCSI] bfa: io tag handling and minor bug fix.
Fix iotag handling:
1) Update and check io tag for retry case.
2) Clearing upper 3 bits in io tag when an IO completes.
The 3 upper bits in io tags are used for counting FCP exchange retry.
Un-cleared bits will cause firmware to access invalid memory when the
same io tag is used for an IO to a target that doesn't support FCP
exchange retry.
3) Only check the effective bits when validating an iotag.
Other minor fixes:
1) Added trace to get FC header type with assert of unhandled packet received.
Ignore the type FC_TYPE_FC_FSS (FC_XS).
2) Fixed the adapter info display check - to check for fcmode flag even.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bfa/bfa_fcpim.c')
-rw-r--r-- | drivers/scsi/bfa/bfa_fcpim.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/scsi/bfa/bfa_fcpim.c b/drivers/scsi/bfa/bfa_fcpim.c index 314c9312298..5e697f236ef 100644 --- a/drivers/scsi/bfa/bfa_fcpim.c +++ b/drivers/scsi/bfa/bfa_fcpim.c | |||
@@ -1540,8 +1540,8 @@ bfa_ioim_sm_active(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) | |||
1540 | break; | 1540 | break; |
1541 | 1541 | ||
1542 | case BFA_IOIM_SM_SQRETRY: | 1542 | case BFA_IOIM_SM_SQRETRY: |
1543 | if (bfa_ioim_get_iotag(ioim) != BFA_TRUE) { | 1543 | if (bfa_ioim_maxretry_reached(ioim)) { |
1544 | /* max retry completed free IO */ | 1544 | /* max retry reached, free IO */ |
1545 | bfa_sm_set_state(ioim, bfa_ioim_sm_hcb_free); | 1545 | bfa_sm_set_state(ioim, bfa_ioim_sm_hcb_free); |
1546 | bfa_ioim_move_to_comp_q(ioim); | 1546 | bfa_ioim_move_to_comp_q(ioim); |
1547 | bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, | 1547 | bfa_cb_queue(ioim->bfa, &ioim->hcb_qe, |
@@ -1569,6 +1569,7 @@ bfa_ioim_sm_cmnd_retry(struct bfa_ioim_s *ioim, enum bfa_ioim_event event) | |||
1569 | switch (event) { | 1569 | switch (event) { |
1570 | case BFA_IOIM_SM_FREE: | 1570 | case BFA_IOIM_SM_FREE: |
1571 | /* abts and rrq done. Now retry the IO with new tag */ | 1571 | /* abts and rrq done. Now retry the IO with new tag */ |
1572 | bfa_ioim_update_iotag(ioim); | ||
1572 | if (!bfa_ioim_send_ioreq(ioim)) { | 1573 | if (!bfa_ioim_send_ioreq(ioim)) { |
1573 | bfa_sm_set_state(ioim, bfa_ioim_sm_qfull); | 1574 | bfa_sm_set_state(ioim, bfa_ioim_sm_qfull); |
1574 | break; | 1575 | break; |
@@ -2526,7 +2527,7 @@ bfa_ioim_good_comp_isr(struct bfa_s *bfa, struct bfi_msg_s *m) | |||
2526 | iotag = be16_to_cpu(rsp->io_tag); | 2527 | iotag = be16_to_cpu(rsp->io_tag); |
2527 | 2528 | ||
2528 | ioim = BFA_IOIM_FROM_TAG(fcpim, iotag); | 2529 | ioim = BFA_IOIM_FROM_TAG(fcpim, iotag); |
2529 | bfa_assert(ioim->iotag == iotag); | 2530 | bfa_assert(BFA_IOIM_TAG_2_ID(ioim->iotag) == iotag); |
2530 | 2531 | ||
2531 | bfa_trc_fp(ioim->bfa, ioim->iotag); | 2532 | bfa_trc_fp(ioim->bfa, ioim->iotag); |
2532 | bfa_ioim_cb_profile_comp(fcpim, ioim); | 2533 | bfa_ioim_cb_profile_comp(fcpim, ioim); |
@@ -2629,6 +2630,7 @@ bfa_ioim_free(struct bfa_ioim_s *ioim) | |||
2629 | bfa_stats(ioim->itnim, io_comps); | 2630 | bfa_stats(ioim->itnim, io_comps); |
2630 | fcpim->ios_active--; | 2631 | fcpim->ios_active--; |
2631 | 2632 | ||
2633 | ioim->iotag &= BFA_IOIM_IOTAG_MASK; | ||
2632 | list_del(&ioim->qe); | 2634 | list_del(&ioim->qe); |
2633 | list_add_tail(&ioim->qe, &fcpim->ioim_free_q); | 2635 | list_add_tail(&ioim->qe, &fcpim->ioim_free_q); |
2634 | } | 2636 | } |