Lines Matching refs:cmd
42 static void process_cmd_err(struct afu_cmd *cmd, struct scsi_cmnd *scp) in process_cmd_err() argument
44 struct afu *afu = cmd->parent; in process_cmd_err()
50 ioasa = &(cmd->sa); in process_cmd_err()
56 __func__, cmd, scp, resid); in process_cmd_err()
61 __func__, cmd, scp); in process_cmd_err()
152 static void cmd_complete(struct afu_cmd *cmd) in cmd_complete() argument
156 struct afu *afu = cmd->parent; in cmd_complete()
159 struct hwq *hwq = get_hwq(afu, cmd->hwq_index); in cmd_complete()
162 list_del(&cmd->list); in cmd_complete()
165 if (cmd->scp) { in cmd_complete()
166 scp = cmd->scp; in cmd_complete()
167 if (unlikely(cmd->sa.ioasc)) in cmd_complete()
168 process_cmd_err(cmd, scp); in cmd_complete()
173 __func__, scp, scp->result, cmd->sa.ioasc); in cmd_complete()
175 } else if (cmd->cmd_tmf) { in cmd_complete()
181 complete(&cmd->cevent); in cmd_complete()
194 struct afu_cmd *cmd, *tmp; in flush_pending_cmds() local
198 list_for_each_entry_safe(cmd, tmp, &hwq->pending_cmds, list) { in flush_pending_cmds()
200 if (!list_empty(&cmd->queue)) in flush_pending_cmds()
203 list_del(&cmd->list); in flush_pending_cmds()
205 if (cmd->scp) { in flush_pending_cmds()
206 scp = cmd->scp; in flush_pending_cmds()
210 cmd->cmd_aborted = true; in flush_pending_cmds()
212 if (cmd->cmd_tmf) { in flush_pending_cmds()
219 complete(&cmd->cevent); in flush_pending_cmds()
300 static int send_cmd_ioarrin(struct afu *afu, struct afu_cmd *cmd) in send_cmd_ioarrin() argument
304 struct hwq *hwq = get_hwq(afu, cmd->hwq_index); in send_cmd_ioarrin()
319 __func__, cmd->rcb.cdb[0], room); in send_cmd_ioarrin()
327 list_add(&cmd->list, &hwq->pending_cmds); in send_cmd_ioarrin()
328 writeq_be((u64)&cmd->rcb, &hwq->host_map->ioarrin); in send_cmd_ioarrin()
332 __func__, cmd, cmd->rcb.data_len, cmd->rcb.data_ea, rc); in send_cmd_ioarrin()
344 static int send_cmd_sq(struct afu *afu, struct afu_cmd *cmd) in send_cmd_sq() argument
348 struct hwq *hwq = get_hwq(afu, cmd->hwq_index); in send_cmd_sq()
359 cmd->rcb.ioasa = &cmd->sa; in send_cmd_sq()
363 *hwq->hsq_curr = cmd->rcb; in send_cmd_sq()
369 list_add(&cmd->list, &hwq->pending_cmds); in send_cmd_sq()
375 "head=%016llx tail=%016llx\n", __func__, cmd, cmd->rcb.data_len, in send_cmd_sq()
376 cmd->rcb.data_ea, cmd->rcb.ioasa, rc, hwq->hsq_curr, in send_cmd_sq()
389 static int wait_resp(struct afu *afu, struct afu_cmd *cmd) in wait_resp() argument
394 ulong timeout = msecs_to_jiffies(cmd->rcb.timeout * 2 * 1000); in wait_resp()
396 timeout = wait_for_completion_timeout(&cmd->cevent, timeout); in wait_resp()
400 if (cmd->cmd_aborted) in wait_resp()
403 if (unlikely(cmd->sa.ioasc != 0)) { in wait_resp()
405 __func__, cmd->rcb.cdb[0], cmd->sa.ioasc); in wait_resp()
462 struct afu_cmd *cmd = NULL; in send_tmf() local
471 buf = kzalloc(sizeof(*cmd) + __alignof__(*cmd) - 1, GFP_KERNEL); in send_tmf()
478 cmd = (struct afu_cmd *)PTR_ALIGN(buf, __alignof__(*cmd)); in send_tmf()
479 INIT_LIST_HEAD(&cmd->queue); in send_tmf()
490 cmd->parent = afu; in send_tmf()
491 cmd->cmd_tmf = true; in send_tmf()
492 cmd->hwq_index = hwq->index; in send_tmf()
494 cmd->rcb.ctx_id = hwq->ctx_hndl; in send_tmf()
495 cmd->rcb.msi = SISL_MSI_RRQ_UPDATED; in send_tmf()
496 cmd->rcb.port_sel = CHAN2PORTMASK(sdev->channel); in send_tmf()
497 cmd->rcb.lun_id = lun_to_lunid(sdev->lun); in send_tmf()
498 cmd->rcb.req_flags = (SISL_REQ_FLAGS_PORT_LUN_ID | in send_tmf()
501 memcpy(cmd->rcb.cdb, &tmfcmd, sizeof(tmfcmd)); in send_tmf()
503 rc = afu->send_cmd(afu, cmd); in send_tmf()
521 } else if (cmd->cmd_aborted) { in send_tmf()
524 } else if (cmd->sa.ioasc) { in send_tmf()
526 __func__, cmd->sa.ioasc); in send_tmf()
534 list_del(&cmd->list); in send_tmf()
565 struct afu_cmd *cmd = sc_to_afuci(scp); in cxlflash_queuecommand() local
613 cmd->rcb.data_len = sg->length; in cxlflash_queuecommand()
614 cmd->rcb.data_ea = (uintptr_t)sg_virt(sg); in cxlflash_queuecommand()
617 cmd->scp = scp; in cxlflash_queuecommand()
618 cmd->parent = afu; in cxlflash_queuecommand()
619 cmd->hwq_index = hwq_index; in cxlflash_queuecommand()
621 cmd->sa.ioasc = 0; in cxlflash_queuecommand()
622 cmd->rcb.ctx_id = hwq->ctx_hndl; in cxlflash_queuecommand()
623 cmd->rcb.msi = SISL_MSI_RRQ_UPDATED; in cxlflash_queuecommand()
624 cmd->rcb.port_sel = CHAN2PORTMASK(scp->device->channel); in cxlflash_queuecommand()
625 cmd->rcb.lun_id = lun_to_lunid(scp->device->lun); in cxlflash_queuecommand()
630 cmd->rcb.req_flags = req_flags; in cxlflash_queuecommand()
631 memcpy(cmd->rcb.cdb, scp->cmnd, sizeof(cmd->rcb.cdb)); in cxlflash_queuecommand()
633 rc = afu->send_cmd(afu, cmd); in cxlflash_queuecommand()
1371 struct afu_cmd *cmd; in process_hrrq() local
1392 cmd = container_of(ioasa, struct afu_cmd, sa); in process_hrrq()
1395 cmd = container_of(ioarcb, struct afu_cmd, rcb); in process_hrrq()
1398 list_add_tail(&cmd->queue, doneq); in process_hrrq()
1429 struct afu_cmd *cmd, *tmp; in process_cmd_doneq() local
1433 list_for_each_entry_safe(cmd, tmp, doneq, queue) in process_cmd_doneq()
1434 cmd_complete(cmd); in process_cmd_doneq()
2280 struct afu_cmd *cmd = NULL; in send_afu_cmd() local
2295 buf = kmalloc(sizeof(*cmd) + __alignof__(*cmd) - 1, GFP_KERNEL); in send_afu_cmd()
2302 cmd = (struct afu_cmd *)PTR_ALIGN(buf, __alignof__(*cmd)); in send_afu_cmd()
2305 memset(cmd, 0, sizeof(*cmd)); in send_afu_cmd()
2306 memcpy(&cmd->rcb, rcb, sizeof(*rcb)); in send_afu_cmd()
2307 INIT_LIST_HEAD(&cmd->queue); in send_afu_cmd()
2308 init_completion(&cmd->cevent); in send_afu_cmd()
2309 cmd->parent = afu; in send_afu_cmd()
2310 cmd->hwq_index = hwq->index; in send_afu_cmd()
2311 cmd->rcb.ctx_id = hwq->ctx_hndl; in send_afu_cmd()
2314 __func__, afu, cmd, cmd->rcb.cdb[0], nretry); in send_afu_cmd()
2316 rc = afu->send_cmd(afu, cmd); in send_afu_cmd()
2322 rc = wait_resp(afu, cmd); in send_afu_cmd()
2329 list_del(&cmd->list); in send_afu_cmd()
2345 *rcb->ioasa = cmd->sa; in send_afu_cmd()
2406 struct afu_cmd *cmd = sc_to_afuc(scp); in cxlflash_eh_abort_handler() local
2409 struct hwq *hwq = get_hwq(afu, cmd->hwq_index); in cxlflash_eh_abort_handler()
3265 static char *decode_hioctl(unsigned int cmd) in decode_hioctl() argument
3267 switch (cmd) { in decode_hioctl()
3472 static long cxlflash_chr_ioctl(struct file *file, unsigned int cmd, in cxlflash_chr_ioctl() argument
3502 __func__, cmd, idx, sizeof(ioctl_tbl)); in cxlflash_chr_ioctl()
3504 switch (cmd) { in cxlflash_chr_ioctl()
3508 idx = _IOC_NR(HT_CXLFLASH_LUN_PROVISION) - _IOC_NR(cmd); in cxlflash_chr_ioctl()
3524 __func__, size, cmd, decode_hioctl(cmd), uarg); in cxlflash_chr_ioctl()
3532 __func__, hdr->version, decode_hioctl(cmd)); in cxlflash_chr_ioctl()
3548 __func__, size, cmd, decode_hioctl(cmd), uarg); in cxlflash_chr_ioctl()
3558 __func__, decode_hioctl(cmd), cmd, rc); in cxlflash_chr_ioctl()
3561 __func__, decode_hioctl(cmd), cmd, rc); in cxlflash_chr_ioctl()