Lines Matching refs:tskim
254 static bfa_boolean_t bfa_tskim_match_scope(struct bfa_tskim_s *tskim,
256 static void bfa_tskim_gather_ios(struct bfa_tskim_s *tskim);
258 static void bfa_tskim_cleanup_ios(struct bfa_tskim_s *tskim);
259 static bfa_boolean_t bfa_tskim_send(struct bfa_tskim_s *tskim);
260 static bfa_boolean_t bfa_tskim_send_abort(struct bfa_tskim_s *tskim);
261 static void bfa_tskim_iocdisable_ios(struct bfa_tskim_s *tskim);
266 static void bfa_tskim_sm_uninit(struct bfa_tskim_s *tskim,
268 static void bfa_tskim_sm_active(struct bfa_tskim_s *tskim,
270 static void bfa_tskim_sm_cleanup(struct bfa_tskim_s *tskim,
272 static void bfa_tskim_sm_iocleanup(struct bfa_tskim_s *tskim,
274 static void bfa_tskim_sm_qfull(struct bfa_tskim_s *tskim,
276 static void bfa_tskim_sm_cleanup_qfull(struct bfa_tskim_s *tskim,
278 static void bfa_tskim_sm_hcb(struct bfa_tskim_s *tskim,
967 struct bfa_tskim_s *tskim; in bfa_itnim_iocdisable_cleanup() local
972 tskim = (struct bfa_tskim_s *) qe; in bfa_itnim_iocdisable_cleanup()
973 bfa_tskim_iocdisable(tskim); in bfa_itnim_iocdisable_cleanup()
1014 struct bfa_tskim_s *tskim; in bfa_itnim_cleanup() local
1034 tskim = (struct bfa_tskim_s *) qe; in bfa_itnim_cleanup()
1036 bfa_tskim_cleanup(tskim); in bfa_itnim_cleanup()
2678 if (!ioim->iosp->tskim) { in bfa_ioim_notify_cleanup()
2686 bfa_wc_down(&ioim->iosp->tskim->wc); in bfa_ioim_notify_cleanup()
2890 ioim->iosp->tskim = NULL; in bfa_ioim_cleanup()
2895 bfa_ioim_cleanup_tm(struct bfa_ioim_s *ioim, struct bfa_tskim_s *tskim) in bfa_ioim_cleanup_tm() argument
2900 ioim->iosp->tskim = tskim; in bfa_ioim_cleanup_tm()
3027 bfa_tskim_sm_uninit(struct bfa_tskim_s *tskim, enum bfa_tskim_event event) in bfa_tskim_sm_uninit() argument
3029 bfa_trc(tskim->bfa, tskim->tsk_tag << 16 | event); in bfa_tskim_sm_uninit()
3033 bfa_sm_set_state(tskim, bfa_tskim_sm_active); in bfa_tskim_sm_uninit()
3034 bfa_tskim_gather_ios(tskim); in bfa_tskim_sm_uninit()
3040 if (!bfa_itnim_is_online(tskim->itnim)) { in bfa_tskim_sm_uninit()
3041 bfa_sm_set_state(tskim, bfa_tskim_sm_iocleanup); in bfa_tskim_sm_uninit()
3042 tskim->tsk_status = BFI_TSKIM_STS_OK; in bfa_tskim_sm_uninit()
3043 bfa_tskim_cleanup_ios(tskim); in bfa_tskim_sm_uninit()
3047 if (!bfa_tskim_send(tskim)) { in bfa_tskim_sm_uninit()
3048 bfa_sm_set_state(tskim, bfa_tskim_sm_qfull); in bfa_tskim_sm_uninit()
3049 bfa_stats(tskim->itnim, tm_qwait); in bfa_tskim_sm_uninit()
3050 bfa_reqq_wait(tskim->bfa, tskim->itnim->reqq, in bfa_tskim_sm_uninit()
3051 &tskim->reqq_wait); in bfa_tskim_sm_uninit()
3056 bfa_sm_fault(tskim->bfa, event); in bfa_tskim_sm_uninit()
3065 bfa_tskim_sm_active(struct bfa_tskim_s *tskim, enum bfa_tskim_event event) in bfa_tskim_sm_active() argument
3067 bfa_trc(tskim->bfa, tskim->tsk_tag << 16 | event); in bfa_tskim_sm_active()
3071 bfa_sm_set_state(tskim, bfa_tskim_sm_iocleanup); in bfa_tskim_sm_active()
3072 bfa_tskim_cleanup_ios(tskim); in bfa_tskim_sm_active()
3076 bfa_sm_set_state(tskim, bfa_tskim_sm_cleanup); in bfa_tskim_sm_active()
3077 if (!bfa_tskim_send_abort(tskim)) { in bfa_tskim_sm_active()
3078 bfa_sm_set_state(tskim, bfa_tskim_sm_cleanup_qfull); in bfa_tskim_sm_active()
3079 bfa_stats(tskim->itnim, tm_qwait); in bfa_tskim_sm_active()
3080 bfa_reqq_wait(tskim->bfa, tskim->itnim->reqq, in bfa_tskim_sm_active()
3081 &tskim->reqq_wait); in bfa_tskim_sm_active()
3086 bfa_sm_set_state(tskim, bfa_tskim_sm_hcb); in bfa_tskim_sm_active()
3087 bfa_tskim_iocdisable_ios(tskim); in bfa_tskim_sm_active()
3088 bfa_tskim_qcomp(tskim, __bfa_cb_tskim_failed); in bfa_tskim_sm_active()
3092 bfa_sm_fault(tskim->bfa, event); in bfa_tskim_sm_active()
3101 bfa_tskim_sm_cleanup(struct bfa_tskim_s *tskim, enum bfa_tskim_event event) in bfa_tskim_sm_cleanup() argument
3103 bfa_trc(tskim->bfa, tskim->tsk_tag << 16 | event); in bfa_tskim_sm_cleanup()
3114 bfa_sm_set_state(tskim, bfa_tskim_sm_iocleanup); in bfa_tskim_sm_cleanup()
3115 bfa_tskim_cleanup_ios(tskim); in bfa_tskim_sm_cleanup()
3119 bfa_sm_set_state(tskim, bfa_tskim_sm_hcb); in bfa_tskim_sm_cleanup()
3120 bfa_tskim_iocdisable_ios(tskim); in bfa_tskim_sm_cleanup()
3121 bfa_tskim_qcomp(tskim, __bfa_cb_tskim_failed); in bfa_tskim_sm_cleanup()
3125 bfa_sm_fault(tskim->bfa, event); in bfa_tskim_sm_cleanup()
3130 bfa_tskim_sm_iocleanup(struct bfa_tskim_s *tskim, enum bfa_tskim_event event) in bfa_tskim_sm_iocleanup() argument
3132 bfa_trc(tskim->bfa, tskim->tsk_tag << 16 | event); in bfa_tskim_sm_iocleanup()
3136 bfa_sm_set_state(tskim, bfa_tskim_sm_hcb); in bfa_tskim_sm_iocleanup()
3137 bfa_tskim_qcomp(tskim, __bfa_cb_tskim_done); in bfa_tskim_sm_iocleanup()
3148 bfa_sm_set_state(tskim, bfa_tskim_sm_hcb); in bfa_tskim_sm_iocleanup()
3149 bfa_tskim_iocdisable_ios(tskim); in bfa_tskim_sm_iocleanup()
3150 bfa_tskim_qcomp(tskim, __bfa_cb_tskim_failed); in bfa_tskim_sm_iocleanup()
3154 bfa_sm_fault(tskim->bfa, event); in bfa_tskim_sm_iocleanup()
3162 bfa_tskim_sm_qfull(struct bfa_tskim_s *tskim, enum bfa_tskim_event event) in bfa_tskim_sm_qfull() argument
3164 bfa_trc(tskim->bfa, tskim->tsk_tag << 16 | event); in bfa_tskim_sm_qfull()
3168 bfa_sm_set_state(tskim, bfa_tskim_sm_active); in bfa_tskim_sm_qfull()
3169 bfa_tskim_send(tskim); in bfa_tskim_sm_qfull()
3176 bfa_sm_set_state(tskim, bfa_tskim_sm_iocleanup); in bfa_tskim_sm_qfull()
3177 bfa_reqq_wcancel(&tskim->reqq_wait); in bfa_tskim_sm_qfull()
3178 bfa_tskim_cleanup_ios(tskim); in bfa_tskim_sm_qfull()
3182 bfa_sm_set_state(tskim, bfa_tskim_sm_hcb); in bfa_tskim_sm_qfull()
3183 bfa_reqq_wcancel(&tskim->reqq_wait); in bfa_tskim_sm_qfull()
3184 bfa_tskim_iocdisable_ios(tskim); in bfa_tskim_sm_qfull()
3185 bfa_tskim_qcomp(tskim, __bfa_cb_tskim_failed); in bfa_tskim_sm_qfull()
3189 bfa_sm_fault(tskim->bfa, event); in bfa_tskim_sm_qfull()
3198 bfa_tskim_sm_cleanup_qfull(struct bfa_tskim_s *tskim, in bfa_tskim_sm_cleanup_qfull() argument
3201 bfa_trc(tskim->bfa, tskim->tsk_tag << 16 | event); in bfa_tskim_sm_cleanup_qfull()
3205 bfa_reqq_wcancel(&tskim->reqq_wait); in bfa_tskim_sm_cleanup_qfull()
3208 bfa_sm_set_state(tskim, bfa_tskim_sm_cleanup); in bfa_tskim_sm_cleanup_qfull()
3209 bfa_tskim_send_abort(tskim); in bfa_tskim_sm_cleanup_qfull()
3213 bfa_sm_set_state(tskim, bfa_tskim_sm_hcb); in bfa_tskim_sm_cleanup_qfull()
3214 bfa_reqq_wcancel(&tskim->reqq_wait); in bfa_tskim_sm_cleanup_qfull()
3215 bfa_tskim_iocdisable_ios(tskim); in bfa_tskim_sm_cleanup_qfull()
3216 bfa_tskim_qcomp(tskim, __bfa_cb_tskim_failed); in bfa_tskim_sm_cleanup_qfull()
3220 bfa_sm_fault(tskim->bfa, event); in bfa_tskim_sm_cleanup_qfull()
3228 bfa_tskim_sm_hcb(struct bfa_tskim_s *tskim, enum bfa_tskim_event event) in bfa_tskim_sm_hcb() argument
3230 bfa_trc(tskim->bfa, tskim->tsk_tag << 16 | event); in bfa_tskim_sm_hcb()
3234 bfa_sm_set_state(tskim, bfa_tskim_sm_uninit); in bfa_tskim_sm_hcb()
3235 bfa_tskim_free(tskim); in bfa_tskim_sm_hcb()
3239 bfa_tskim_notify_comp(tskim); in bfa_tskim_sm_hcb()
3246 bfa_sm_fault(tskim->bfa, event); in bfa_tskim_sm_hcb()
3253 struct bfa_tskim_s *tskim = cbarg; in __bfa_cb_tskim_done() local
3256 bfa_sm_send_event(tskim, BFA_TSKIM_SM_HCB); in __bfa_cb_tskim_done()
3260 bfa_stats(tskim->itnim, tm_success); in __bfa_cb_tskim_done()
3261 bfa_cb_tskim_done(tskim->bfa->bfad, tskim->dtsk, tskim->tsk_status); in __bfa_cb_tskim_done()
3267 struct bfa_tskim_s *tskim = cbarg; in __bfa_cb_tskim_failed() local
3270 bfa_sm_send_event(tskim, BFA_TSKIM_SM_HCB); in __bfa_cb_tskim_failed()
3274 bfa_stats(tskim->itnim, tm_failures); in __bfa_cb_tskim_failed()
3275 bfa_cb_tskim_done(tskim->bfa->bfad, tskim->dtsk, in __bfa_cb_tskim_failed()
3280 bfa_tskim_match_scope(struct bfa_tskim_s *tskim, struct scsi_lun lun) in bfa_tskim_match_scope() argument
3282 switch (tskim->tm_cmnd) { in bfa_tskim_match_scope()
3290 return !memcmp(&tskim->lun, &lun, sizeof(lun)); in bfa_tskim_match_scope()
3303 bfa_tskim_gather_ios(struct bfa_tskim_s *tskim) in bfa_tskim_gather_ios() argument
3305 struct bfa_itnim_s *itnim = tskim->itnim; in bfa_tskim_gather_ios()
3311 INIT_LIST_HEAD(&tskim->io_q); in bfa_tskim_gather_ios()
3320 if (bfa_tskim_match_scope(tskim, scsilun)) { in bfa_tskim_gather_ios()
3322 list_add_tail(&ioim->qe, &tskim->io_q); in bfa_tskim_gather_ios()
3333 if (bfa_tskim_match_scope(tskim, scsilun)) { in bfa_tskim_gather_ios()
3347 struct bfa_tskim_s *tskim = tskim_cbarg; in bfa_tskim_cleanp_comp() local
3349 bfa_stats(tskim->itnim, tm_io_comps); in bfa_tskim_cleanp_comp()
3350 bfa_sm_send_event(tskim, BFA_TSKIM_SM_IOS_DONE); in bfa_tskim_cleanp_comp()
3357 bfa_tskim_cleanup_ios(struct bfa_tskim_s *tskim) in bfa_tskim_cleanup_ios() argument
3362 bfa_wc_init(&tskim->wc, bfa_tskim_cleanp_comp, tskim); in bfa_tskim_cleanup_ios()
3364 list_for_each_safe(qe, qen, &tskim->io_q) { in bfa_tskim_cleanup_ios()
3366 bfa_wc_up(&tskim->wc); in bfa_tskim_cleanup_ios()
3367 bfa_ioim_cleanup_tm(ioim, tskim); in bfa_tskim_cleanup_ios()
3370 bfa_wc_wait(&tskim->wc); in bfa_tskim_cleanup_ios()
3377 bfa_tskim_send(struct bfa_tskim_s *tskim) in bfa_tskim_send() argument
3379 struct bfa_itnim_s *itnim = tskim->itnim; in bfa_tskim_send()
3385 m = bfa_reqq_next(tskim->bfa, itnim->reqq); in bfa_tskim_send()
3393 bfa_fn_lpu(tskim->bfa)); in bfa_tskim_send()
3395 m->tsk_tag = cpu_to_be16(tskim->tsk_tag); in bfa_tskim_send()
3396 m->itn_fhdl = tskim->itnim->rport->fw_handle; in bfa_tskim_send()
3397 m->t_secs = tskim->tsecs; in bfa_tskim_send()
3398 m->lun = tskim->lun; in bfa_tskim_send()
3399 m->tm_flags = tskim->tm_cmnd; in bfa_tskim_send()
3404 bfa_reqq_produce(tskim->bfa, itnim->reqq, m->mh); in bfa_tskim_send()
3412 bfa_tskim_send_abort(struct bfa_tskim_s *tskim) in bfa_tskim_send_abort() argument
3414 struct bfa_itnim_s *itnim = tskim->itnim; in bfa_tskim_send_abort()
3420 m = bfa_reqq_next(tskim->bfa, itnim->reqq); in bfa_tskim_send_abort()
3428 bfa_fn_lpu(tskim->bfa)); in bfa_tskim_send_abort()
3430 m->tsk_tag = cpu_to_be16(tskim->tsk_tag); in bfa_tskim_send_abort()
3435 bfa_reqq_produce(tskim->bfa, itnim->reqq, m->mh); in bfa_tskim_send_abort()
3445 struct bfa_tskim_s *tskim = cbarg; in bfa_tskim_qresume() local
3447 bfa_stats(tskim->itnim, tm_qresumes); in bfa_tskim_qresume()
3448 bfa_sm_send_event(tskim, BFA_TSKIM_SM_QRESUME); in bfa_tskim_qresume()
3455 bfa_tskim_iocdisable_ios(struct bfa_tskim_s *tskim) in bfa_tskim_iocdisable_ios() argument
3460 list_for_each_safe(qe, qen, &tskim->io_q) { in bfa_tskim_iocdisable_ios()
3470 bfa_tskim_iodone(struct bfa_tskim_s *tskim) in bfa_tskim_iodone() argument
3472 bfa_wc_down(&tskim->wc); in bfa_tskim_iodone()
3479 bfa_tskim_iocdisable(struct bfa_tskim_s *tskim) in bfa_tskim_iocdisable() argument
3481 tskim->notify = BFA_FALSE; in bfa_tskim_iocdisable()
3482 bfa_stats(tskim->itnim, tm_iocdowns); in bfa_tskim_iocdisable()
3483 bfa_sm_send_event(tskim, BFA_TSKIM_SM_HWFAIL); in bfa_tskim_iocdisable()
3490 bfa_tskim_cleanup(struct bfa_tskim_s *tskim) in bfa_tskim_cleanup() argument
3492 tskim->notify = BFA_TRUE; in bfa_tskim_cleanup()
3493 bfa_stats(tskim->itnim, tm_cleanups); in bfa_tskim_cleanup()
3494 bfa_sm_send_event(tskim, BFA_TSKIM_SM_CLEANUP); in bfa_tskim_cleanup()
3503 struct bfa_tskim_s *tskim; in bfa_tskim_attach() local
3510 tskim = (struct bfa_tskim_s *) bfa_mem_kva_curp(fcp); in bfa_tskim_attach()
3511 fcpim->tskim_arr = tskim; in bfa_tskim_attach()
3513 for (i = 0; i < fcpim->num_tskim_reqs; i++, tskim++) { in bfa_tskim_attach()
3517 memset(tskim, 0, sizeof(struct bfa_tskim_s)); in bfa_tskim_attach()
3518 tskim->tsk_tag = i; in bfa_tskim_attach()
3519 tskim->bfa = fcpim->bfa; in bfa_tskim_attach()
3520 tskim->fcpim = fcpim; in bfa_tskim_attach()
3521 tskim->notify = BFA_FALSE; in bfa_tskim_attach()
3522 bfa_reqq_winit(&tskim->reqq_wait, bfa_tskim_qresume, in bfa_tskim_attach()
3523 tskim); in bfa_tskim_attach()
3524 bfa_sm_set_state(tskim, bfa_tskim_sm_uninit); in bfa_tskim_attach()
3526 list_add_tail(&tskim->qe, &fcpim->tskim_free_q); in bfa_tskim_attach()
3529 bfa_mem_kva_curp(fcp) = (u8 *) tskim; in bfa_tskim_attach()
3537 struct bfa_tskim_s *tskim; in bfa_tskim_isr() local
3540 tskim = BFA_TSKIM_FROM_TAG(fcpim, tsk_tag); in bfa_tskim_isr()
3541 WARN_ON(tskim->tsk_tag != tsk_tag); in bfa_tskim_isr()
3543 tskim->tsk_status = rsp->tsk_status; in bfa_tskim_isr()
3550 bfa_stats(tskim->itnim, tm_cleanup_comps); in bfa_tskim_isr()
3551 bfa_sm_send_event(tskim, BFA_TSKIM_SM_CLEANUP_DONE); in bfa_tskim_isr()
3553 bfa_sm_send_event(tskim, BFA_TSKIM_SM_UTAG); in bfa_tskim_isr()
3555 bfa_stats(tskim->itnim, tm_fw_rsps); in bfa_tskim_isr()
3556 bfa_sm_send_event(tskim, BFA_TSKIM_SM_DONE); in bfa_tskim_isr()
3565 struct bfa_tskim_s *tskim; in bfa_tskim_alloc() local
3567 bfa_q_deq(&fcpim->tskim_free_q, &tskim); in bfa_tskim_alloc()
3569 if (tskim) in bfa_tskim_alloc()
3570 tskim->dtsk = dtsk; in bfa_tskim_alloc()
3572 return tskim; in bfa_tskim_alloc()
3576 bfa_tskim_free(struct bfa_tskim_s *tskim) in bfa_tskim_free() argument
3578 WARN_ON(!bfa_q_is_on_q_func(&tskim->itnim->tsk_q, &tskim->qe)); in bfa_tskim_free()
3579 list_del(&tskim->qe); in bfa_tskim_free()
3580 list_add_tail(&tskim->qe, &tskim->fcpim->tskim_free_q); in bfa_tskim_free()
3595 bfa_tskim_start(struct bfa_tskim_s *tskim, struct bfa_itnim_s *itnim, in bfa_tskim_start() argument
3599 tskim->itnim = itnim; in bfa_tskim_start()
3600 tskim->lun = lun; in bfa_tskim_start()
3601 tskim->tm_cmnd = tm_cmnd; in bfa_tskim_start()
3602 tskim->tsecs = tsecs; in bfa_tskim_start()
3603 tskim->notify = BFA_FALSE; in bfa_tskim_start()
3606 list_add_tail(&tskim->qe, &itnim->tsk_q); in bfa_tskim_start()
3607 bfa_sm_send_event(tskim, BFA_TSKIM_SM_START); in bfa_tskim_start()