Lines Matching refs:snic

80 static void snic_scsi_cleanup(struct snic *, int);
112 snic_io_lock_hash(struct snic *snic, struct scsi_cmnd *sc) in snic_io_lock_hash() argument
116 return &snic->io_req_lock[hash]; in snic_io_lock_hash()
120 snic_io_lock_tag(struct snic *snic, int tag) in snic_io_lock_tag() argument
122 return &snic->io_req_lock[tag & (SNIC_IO_LOCKS - 1)]; in snic_io_lock_tag()
127 snic_release_req_buf(struct snic *snic, in snic_release_req_buf() argument
142 SNIC_SCSI_DBG(snic->shost, in snic_release_req_buf()
149 pci_unmap_single(snic->pdev, in snic_release_req_buf()
156 snic_req_free(snic, rqi); in snic_release_req_buf()
163 snic_queue_icmnd_req(struct snic *snic, in snic_queue_icmnd_req() argument
188 pa = pci_map_single(snic->pdev, in snic_queue_icmnd_req()
193 if (pci_dma_mapping_error(snic->pdev, pa)) { in snic_queue_icmnd_req()
194 SNIC_HOST_ERR(snic->shost, in snic_queue_icmnd_req()
211 snic->config.hid, /* hid */ in snic_queue_icmnd_req()
224 ret = snic_queue_wq_desc(snic, rqi->req, rqi->req_len); in snic_queue_icmnd_req()
226 SNIC_HOST_ERR(snic->shost, in snic_queue_icmnd_req()
237 snic_issue_scsi_req(struct snic *snic, in snic_issue_scsi_req() argument
253 SNIC_TRC((u16)snic->shost->host_no, tag, (ulong) sc, 0, in snic_issue_scsi_req()
256 SNIC_HOST_ERR(snic->shost, "issue_sc:Failed to map SG List.\n"); in snic_issue_scsi_req()
262 rqi = snic_req_init(snic, sg_cnt); in snic_issue_scsi_req()
278 io_lock = snic_io_lock_hash(snic, sc); in snic_issue_scsi_req()
281 ret = snic_queue_icmnd_req(snic, rqi, sc, sg_cnt); in snic_issue_scsi_req()
283 SNIC_HOST_ERR(snic->shost, in snic_issue_scsi_req()
295 snic_release_req_buf(snic, rqi, sc); in snic_issue_scsi_req()
297 SNIC_TRC(snic->shost->host_no, tag, (ulong) sc, 0, 0, 0, in snic_issue_scsi_req()
302 struct snic_io_stats *iostats = &snic->s_stats.io; in snic_issue_scsi_req()
310 SNIC_SCSI_DBG(snic->shost, in snic_issue_scsi_req()
314 SNIC_TRC(snic->shost->host_no, tag, (ulong) sc, (ulong) rqi, in snic_issue_scsi_req()
333 struct snic *snic = shost_priv(shost); in snic_queuecommand() local
340 atomic64_inc(&snic->s_stats.misc.tgt_not_rdy); in snic_queuecommand()
347 if (snic_get_state(snic) != SNIC_ONLINE) { in snic_queuecommand()
349 snic_state_str[snic_get_state(snic)]); in snic_queuecommand()
353 atomic_inc(&snic->ios_inflight); in snic_queuecommand()
360 ret = snic_issue_scsi_req(snic, tgt, sc); in snic_queuecommand()
365 snic_stats_update_active_ios(&snic->s_stats); in snic_queuecommand()
367 atomic_dec(&snic->ios_inflight); in snic_queuecommand()
377 snic_proc_tmreq_pending_state(struct snic *snic, in snic_proc_tmreq_pending_state() argument
409 snic_process_io_failed_state(struct snic *snic, in snic_process_io_failed_state() argument
418 atomic64_inc(&snic->s_stats.misc.io_tmo); in snic_process_io_failed_state()
423 atomic64_inc(&snic->s_stats.misc.io_aborted); in snic_process_io_failed_state()
428 atomic64_inc(&snic->s_stats.misc.data_cnt_mismat); in snic_process_io_failed_state()
434 atomic64_inc(&snic->s_stats.fw.out_of_res); in snic_process_io_failed_state()
439 atomic64_inc(&snic->s_stats.io.io_not_found); in snic_process_io_failed_state()
444 atomic64_inc(&snic->s_stats.misc.sgl_inval); in snic_process_io_failed_state()
449 atomic64_inc(&snic->s_stats.fw.io_errs); in snic_process_io_failed_state()
454 atomic64_inc(&snic->s_stats.fw.scsi_errs); in snic_process_io_failed_state()
468 SNIC_SCSI_DBG(snic->shost, in snic_process_io_failed_state()
474 SNIC_HOST_ERR(snic->shost, "fw returns failed status %s flags 0x%llx\n", in snic_process_io_failed_state()
498 snic_process_icmnd_cmpl_status(struct snic *snic, in snic_process_icmnd_cmpl_status() argument
520 atomic64_inc(&snic->s_stats.misc.io_under_run); in snic_process_icmnd_cmpl_status()
524 atomic64_inc(&snic->s_stats.misc.qfull); in snic_process_icmnd_cmpl_status()
528 snic_process_io_failed_state(snic, icmnd_cmpl, sc, cmpl_stat); in snic_process_icmnd_cmpl_status()
529 atomic64_inc(&snic->s_stats.io.fail); in snic_process_icmnd_cmpl_status()
530 SNIC_HOST_ERR(snic->shost, in snic_process_icmnd_cmpl_status()
545 snic_icmnd_cmpl_handler(struct snic *snic, struct snic_fw_req *fwreq) in snic_icmnd_cmpl_handler() argument
562 SNIC_SCSI_DBG(snic->shost, in snic_icmnd_cmpl_handler()
566 if (cmnd_id >= snic->max_tag_id) { in snic_icmnd_cmpl_handler()
567 SNIC_HOST_ERR(snic->shost, in snic_icmnd_cmpl_handler()
573 sc = scsi_host_find_tag(snic->shost, cmnd_id); in snic_icmnd_cmpl_handler()
577 atomic64_inc(&snic->s_stats.io.sc_null); in snic_icmnd_cmpl_handler()
578 SNIC_HOST_ERR(snic->shost, in snic_icmnd_cmpl_handler()
584 SNIC_TRC(snic->shost->host_no, cmnd_id, 0, in snic_icmnd_cmpl_handler()
592 io_lock = snic_io_lock_hash(snic, sc); in snic_icmnd_cmpl_handler()
596 SNIC_SCSI_DBG(snic->shost, in snic_icmnd_cmpl_handler()
604 atomic64_inc(&snic->s_stats.io.req_null); in snic_icmnd_cmpl_handler()
608 SNIC_HOST_ERR(snic->shost, in snic_icmnd_cmpl_handler()
626 snic_proc_tmreq_pending_state(snic, sc, hdr_stat); in snic_icmnd_cmpl_handler()
629 snic_stats_update_io_cmpl(&snic->s_stats); in snic_icmnd_cmpl_handler()
635 SNIC_SCSI_DBG(snic->shost, in snic_icmnd_cmpl_handler()
642 SNIC_TRC(snic->shost->host_no, cmnd_id, (ulong) sc, in snic_icmnd_cmpl_handler()
649 if (snic_process_icmnd_cmpl_status(snic, icmnd_cmpl, hdr_stat, sc)) { in snic_icmnd_cmpl_handler()
651 SNIC_HOST_ERR(snic->shost, in snic_icmnd_cmpl_handler()
664 snic_calc_io_process_time(snic, rqi); in snic_icmnd_cmpl_handler()
666 snic_release_req_buf(snic, rqi, sc); in snic_icmnd_cmpl_handler()
668 SNIC_TRC(snic->shost->host_no, cmnd_id, (ulong) sc, in snic_icmnd_cmpl_handler()
676 snic_stats_update_io_cmpl(&snic->s_stats); in snic_icmnd_cmpl_handler()
680 snic_proc_dr_cmpl_locked(struct snic *snic, in snic_proc_dr_cmpl_locked() argument
691 SNIC_SCSI_DBG(snic->shost, "itmf_cmpl: Cmd State = %s\n", in snic_proc_dr_cmpl_locked()
697 SNIC_TRC(snic->shost->host_no, cmnd_id, (ulong) sc, in snic_proc_dr_cmpl_locked()
701 SNIC_SCSI_DBG(snic->shost, in snic_proc_dr_cmpl_locked()
712 SNIC_TRC(snic->shost->host_no, cmnd_id, (ulong) sc, in snic_proc_dr_cmpl_locked()
716 SNIC_SCSI_DBG(snic->shost, in snic_proc_dr_cmpl_locked()
728 SNIC_SCSI_DBG(snic->shost, in snic_proc_dr_cmpl_locked()
742 snic_update_abort_stats(struct snic *snic, u8 cmpl_stat) in snic_update_abort_stats() argument
744 struct snic_abort_stats *abt_stats = &snic->s_stats.abts; in snic_update_abort_stats()
746 SNIC_SCSI_DBG(snic->shost, "Updating Abort stats.\n"); in snic_update_abort_stats()
767 snic_process_itmf_cmpl(struct snic *snic, in snic_process_itmf_cmpl() argument
780 io_lock = snic_io_lock_hash(snic, sc); in snic_process_itmf_cmpl()
786 atomic64_inc(&snic->s_stats.io.req_null); in snic_process_itmf_cmpl()
789 SNIC_HOST_ERR(snic->shost, in snic_process_itmf_cmpl()
806 snic_update_abort_stats(snic, cmpl_stat); in snic_process_itmf_cmpl()
819 SNIC_SCSI_DBG(snic->shost, in snic_process_itmf_cmpl()
839 SNIC_SCSI_DBG(snic->shost, in snic_process_itmf_cmpl()
845 snic_release_req_buf(snic, rqi, sc); in snic_process_itmf_cmpl()
848 SNIC_TRC(snic->shost->host_no, cmnd_id, (ulong) sc, in snic_process_itmf_cmpl()
860 snic_proc_dr_cmpl_locked(snic, fwreq, cmpl_stat, cmnd_id, sc); in snic_process_itmf_cmpl()
873 SNIC_SCSI_DBG(snic->shost, in snic_process_itmf_cmpl()
887 SNIC_HOST_ERR(snic->shost, in snic_process_itmf_cmpl()
890 SNIC_HOST_ERR(snic->shost, in snic_process_itmf_cmpl()
909 snic_itmf_cmpl_handler(struct snic *snic, struct snic_fw_req *fwreq) in snic_itmf_cmpl_handler() argument
921 SNIC_SCSI_DBG(snic->shost, in snic_itmf_cmpl_handler()
926 SNIC_SCSI_DBG(snic->shost, in snic_itmf_cmpl_handler()
938 if ((cmnd_id & SNIC_TAG_MASK) >= snic->max_tag_id) { in snic_itmf_cmpl_handler()
939 SNIC_HOST_ERR(snic->shost, in snic_itmf_cmpl_handler()
947 sc = scsi_host_find_tag(snic->shost, cmnd_id & SNIC_TAG_MASK); in snic_itmf_cmpl_handler()
952 atomic64_inc(&snic->s_stats.io.sc_null); in snic_itmf_cmpl_handler()
953 SNIC_HOST_ERR(snic->shost, in snic_itmf_cmpl_handler()
960 snic_process_itmf_cmpl(snic, fwreq, cmnd_id, hdr_stat, sc); in snic_itmf_cmpl_handler()
966 snic_hba_reset_scsi_cleanup(struct snic *snic, struct scsi_cmnd *sc) in snic_hba_reset_scsi_cleanup() argument
968 struct snic_stats *st = &snic->s_stats; in snic_hba_reset_scsi_cleanup()
971 SNIC_SCSI_DBG(snic->shost, "HBA Reset scsi cleanup.\n"); in snic_hba_reset_scsi_cleanup()
972 snic_scsi_cleanup(snic, snic_cmd_tag(sc)); in snic_hba_reset_scsi_cleanup()
991 snic_hba_reset_cmpl_handler(struct snic *snic, struct snic_fw_req *fwreq) in snic_hba_reset_cmpl_handler() argument
1004 SNIC_HOST_INFO(snic->shost, in snic_hba_reset_cmpl_handler()
1008 SNIC_SCSI_DBG(snic->shost, in snic_hba_reset_cmpl_handler()
1020 if (cmnd_id >= snic->max_tag_id) { in snic_hba_reset_cmpl_handler()
1021 SNIC_HOST_ERR(snic->shost, in snic_hba_reset_cmpl_handler()
1029 sc = scsi_host_find_tag(snic->shost, cmnd_id); in snic_hba_reset_cmpl_handler()
1032 atomic64_inc(&snic->s_stats.io.sc_null); in snic_hba_reset_cmpl_handler()
1033 SNIC_HOST_ERR(snic->shost, in snic_hba_reset_cmpl_handler()
1041 io_lock = snic_io_lock_hash(snic, sc); in snic_hba_reset_cmpl_handler()
1044 if (!snic->remove_wait) { in snic_hba_reset_cmpl_handler()
1046 SNIC_HOST_ERR(snic->shost, in snic_hba_reset_cmpl_handler()
1057 atomic64_inc(&snic->s_stats.io.req_null); in snic_hba_reset_cmpl_handler()
1060 SNIC_HOST_ERR(snic->shost, in snic_hba_reset_cmpl_handler()
1073 snic_hba_reset_scsi_cleanup(snic, sc); in snic_hba_reset_cmpl_handler()
1075 SNIC_BUG_ON(snic_get_state(snic) != SNIC_OFFLINE && in snic_hba_reset_cmpl_handler()
1076 snic_get_state(snic) != SNIC_FWRESET); in snic_hba_reset_cmpl_handler()
1080 spin_lock_irqsave(&snic->snic_lock, gflags); in snic_hba_reset_cmpl_handler()
1081 if (snic_get_state(snic) == SNIC_FWRESET) in snic_hba_reset_cmpl_handler()
1082 snic_set_state(snic, SNIC_ONLINE); in snic_hba_reset_cmpl_handler()
1083 spin_unlock_irqrestore(&snic->snic_lock, gflags); in snic_hba_reset_cmpl_handler()
1085 if (snic->remove_wait) in snic_hba_reset_cmpl_handler()
1086 complete(snic->remove_wait); in snic_hba_reset_cmpl_handler()
1089 atomic64_inc(&snic->s_stats.reset.hba_reset_cmpl); in snic_hba_reset_cmpl_handler()
1093 if (snic->config.xpt_type == SNIC_DAS) in snic_hba_reset_cmpl_handler()
1096 SNIC_SCSI_DBG(snic->shost, "reset_cmpl: Queuing discovery work.\n"); in snic_hba_reset_cmpl_handler()
1097 queue_work(snic_glob->event_q, &snic->disc_work); in snic_hba_reset_cmpl_handler()
1103 snic_msg_ack_handler(struct snic *snic, struct snic_fw_req *fwreq) in snic_msg_ack_handler() argument
1105 SNIC_HOST_INFO(snic->shost, "Message Ack Received.\n"); in snic_msg_ack_handler()
1111 snic_aen_handler(struct snic *snic, struct snic_fw_req *fwreq) in snic_aen_handler() argument
1120 SNIC_SCSI_DBG(snic->shost, in snic_aen_handler()
1128 SNIC_HOST_INFO(snic->shost, "aen:TGT_OFFLINE Event Recvd.\n"); in snic_aen_handler()
1132 SNIC_HOST_INFO(snic->shost, "aen:TGT_ONLINE Event Recvd.\n"); in snic_aen_handler()
1136 SNIC_HOST_INFO(snic->shost, "aen:LUN_OFFLINE Event Recvd.\n"); in snic_aen_handler()
1140 SNIC_HOST_INFO(snic->shost, "aen:LUN_ONLINE Event Recvd.\n"); in snic_aen_handler()
1144 SNIC_HOST_INFO(snic->shost, "aen:Config Change Event Recvd.\n"); in snic_aen_handler()
1148 SNIC_HOST_INFO(snic->shost, "aen:TGT_ADD Event Recvd.\n"); in snic_aen_handler()
1152 SNIC_HOST_INFO(snic->shost, "aen:TGT_DEL Event Recvd.\n"); in snic_aen_handler()
1156 SNIC_HOST_INFO(snic->shost, "aen:LUN_ADD Event Recvd.\n"); in snic_aen_handler()
1160 SNIC_HOST_INFO(snic->shost, "aen:LUN_DEL Event Recvd.\n"); in snic_aen_handler()
1164 SNIC_HOST_INFO(snic->shost, "aen:DISC_CMPL Event Recvd.\n"); in snic_aen_handler()
1168 SNIC_HOST_INFO(snic->shost, "aen:Unknown Event Recvd.\n"); in snic_aen_handler()
1185 struct snic *snic = svnic_dev_priv(vdev); in snic_io_cmpl_handler() local
1193 atomic64_dec(&snic->s_stats.fw.actv_reqs); in snic_io_cmpl_handler()
1201 SNIC_HOST_ERR(snic->shost, in snic_io_cmpl_handler()
1206 SNIC_HOST_ERR(snic->shost, in snic_io_cmpl_handler()
1213 snic_io_exch_ver_cmpl_handler(snic, fwreq); in snic_io_cmpl_handler()
1217 snic_report_tgt_cmpl_handler(snic, fwreq); in snic_io_cmpl_handler()
1221 snic_icmnd_cmpl_handler(snic, fwreq); in snic_io_cmpl_handler()
1225 snic_itmf_cmpl_handler(snic, fwreq); in snic_io_cmpl_handler()
1229 snic_hba_reset_cmpl_handler(snic, fwreq); in snic_io_cmpl_handler()
1233 snic_msg_ack_handler(snic, fwreq); in snic_io_cmpl_handler()
1237 snic_aen_handler(snic, fwreq); in snic_io_cmpl_handler()
1242 SNIC_SCSI_DBG(snic->shost, in snic_io_cmpl_handler()
1250 if (cmpl_time > atomic64_read(&snic->s_stats.io.max_cmpl_time)) in snic_io_cmpl_handler()
1251 atomic64_set(&snic->s_stats.io.max_cmpl_time, cmpl_time); in snic_io_cmpl_handler()
1262 snic_fwcq_cmpl_handler(struct snic *snic, int io_cmpl_work) in snic_fwcq_cmpl_handler() argument
1267 struct snic_misc_stats *misc_stats = &snic->s_stats.misc; in snic_fwcq_cmpl_handler()
1269 for (cq_idx = snic->wq_count; cq_idx < snic->cq_count; cq_idx++) { in snic_fwcq_cmpl_handler()
1270 nent_per_cq = vnic_cq_fw_service(&snic->cq[cq_idx], in snic_fwcq_cmpl_handler()
1288 snic_queue_itmf_req(struct snic *snic, in snic_queue_itmf_req() argument
1308 snic->config.hid, in snic_queue_itmf_req()
1323 ret = snic_queue_wq_desc(snic, tmreq, sizeof(*tmreq)); in snic_queue_itmf_req()
1325 SNIC_HOST_ERR(snic->shost, in snic_queue_itmf_req()
1329 SNIC_SCSI_DBG(snic->shost, in snic_queue_itmf_req()
1337 snic_issue_tm_req(struct snic *snic, in snic_issue_tm_req() argument
1346 if (snic_get_state(snic) == SNIC_FWRESET) in snic_issue_tm_req()
1349 atomic_inc(&snic->ios_inflight); in snic_issue_tm_req()
1351 SNIC_SCSI_DBG(snic->shost, in snic_issue_tm_req()
1357 tmreq = snic_dr_req_init(snic, rqi); in snic_issue_tm_req()
1360 tmreq = snic_abort_req_init(snic, rqi); in snic_issue_tm_req()
1370 ret = snic_queue_itmf_req(snic, tmreq, sc, tmf, req_id); in snic_issue_tm_req()
1378 SNIC_HOST_ERR(snic->shost, in snic_issue_tm_req()
1382 SNIC_SCSI_DBG(snic->shost, in snic_issue_tm_req()
1387 atomic_dec(&snic->ios_inflight); in snic_issue_tm_req()
1396 snic_queue_abort_req(struct snic *snic, in snic_queue_abort_req() argument
1401 SNIC_SCSI_DBG(snic->shost, "q_abtreq: sc %p, rqi %p, tag %x, tmf %d\n", in snic_queue_abort_req()
1407 return snic_issue_tm_req(snic, rqi, sc, tmf); in snic_queue_abort_req()
1414 snic_abort_finish(struct snic *snic, struct scsi_cmnd *sc) in snic_abort_finish() argument
1421 io_lock = snic_io_lock_hash(snic, sc); in snic_abort_finish()
1425 atomic64_inc(&snic->s_stats.io.req_null); in snic_abort_finish()
1428 SNIC_SCSI_DBG(snic->shost, in snic_abort_finish()
1445 atomic64_inc(&snic->s_stats.abts.drv_tmo); in snic_abort_finish()
1446 SNIC_SCSI_DBG(snic->shost, in snic_abort_finish()
1466 SNIC_HOST_INFO(snic->shost, in snic_abort_finish()
1474 snic_release_req_buf(snic, rqi, sc); in snic_abort_finish()
1483 snic_send_abort_and_wait(struct snic *snic, struct scsi_cmnd *sc) in snic_send_abort_and_wait() argument
1501 io_lock = snic_io_lock_hash(snic, sc); in snic_send_abort_and_wait()
1520 SNIC_HOST_ERR(snic->shost, in snic_send_abort_and_wait()
1550 SNIC_SCSI_DBG(snic->shost, "send_abt_cmd: TAG 0x%x\n", tag); in snic_send_abort_and_wait()
1555 ret = snic_queue_abort_req(snic, rqi, sc, tmf); in snic_send_abort_and_wait()
1557 SNIC_HOST_ERR(snic->shost, in snic_send_abort_and_wait()
1576 atomic64_inc(&snic->s_stats.abts.num); in snic_send_abort_and_wait()
1583 SNIC_SCSI_DBG(snic->shost, in snic_send_abort_and_wait()
1610 struct snic *snic = shost_priv(sc->device->host); in snic_abort_cmd() local
1614 SNIC_SCSI_DBG(snic->shost, "abt_cmd:sc %p :0x%x :req = %p :tag = %d\n", in snic_abort_cmd()
1617 if (unlikely(snic_get_state(snic) != SNIC_ONLINE)) { in snic_abort_cmd()
1618 SNIC_HOST_ERR(snic->shost, in snic_abort_cmd()
1627 ret = snic_send_abort_and_wait(snic, sc); in snic_abort_cmd()
1631 ret = snic_abort_finish(snic, sc); in snic_abort_cmd()
1634 SNIC_TRC(snic->shost->host_no, tag, (ulong) sc, in snic_abort_cmd()
1638 SNIC_SCSI_DBG(snic->shost, in snic_abort_cmd()
1649 snic_is_abts_pending(struct snic *snic, struct scsi_cmnd *lr_sc) in snic_is_abts_pending() argument
1662 for (tag = 0; tag < snic->max_tag_id; tag++) { in snic_is_abts_pending()
1663 io_lock = snic_io_lock_tag(snic, tag); in snic_is_abts_pending()
1666 sc = scsi_host_find_tag(snic->shost, tag); in snic_is_abts_pending()
1685 SNIC_SCSI_DBG(snic->shost, "Found IO in %s on LUN\n", in snic_is_abts_pending()
1701 snic_dr_clean_single_req(struct snic *snic, in snic_dr_clean_single_req() argument
1714 io_lock = snic_io_lock_tag(snic, tag); in snic_dr_clean_single_req()
1716 sc = scsi_host_find_tag(snic->shost, tag); in snic_dr_clean_single_req()
1735 SNIC_SCSI_DBG(snic->shost, in snic_dr_clean_single_req()
1742 SNIC_SCSI_DBG(snic->shost, in snic_dr_clean_single_req()
1763 SNIC_SCSI_DBG(snic->shost, in snic_dr_clean_single_req()
1778 ret = snic_queue_abort_req(snic, rqi, sc, tmf); in snic_dr_clean_single_req()
1780 SNIC_HOST_ERR(snic->shost, in snic_dr_clean_single_req()
1817 SNIC_HOST_ERR(snic->shost, in snic_dr_clean_single_req()
1831 snic_release_req_buf(snic, rqi, sc); in snic_dr_clean_single_req()
1844 snic_dr_clean_pending_req(struct snic *snic, struct scsi_cmnd *lr_sc) in snic_dr_clean_pending_req() argument
1850 for (tag = 0; tag < snic->max_tag_id; tag++) { in snic_dr_clean_pending_req()
1854 ret = snic_dr_clean_single_req(snic, tag, lr_sdev); in snic_dr_clean_pending_req()
1856 SNIC_HOST_ERR(snic->shost, "clean_err:tag = %d\n", tag); in snic_dr_clean_pending_req()
1865 if (snic_is_abts_pending(snic, lr_sc)) { in snic_dr_clean_pending_req()
1872 SNIC_SCSI_DBG(snic->shost, "clean_pending_req: Success.\n"); in snic_dr_clean_pending_req()
1878 SNIC_HOST_ERR(snic->shost, in snic_dr_clean_pending_req()
1890 snic_dr_finish(struct snic *snic, struct scsi_cmnd *sc) in snic_dr_finish() argument
1898 io_lock = snic_io_lock_hash(snic, sc); in snic_dr_finish()
1903 SNIC_SCSI_DBG(snic->shost, in snic_dr_finish()
1918 SNIC_SCSI_DBG(snic->shost, in snic_dr_finish()
1928 SNIC_SCSI_DBG(snic->shost, in snic_dr_finish()
1935 SNIC_HOST_ERR(snic->shost, in snic_dr_finish()
1952 ret = snic_dr_clean_pending_req(snic, sc); in snic_dr_finish()
1955 SNIC_SCSI_DBG(snic->shost, in snic_dr_finish()
1978 snic_release_req_buf(snic, rqi, sc); in snic_dr_finish()
1985 snic_queue_dr_req(struct snic *snic, in snic_queue_dr_req() argument
1992 return snic_issue_tm_req(snic, rqi, sc, SNIC_ITMF_LUN_RESET); in snic_queue_dr_req()
1996 snic_send_dr_and_wait(struct snic *snic, struct scsi_cmnd *sc) in snic_send_dr_and_wait() argument
2005 io_lock = snic_io_lock_hash(snic, sc); in snic_send_dr_and_wait()
2010 SNIC_HOST_ERR(snic->shost, in snic_send_dr_and_wait()
2025 SNIC_SCSI_DBG(snic->shost, "dr: TAG = %x\n", tag); in snic_send_dr_and_wait()
2038 ret = snic_queue_dr_req(snic, rqi, sc); in snic_send_dr_and_wait()
2040 SNIC_HOST_ERR(snic->shost, in snic_send_dr_and_wait()
2085 snic_unlink_and_release_req(struct snic *snic, struct scsi_cmnd *sc, int flag) in snic_unlink_and_release_req() argument
2092 io_lock = snic_io_lock_hash(snic, sc); in snic_unlink_and_release_req()
2104 snic_release_req_buf(snic, rqi, sc); in snic_unlink_and_release_req()
2106 SNIC_TRC(snic->shost->host_no, snic_cmd_tag(sc), (ulong) sc, in snic_unlink_and_release_req()
2120 struct snic *snic = shost_priv(shost); in snic_device_reset() local
2134 snic_unlink_and_release_req(snic, sc, SNIC_DEV_RST_NOTSUP); in snic_device_reset()
2139 if (unlikely(snic_get_state(snic) != SNIC_ONLINE)) { in snic_device_reset()
2140 snic_unlink_and_release_req(snic, sc, 0); in snic_device_reset()
2148 SNIC_HOST_INFO(snic->shost, in snic_device_reset()
2151 rqi = snic_req_init(snic, 0); in snic_device_reset()
2165 ret = snic_send_dr_and_wait(snic, sc); in snic_device_reset()
2167 SNIC_HOST_ERR(snic->shost, in snic_device_reset()
2171 snic_unlink_and_release_req(snic, sc, 0); in snic_device_reset()
2176 ret = snic_dr_finish(snic, sc); in snic_device_reset()
2179 SNIC_TRC(snic->shost->host_no, tag, (ulong) sc, in snic_device_reset()
2183 SNIC_SCSI_DBG(snic->shost, in snic_device_reset()
2201 snic_issue_hba_reset(struct snic *snic, struct scsi_cmnd *sc) in snic_issue_hba_reset() argument
2210 rqi = snic_req_init(snic, 0); in snic_issue_hba_reset()
2220 SNIC_HOST_INFO(snic->shost, "issu_hr:Host reset thru ioctl.\n"); in snic_issue_hba_reset()
2226 io_lock = snic_io_lock_hash(snic, sc); in snic_issue_hba_reset()
2232 snic->remove_wait = &wait; in snic_issue_hba_reset()
2237 snic->config.hid, 0, (ulong) rqi); in snic_issue_hba_reset()
2241 ret = snic_queue_wq_desc(snic, req, sizeof(*req)); in snic_issue_hba_reset()
2243 SNIC_HOST_ERR(snic->shost, in snic_issue_hba_reset()
2253 atomic64_inc(&snic->s_stats.reset.hba_resets); in snic_issue_hba_reset()
2254 SNIC_HOST_INFO(snic->shost, "Queued HBA Reset Successfully.\n"); in snic_issue_hba_reset()
2256 wait_for_completion_timeout(snic->remove_wait, in snic_issue_hba_reset()
2259 if (snic_get_state(snic) == SNIC_FWRESET) { in snic_issue_hba_reset()
2260 SNIC_HOST_ERR(snic->shost, "reset_cmpl: Reset Timedout.\n"); in snic_issue_hba_reset()
2267 snic->remove_wait = NULL; in snic_issue_hba_reset()
2273 snic_req_free(snic, rqi); in snic_issue_hba_reset()
2281 snic->remove_wait = NULL; in snic_issue_hba_reset()
2287 snic_req_free(snic, rqi); in snic_issue_hba_reset()
2290 SNIC_HOST_ERR(snic->shost, in snic_issue_hba_reset()
2300 struct snic *snic = shost_priv(shost); in snic_reset() local
2306 sv_state = snic_get_state(snic); in snic_reset()
2308 spin_lock_irqsave(&snic->snic_lock, flags); in snic_reset()
2309 if (snic_get_state(snic) == SNIC_FWRESET) { in snic_reset()
2310 spin_unlock_irqrestore(&snic->snic_lock, flags); in snic_reset()
2319 snic_set_state(snic, SNIC_FWRESET); in snic_reset()
2320 spin_unlock_irqrestore(&snic->snic_lock, flags); in snic_reset()
2324 while (atomic_read(&snic->ios_inflight)) in snic_reset()
2327 ret = snic_issue_hba_reset(snic, sc); in snic_reset()
2332 spin_lock_irqsave(&snic->snic_lock, flags); in snic_reset()
2333 snic_set_state(snic, sv_state); in snic_reset()
2334 spin_unlock_irqrestore(&snic->snic_lock, flags); in snic_reset()
2335 atomic64_inc(&snic->s_stats.reset.hba_reset_fail); in snic_reset()
2379 snic_cmpl_pending_tmreq(struct snic *snic, struct scsi_cmnd *sc) in snic_cmpl_pending_tmreq() argument
2383 SNIC_SCSI_DBG(snic->shost, in snic_cmpl_pending_tmreq()
2401 snic_scsi_cleanup(struct snic *snic, int ex_tag) in snic_scsi_cleanup() argument
2410 SNIC_SCSI_DBG(snic->shost, "sc_clean: scsi cleanup.\n"); in snic_scsi_cleanup()
2412 for (tag = 0; tag < snic->max_tag_id; tag++) { in snic_scsi_cleanup()
2417 io_lock = snic_io_lock_tag(snic, tag); in snic_scsi_cleanup()
2419 sc = scsi_host_find_tag(snic->shost, tag); in snic_scsi_cleanup()
2431 snic_cmpl_pending_tmreq(snic, sc); in snic_scsi_cleanup()
2444 SNIC_SCSI_DBG(snic->shost, in snic_scsi_cleanup()
2453 SNIC_HOST_INFO(snic->shost, in snic_scsi_cleanup()
2457 snic_release_req_buf(snic, rqi, sc); in snic_scsi_cleanup()
2461 SNIC_HOST_INFO(snic->shost, in snic_scsi_cleanup()
2466 snic_stats_update_io_cmpl(&snic->s_stats); in snic_scsi_cleanup()
2469 SNIC_TRC(snic->shost->host_no, tag, (ulong) sc, in snic_scsi_cleanup()
2480 snic_shutdown_scsi_cleanup(struct snic *snic) in snic_shutdown_scsi_cleanup() argument
2482 SNIC_HOST_INFO(snic->shost, "Shutdown time SCSI Cleanup.\n"); in snic_shutdown_scsi_cleanup()
2484 snic_scsi_cleanup(snic, SCSI_NO_TAG); in snic_shutdown_scsi_cleanup()
2492 snic_internal_abort_io(struct snic *snic, struct scsi_cmnd *sc, int tmf) in snic_internal_abort_io() argument
2500 io_lock = snic_io_lock_hash(snic, sc); in snic_internal_abort_io()
2512 SNIC_SCSI_DBG(snic->shost, in snic_internal_abort_io()
2521 SNIC_SCSI_DBG(snic->shost, in snic_internal_abort_io()
2536 SNIC_SCSI_DBG(snic->shost, "internal_abts:dev rst sc %p\n", sc); in snic_internal_abort_io()
2539 SNIC_SCSI_DBG(snic->shost, "internal_abts: Issuing abts tag %x\n", in snic_internal_abort_io()
2544 ret = snic_queue_abort_req(snic, rqi, sc, tmf); in snic_internal_abort_io()
2546 SNIC_HOST_ERR(snic->shost, in snic_internal_abort_io()
2579 struct snic *snic = NULL; in snic_tgt_scsi_abort_io() local
2589 snic = shost_priv(snic_tgt_to_shost(tgt)); in snic_tgt_scsi_abort_io()
2590 SNIC_SCSI_DBG(snic->shost, "tgt_abt_io: Cleaning Pending IOs.\n"); in snic_tgt_scsi_abort_io()
2597 for (tag = 0; tag < snic->max_tag_id; tag++) { in snic_tgt_scsi_abort_io()
2598 io_lock = snic_io_lock_tag(snic, tag); in snic_tgt_scsi_abort_io()
2601 sc = scsi_host_find_tag(snic->shost, tag); in snic_tgt_scsi_abort_io()
2616 ret = snic_internal_abort_io(snic, sc, tmf); in snic_tgt_scsi_abort_io()
2618 SNIC_HOST_ERR(snic->shost, in snic_tgt_scsi_abort_io()
2629 SNIC_SCSI_DBG(snic->shost, "tgt_abt_io: abt_cnt = %d\n", abt_cnt); in snic_tgt_scsi_abort_io()