aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa
diff options
context:
space:
mode:
authorKrishna Gudipati <kgudipat@brocade.com>2012-09-21 20:25:30 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-10-07 06:16:24 -0400
commit1306e31d417df05c25053c5632b26d1c1b22d1ed (patch)
tree39a715855c2ab565090c3aefedaf3146693ee213 /drivers/scsi/bfa
parentb480a32e69b7b3c88c8459c229146f1d47763a02 (diff)
[SCSI] bfa: Fix to handle firmware tskim abort request response
- Enhance tracing to include both tskim tag and event. - Handle the tskim abort response from firmware in the tskim state machine cleanup state and proceed with the tskim cleanup. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bfa')
-rw-r--r--drivers/scsi/bfa/bfa_fcpim.c18
-rw-r--r--drivers/scsi/bfa/bfa_fcpim.h4
-rw-r--r--drivers/scsi/bfa/bfi_ms.h1
3 files changed, 15 insertions, 8 deletions
diff --git a/drivers/scsi/bfa/bfa_fcpim.c b/drivers/scsi/bfa/bfa_fcpim.c
index 1633963c66ca..4118d84be6eb 100644
--- a/drivers/scsi/bfa/bfa_fcpim.c
+++ b/drivers/scsi/bfa/bfa_fcpim.c
@@ -158,6 +158,7 @@ enum bfa_tskim_event {
158 BFA_TSKIM_SM_IOS_DONE = 7, /* IO and sub TM completions */ 158 BFA_TSKIM_SM_IOS_DONE = 7, /* IO and sub TM completions */
159 BFA_TSKIM_SM_CLEANUP = 8, /* TM cleanup on ITN offline */ 159 BFA_TSKIM_SM_CLEANUP = 8, /* TM cleanup on ITN offline */
160 BFA_TSKIM_SM_CLEANUP_DONE = 9, /* TM abort completion */ 160 BFA_TSKIM_SM_CLEANUP_DONE = 9, /* TM abort completion */
161 BFA_TSKIM_SM_UTAG = 10, /* TM completion unknown tag */
161}; 162};
162 163
163/* 164/*
@@ -3036,7 +3037,7 @@ bfa_ioim_abort(struct bfa_ioim_s *ioim)
3036static void 3037static void
3037bfa_tskim_sm_uninit(struct bfa_tskim_s *tskim, enum bfa_tskim_event event) 3038bfa_tskim_sm_uninit(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
3038{ 3039{
3039 bfa_trc(tskim->bfa, event); 3040 bfa_trc(tskim->bfa, tskim->tsk_tag << 16 | event);
3040 3041
3041 switch (event) { 3042 switch (event) {
3042 case BFA_TSKIM_SM_START: 3043 case BFA_TSKIM_SM_START:
@@ -3074,7 +3075,7 @@ bfa_tskim_sm_uninit(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
3074static void 3075static void
3075bfa_tskim_sm_active(struct bfa_tskim_s *tskim, enum bfa_tskim_event event) 3076bfa_tskim_sm_active(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
3076{ 3077{
3077 bfa_trc(tskim->bfa, event); 3078 bfa_trc(tskim->bfa, tskim->tsk_tag << 16 | event);
3078 3079
3079 switch (event) { 3080 switch (event) {
3080 case BFA_TSKIM_SM_DONE: 3081 case BFA_TSKIM_SM_DONE:
@@ -3110,7 +3111,7 @@ bfa_tskim_sm_active(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
3110static void 3111static void
3111bfa_tskim_sm_cleanup(struct bfa_tskim_s *tskim, enum bfa_tskim_event event) 3112bfa_tskim_sm_cleanup(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
3112{ 3113{
3113 bfa_trc(tskim->bfa, event); 3114 bfa_trc(tskim->bfa, tskim->tsk_tag << 16 | event);
3114 3115
3115 switch (event) { 3116 switch (event) {
3116 case BFA_TSKIM_SM_DONE: 3117 case BFA_TSKIM_SM_DONE:
@@ -3119,6 +3120,7 @@ bfa_tskim_sm_cleanup(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
3119 */ 3120 */
3120 break; 3121 break;
3121 3122
3123 case BFA_TSKIM_SM_UTAG:
3122 case BFA_TSKIM_SM_CLEANUP_DONE: 3124 case BFA_TSKIM_SM_CLEANUP_DONE:
3123 bfa_sm_set_state(tskim, bfa_tskim_sm_iocleanup); 3125 bfa_sm_set_state(tskim, bfa_tskim_sm_iocleanup);
3124 bfa_tskim_cleanup_ios(tskim); 3126 bfa_tskim_cleanup_ios(tskim);
@@ -3138,7 +3140,7 @@ bfa_tskim_sm_cleanup(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
3138static void 3140static void
3139bfa_tskim_sm_iocleanup(struct bfa_tskim_s *tskim, enum bfa_tskim_event event) 3141bfa_tskim_sm_iocleanup(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
3140{ 3142{
3141 bfa_trc(tskim->bfa, event); 3143 bfa_trc(tskim->bfa, tskim->tsk_tag << 16 | event);
3142 3144
3143 switch (event) { 3145 switch (event) {
3144 case BFA_TSKIM_SM_IOS_DONE: 3146 case BFA_TSKIM_SM_IOS_DONE:
@@ -3170,7 +3172,7 @@ bfa_tskim_sm_iocleanup(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
3170static void 3172static void
3171bfa_tskim_sm_qfull(struct bfa_tskim_s *tskim, enum bfa_tskim_event event) 3173bfa_tskim_sm_qfull(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
3172{ 3174{
3173 bfa_trc(tskim->bfa, event); 3175 bfa_trc(tskim->bfa, tskim->tsk_tag << 16 | event);
3174 3176
3175 switch (event) { 3177 switch (event) {
3176 case BFA_TSKIM_SM_QRESUME: 3178 case BFA_TSKIM_SM_QRESUME:
@@ -3207,7 +3209,7 @@ static void
3207bfa_tskim_sm_cleanup_qfull(struct bfa_tskim_s *tskim, 3209bfa_tskim_sm_cleanup_qfull(struct bfa_tskim_s *tskim,
3208 enum bfa_tskim_event event) 3210 enum bfa_tskim_event event)
3209{ 3211{
3210 bfa_trc(tskim->bfa, event); 3212 bfa_trc(tskim->bfa, tskim->tsk_tag << 16 | event);
3211 3213
3212 switch (event) { 3214 switch (event) {
3213 case BFA_TSKIM_SM_DONE: 3215 case BFA_TSKIM_SM_DONE:
@@ -3238,7 +3240,7 @@ bfa_tskim_sm_cleanup_qfull(struct bfa_tskim_s *tskim,
3238static void 3240static void
3239bfa_tskim_sm_hcb(struct bfa_tskim_s *tskim, enum bfa_tskim_event event) 3241bfa_tskim_sm_hcb(struct bfa_tskim_s *tskim, enum bfa_tskim_event event)
3240{ 3242{
3241 bfa_trc(tskim->bfa, event); 3243 bfa_trc(tskim->bfa, tskim->tsk_tag << 16 | event);
3242 3244
3243 switch (event) { 3245 switch (event) {
3244 case BFA_TSKIM_SM_HCB: 3246 case BFA_TSKIM_SM_HCB:
@@ -3560,6 +3562,8 @@ bfa_tskim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
3560 if (rsp->tsk_status == BFI_TSKIM_STS_ABORTED) { 3562 if (rsp->tsk_status == BFI_TSKIM_STS_ABORTED) {
3561 bfa_stats(tskim->itnim, tm_cleanup_comps); 3563 bfa_stats(tskim->itnim, tm_cleanup_comps);
3562 bfa_sm_send_event(tskim, BFA_TSKIM_SM_CLEANUP_DONE); 3564 bfa_sm_send_event(tskim, BFA_TSKIM_SM_CLEANUP_DONE);
3565 } else if (rsp->tsk_status == BFI_TSKIM_STS_UTAG) {
3566 bfa_sm_send_event(tskim, BFA_TSKIM_SM_UTAG);
3563 } else { 3567 } else {
3564 bfa_stats(tskim->itnim, tm_fw_rsps); 3568 bfa_stats(tskim->itnim, tm_fw_rsps);
3565 bfa_sm_send_event(tskim, BFA_TSKIM_SM_DONE); 3569 bfa_sm_send_event(tskim, BFA_TSKIM_SM_DONE);
diff --git a/drivers/scsi/bfa/bfa_fcpim.h b/drivers/scsi/bfa/bfa_fcpim.h
index 36f26da80f76..b81d51cfe2bb 100644
--- a/drivers/scsi/bfa/bfa_fcpim.h
+++ b/drivers/scsi/bfa/bfa_fcpim.h
@@ -51,7 +51,9 @@ void bfa_fcp_res_recfg(struct bfa_s *bfa, u16 num_ioim_fw);
51#define BFA_ITN_FROM_TAG(_fcp, _tag) \ 51#define BFA_ITN_FROM_TAG(_fcp, _tag) \
52 ((_fcp)->itn_arr + ((_tag) & ((_fcp)->num_itns - 1))) 52 ((_fcp)->itn_arr + ((_tag) & ((_fcp)->num_itns - 1)))
53#define BFA_SNSINFO_FROM_TAG(_fcp, _tag) \ 53#define BFA_SNSINFO_FROM_TAG(_fcp, _tag) \
54 bfa_mem_get_dmabuf_kva(_fcp, _tag, BFI_IOIM_SNSLEN) 54 bfa_mem_get_dmabuf_kva(_fcp, (_tag & BFA_IOIM_IOTAG_MASK), \
55 BFI_IOIM_SNSLEN)
56
55 57
56#define BFA_ITNIM_MIN 32 58#define BFA_ITNIM_MIN 32
57#define BFA_ITNIM_MAX 1024 59#define BFA_ITNIM_MAX 1024
diff --git a/drivers/scsi/bfa/bfi_ms.h b/drivers/scsi/bfa/bfi_ms.h
index 1f73db97fe24..c89defc9bb92 100644
--- a/drivers/scsi/bfa/bfi_ms.h
+++ b/drivers/scsi/bfa/bfi_ms.h
@@ -840,6 +840,7 @@ enum bfi_tskim_status {
840 */ 840 */
841 BFI_TSKIM_STS_TIMEOUT = 10, /* TM request timedout */ 841 BFI_TSKIM_STS_TIMEOUT = 10, /* TM request timedout */
842 BFI_TSKIM_STS_ABORTED = 11, /* Aborted on host request */ 842 BFI_TSKIM_STS_ABORTED = 11, /* Aborted on host request */
843 BFI_TSKIM_STS_UTAG = 12, /* unknown tag for request */
843}; 844};
844 845
845struct bfi_tskim_rsp_s { 846struct bfi_tskim_rsp_s {