| /linux/Documentation/translations/zh_CN/scsi/ |
| H A D | scsi_eh.rst | 25 [1-2] scmd(SCSI 命令)是如何完成的? 26 [1-2-1] 通过scsi_done完成scmd 27 [1-2-2] 通过超时机制完成scmd 32 [2-1-2] scmd在错误处理流程中的传递路径 46 每个SCSI命令都由struct scsi_cmnd(简称scmd)结构体 47 表示。scmd包含两个list_head类型的链表节点:scmd->list 48 与scmd->eh_entry。其中scmd->list是用于空闲链表或设备 49 专属的scmd分配链表,与错误处理讨论关联不大。而 50 scmd->eh_entry则是专用于命令完成和错误处理链表,除非 51 特别说明,本文讨论中所有scmd的链表操作均通过 [all …]
|
| /linux/drivers/scsi/ |
| H A D | scsi_error.c | 60 static int scsi_eh_try_stu(struct scsi_cmnd *scmd); 149 struct scsi_cmnd *scmd = in scmd_eh_abort_handler() local 151 struct scsi_device *sdev = scmd->device; in scmd_eh_abort_handler() 158 scmd_printk(KERN_INFO, scmd, in scmd_eh_abort_handler() 164 scmd_printk(KERN_INFO, scmd, in scmd_eh_abort_handler() 166 rtn = scsi_try_to_abort_cmd(shost->hostt, scmd); in scmd_eh_abort_handler() 169 scmd_printk(KERN_INFO, scmd, in scmd_eh_abort_handler() 175 set_host_byte(scmd, DID_TIME_OUT); in scmd_eh_abort_handler() 178 scmd_printk(KERN_INFO, scmd, in scmd_eh_abort_handler() 185 list_del_init(&scmd->eh_entry); in scmd_eh_abort_handler() [all …]
|
| H A D | scsi_bsg.c | 15 struct scsi_cmnd *scmd; in scsi_bsg_sg_io_fn() local 34 scmd = blk_mq_rq_to_pdu(rq); in scsi_bsg_sg_io_fn() 35 scmd->cmd_len = hdr->request_len; in scsi_bsg_sg_io_fn() 36 if (scmd->cmd_len > sizeof(scmd->cmnd)) { in scsi_bsg_sg_io_fn() 42 if (copy_from_user(scmd->cmnd, uptr64(hdr->request), scmd->cmd_len)) in scsi_bsg_sg_io_fn() 45 if (!scsi_cmd_allowed(scmd->cmnd, open_for_write)) in scsi_bsg_sg_io_fn() 66 hdr->device_status = scmd->result & 0xff; in scsi_bsg_sg_io_fn() 67 hdr->transport_status = host_byte(scmd->result); in scsi_bsg_sg_io_fn() 69 if (scsi_status_is_check_condition(scmd->result)) in scsi_bsg_sg_io_fn() 76 if (scmd->sense_len && hdr->response) { in scsi_bsg_sg_io_fn() [all …]
|
| H A D | sr.c | 940 struct scsi_cmnd *scmd; in sr_read_cdda_bpc() local 948 scmd = blk_mq_rq_to_pdu(rq); in sr_read_cdda_bpc() 954 scmd->cmnd[0] = GPCMD_READ_CD; in sr_read_cdda_bpc() 955 scmd->cmnd[1] = 1 << 2; in sr_read_cdda_bpc() 956 scmd->cmnd[2] = (lba >> 24) & 0xff; in sr_read_cdda_bpc() 957 scmd->cmnd[3] = (lba >> 16) & 0xff; in sr_read_cdda_bpc() 958 scmd->cmnd[4] = (lba >> 8) & 0xff; in sr_read_cdda_bpc() 959 scmd->cmnd[5] = lba & 0xff; in sr_read_cdda_bpc() 960 scmd->cmnd[6] = (nr >> 16) & 0xff; in sr_read_cdda_bpc() 961 scmd->cmnd[7] = (nr >> 8) & 0xff; in sr_read_cdda_bpc() [all …]
|
| H A D | scsi_lib.c | 210 static int scsi_check_passthrough(struct scsi_cmnd *scmd, in scsi_check_passthrough() argument 217 if (!scmd->result) in scsi_check_passthrough() 228 if (host_byte(scmd->result) && in scsi_check_passthrough() 229 host_byte(scmd->result) == host_byte(failure->result)) in scsi_check_passthrough() 232 status = status_byte(scmd->result); in scsi_check_passthrough() 237 !scsi_status_is_good(scmd->result)) in scsi_check_passthrough() 247 if (!scsi_command_normalize_sense(scmd, &sshdr)) in scsi_check_passthrough() 301 struct scsi_cmnd *scmd; in scsi_execute_cmd() local 320 scmd = blk_mq_rq_to_pdu(req); in scsi_execute_cmd() 321 scmd->cmd_len = COMMAND_SIZE(cmd[0]); in scsi_execute_cmd() [all …]
|
| H A D | scsi_priv.h | 43 #define SCSI_SENSE_VALID(scmd) \ argument 44 (((scmd)->sense_buffer[0] & 0x70) == 0x70) 100 bool scsi_noretry_cmd(struct scsi_cmnd *scmd); 101 void scsi_eh_done(struct scsi_cmnd *scmd);
|
| H A D | scsi_logging.c | 29 static inline const char *scmd_name(struct scsi_cmnd *scmd) in scmd_name() argument 31 const struct request *rq = scsi_cmd_to_rq(scmd); in scmd_name() 83 void scmd_printk(const char *level, struct scsi_cmnd *scmd, const char *fmt, in scmd_printk() argument 90 if (!scmd) in scmd_printk() 96 off = sdev_format_header(logbuf, logbuf_len, scmd_name(scmd), in scmd_printk() 97 scsi_cmd_to_rq(scmd)->tag); in scmd_printk() 103 dev_printk(level, &scmd->device->sdev_gendev, "%s", logbuf); in scmd_printk()
|
| H A D | st.c | 487 struct scsi_cmnd *scmd = blk_mq_rq_to_pdu(req); in st_do_stats() local 491 if (scmd->cmnd[0] == WRITE_6) { in st_do_stats() 496 if (scmd->result) { in st_do_stats() 505 } else if (scmd->cmnd[0] == READ_6) { in st_do_stats() 510 if (scmd->result) { in st_do_stats() 530 struct scsi_cmnd *scmd = blk_mq_rq_to_pdu(req); in st_scsi_execute_end() local 535 STp->buffer->cmdstat.midlevel_result = SRpnt->result = scmd->result; in st_scsi_execute_end() 536 STp->buffer->cmdstat.residual = scmd->resid_len; in st_scsi_execute_end() 541 if (scmd->sense_len) in st_scsi_execute_end() 542 memcpy(SRpnt->sense, scmd->sense_buffer, SCSI_SENSE_BUFFERSIZE); in st_scsi_execute_end() [all …]
|
| H A D | sd.c | 830 static unsigned char sd_setup_protect_cmnd(struct scsi_cmnd *scmd, in sd_setup_protect_cmnd() argument 833 struct request *rq = scsi_cmd_to_rq(scmd); in sd_setup_protect_cmnd() 840 scmd->prot_flags |= SCSI_PROT_IP_CHECKSUM; in sd_setup_protect_cmnd() 843 scmd->prot_flags |= SCSI_PROT_GUARD_CHECK; in sd_setup_protect_cmnd() 847 scmd->prot_flags |= SCSI_PROT_REF_INCREMENT; in sd_setup_protect_cmnd() 850 scmd->prot_flags |= SCSI_PROT_REF_CHECK; in sd_setup_protect_cmnd() 854 scmd->prot_flags |= SCSI_PROT_TRANSFER_PI; in sd_setup_protect_cmnd() 862 scsi_set_prot_op(scmd, prot_op); in sd_setup_protect_cmnd() 863 scsi_set_prot_type(scmd, dif); in sd_setup_protect_cmnd() 864 scmd->prot_flags &= sd_prot_flag_mask(prot_op); in sd_setup_protect_cmnd() [all …]
|
| H A D | 53c700.h | 27 #define CDEBUG(prefix, scmd, fmt, a...) \ argument 28 scmd_printk(prefix, scmd, fmt, ##a) 31 #define DDEBUG(prefix, scmd, fmt, a...) do {} while (0) argument 32 #define CDEBUG(prefix, scmd, fmt, a...) do {} while (0) argument
|
| H A D | hosts.c | 708 struct scsi_cmnd *scmd = blk_mq_rq_to_pdu(rq); in complete_all_cmds_iter() local 711 scsi_dma_unmap(scmd); in complete_all_cmds_iter() 712 scmd->result = 0; in complete_all_cmds_iter() 713 set_host_byte(scmd, status); in complete_all_cmds_iter() 714 scsi_done(scmd); in complete_all_cmds_iter()
|
| H A D | sg.c | 1314 struct scsi_cmnd *scmd = blk_mq_rq_to_pdu(rq); in sg_rq_end_io() local 1334 sense = scmd->sense_buffer; in sg_rq_end_io() 1335 result = scmd->result; in sg_rq_end_io() 1336 resid = scmd->resid_len; in sg_rq_end_io() 1368 if (scmd->sense_len) in sg_rq_end_io() 1369 memcpy(srp->sense_b, scmd->sense_buffer, SCSI_SENSE_BUFFERSIZE); in sg_rq_end_io() 1734 struct scsi_cmnd *scmd; in sg_start_req() local 1755 scmd = blk_mq_rq_to_pdu(rq); in sg_start_req() 1757 if (hp->cmd_len > sizeof(scmd->cmnd)) { in sg_start_req() 1762 memcpy(scmd->cmnd, cmd, hp->cmd_len); in sg_start_req() [all …]
|
| /linux/include/scsi/ |
| H A D | scsi_cmnd.h | 147 static inline struct request *scsi_cmd_to_rq(struct scsi_cmnd *scmd) in scsi_cmd_to_rq() argument 149 return blk_mq_rq_from_pdu(scmd); in scsi_cmd_to_rq() 223 static inline sector_t scsi_get_sector(struct scsi_cmnd *scmd) in scsi_get_sector() argument 225 return blk_rq_pos(scsi_cmd_to_rq(scmd)); in scsi_get_sector() 228 static inline sector_t scsi_get_lba(struct scsi_cmnd *scmd) in scsi_get_lba() argument 230 unsigned int shift = ilog2(scmd->device->sector_size) - SECTOR_SHIFT; in scsi_get_lba() 232 return blk_rq_pos(scsi_cmd_to_rq(scmd)) >> shift; in scsi_get_lba() 235 static inline unsigned int scsi_logical_block_count(struct scsi_cmnd *scmd) in scsi_logical_block_count() argument 237 unsigned int shift = ilog2(scmd->device->sector_size); in scsi_logical_block_count() 239 return blk_rq_bytes(scsi_cmd_to_rq(scmd)) >> shift; in scsi_logical_block_count() [all …]
|
| H A D | scsi_eh.h | 12 extern void scsi_eh_finish_cmd(struct scsi_cmnd *scmd, 46 extern void scsi_eh_prep_cmnd(struct scsi_cmnd *scmd, 50 extern void scsi_eh_restore_cmnd(struct scsi_cmnd* scmd,
|
| H A D | scsi_device.h | 325 #define scmd_dbg(scmd, fmt, a...) \ argument 327 struct request *__rq = scsi_cmd_to_rq((scmd)); \ 330 sdev_dbg((scmd)->device, "[%s] " fmt, \ 333 sdev_dbg((scmd)->device, fmt, ##a); \ 570 void scsi_put_internal_cmd(struct scsi_cmnd *scmd); 599 #define scmd_id(scmd) sdev_id((scmd)->device) argument 600 #define scmd_channel(scmd) sdev_channel((scmd)->device) argument
|
| H A D | scsi_transport_srp.h | 121 enum scsi_timeout_action srp_timed_out(struct scsi_cmnd *scmd);
|
| /linux/drivers/scsi/mpi3mr/ |
| H A D | mpi3mr_os.c | 69 struct scsi_cmnd *scmd) in mpi3mr_host_tag_for_scmd() argument 75 unique_tag = blk_mq_unique_tag(scsi_cmd_to_rq(scmd)); in mpi3mr_host_tag_for_scmd() 85 priv = scsi_cmd_priv(scmd); in mpi3mr_host_tag_for_scmd() 88 priv->scmd = scmd; in mpi3mr_host_tag_for_scmd() 111 struct scsi_cmnd *scmd = NULL; in mpi3mr_scmd_from_host_tag() local 120 scmd = scsi_host_find_tag(mrioc->shost, unique_tag); in mpi3mr_scmd_from_host_tag() 121 if (scmd) { in mpi3mr_scmd_from_host_tag() 122 priv = scsi_cmd_priv(scmd); in mpi3mr_scmd_from_host_tag() 124 scmd = NULL; in mpi3mr_scmd_from_host_tag() 127 return scmd; in mpi3mr_scmd_from_host_tag() [all …]
|
| /linux/Documentation/scsi/ |
| H A D | scsi_eh.rst | 15 [1-2] How do scmd's get completed? 16 [1-2-1] Completing a scmd w/ scsi_done 17 [1-2-2] Completing a scmd w/ timeout 36 Each SCSI command is represented with struct scsi_cmnd (== scmd). A 37 scmd has two list_head's to link itself into lists. The two are 38 scmd->list and scmd->eh_entry. The former is used for free list or 39 per-device allocated scmd list and not of much interest to this EH 41 otherwise stated scmds are always linked using scmd->eh_entry in this 45 1.2 How do scmd's get completed? 48 Once LLDD gets hold of a scmd, either the LLDD will complete the [all …]
|
| /linux/drivers/s390/scsi/ |
| H A D | zfcp_dbf.h | 387 void _zfcp_dbf_scsi(char *tag, int level, struct scsi_cmnd *scmd, in _zfcp_dbf_scsi() argument 391 scmd->device->host->hostdata[0]; in _zfcp_dbf_scsi() 394 zfcp_dbf_scsi_common(tag, level, scmd->device, scmd, req); in _zfcp_dbf_scsi() 403 void zfcp_dbf_scsi_result(struct scsi_cmnd *scmd, struct zfcp_fsf_req *req) in zfcp_dbf_scsi_result() argument 405 if (scmd->result != 0) in zfcp_dbf_scsi_result() 406 _zfcp_dbf_scsi("rsl_err", 3, scmd, req); in zfcp_dbf_scsi_result() 407 else if (scmd->retries > 0) in zfcp_dbf_scsi_result() 408 _zfcp_dbf_scsi("rsl_ret", 4, scmd, req); in zfcp_dbf_scsi_result() 410 _zfcp_dbf_scsi("rsl_nor", 6, scmd, req); in zfcp_dbf_scsi_result() 418 void zfcp_dbf_scsi_fail_send(struct scsi_cmnd *scmd) in zfcp_dbf_scsi_fail_send() argument [all …]
|
| /linux/drivers/ata/ |
| H A D | libata-scsi.c | 791 struct scsi_cmnd *scmd = qc->scsicmd; in ata_qc_set_pc_nbytes() local 793 qc->extrabytes = scmd->extra_len; in ata_qc_set_pc_nbytes() 794 qc->nbytes = scsi_bufflen(scmd) + qc->extrabytes; in ata_qc_set_pc_nbytes() 1058 struct scsi_cmnd *scmd = blk_mq_rq_to_pdu(rq); in ata_scsi_dma_need_drain() local 1060 return atapi_cmd_type(scmd->cmnd[0]) == ATAPI_MISC; in ata_scsi_dma_need_drain() 1252 struct scsi_cmnd *scmd = qc->scsicmd; in ata_scsi_start_stop_xlat() local 1253 const u8 *cdb = scmd->cmnd; in ata_scsi_start_stop_xlat() 1257 if (scmd->cmd_len < 5) { in ata_scsi_start_stop_xlat() 1278 ata_scsi_set_sense(qc->dev, scmd, ABORTED_COMMAND, 0, 0); in ata_scsi_start_stop_xlat() 1292 ata_scsi_set_invalid_field(qc->dev, scmd, fp, bp); in ata_scsi_start_stop_xlat() [all …]
|
| H A D | libata-eh.c | 595 struct scsi_cmnd *scmd, *tmp; in ata_scsi_cmd_error_handler() local 631 list_for_each_entry_safe(scmd, tmp, eh_work_q, eh_entry) { in ata_scsi_cmd_error_handler() 640 set_host_byte(scmd, DID_OK); in ata_scsi_cmd_error_handler() 644 qc->scsicmd == scmd) in ata_scsi_cmd_error_handler() 652 set_host_byte(scmd, DID_TIME_OUT); in ata_scsi_cmd_error_handler() 662 scmd->retries = scmd->allowed; in ata_scsi_cmd_error_handler() 663 scsi_eh_finish_cmd(scmd, &ap->eh_done_q); in ata_scsi_cmd_error_handler() 1170 static void ata_eh_scsidone(struct scsi_cmnd *scmd) in ata_eh_scsidone() argument 1178 struct scsi_cmnd *scmd = qc->scsicmd; in __ata_eh_qc_complete() local 1187 scsi_eh_finish_cmd(scmd, &ap->eh_done_q); in __ata_eh_qc_complete() [all …]
|
| /linux/drivers/scsi/smartpqi/ |
| H A D | smartpqi_init.c | 83 struct scsi_cmnd *scmd, u32 aio_handle, u8 *cdb, 87 struct scsi_cmnd *scmd, struct pqi_queue_group *queue_group, 91 struct scsi_cmnd *scmd, struct pqi_queue_group *queue_group, 223 static inline void pqi_scsi_done(struct scsi_cmnd *scmd) in pqi_scsi_done() argument 225 pqi_prep_for_scsi_done(scmd); in pqi_scsi_done() 226 scsi_done(scmd); in pqi_scsi_done() 542 static inline bool pqi_is_io_high_priority(struct pqi_scsi_dev *device, struct scsi_cmnd *scmd) in pqi_is_io_high_priority() argument 551 IOPRIO_PRIO_CLASS(req_get_ioprio(scsi_cmd_to_rq(scmd))); in pqi_is_io_high_priority() 554 switch (scmd->cmnd[0]) { in pqi_is_io_high_priority() 721 io_request->scmd = NULL; in pqi_reinit_io_request() [all …]
|
| /linux/drivers/scsi/megaraid/ |
| H A D | megaraid_sas_fusion.c | 225 struct scsi_cmnd *scmd) in megasas_sdev_busy_inc() argument 229 scmd->device->hostdata; in megasas_sdev_busy_inc() 236 struct scsi_cmnd *scmd) in megasas_sdev_busy_dec() argument 240 scmd->device->hostdata; in megasas_sdev_busy_dec() 247 struct scsi_cmnd *scmd) in megasas_sdev_busy_read() argument 251 scmd->device->hostdata; in megasas_sdev_busy_read() 281 cmd->scmd = NULL; in megasas_return_cmd_fusion() 390 struct scsi_cmnd *scmd, in megasas_get_msix_index() argument 395 (megasas_sdev_busy_read(instance, scmd) > in megasas_get_msix_index() 405 u32 tag = blk_mq_unique_tag(scsi_cmd_to_rq(scmd)); in megasas_get_msix_index() [all …]
|
| /linux/arch/powerpc/include/asm/ |
| H A D | smu.h | 427 extern int smu_queue_simple(struct smu_simple_cmd *scmd, u8 command, 445 static inline void smu_spinwait_simple(struct smu_simple_cmd *scmd) in smu_spinwait_simple() argument 447 smu_spinwait_cmd(&scmd->cmd); in smu_spinwait_simple() 503 struct smu_cmd scmd; member
|
| /linux/drivers/scsi/mpt3sas/ |
| H A D | mpt3sas_warpdrive.c | 255 mpt3sas_setup_direct_io(struct MPT3SAS_ADAPTER *ioc, struct scsi_cmnd *scmd, in mpt3sas_setup_direct_io() argument 260 u8 num_pds, cmd = scmd->cmnd[0]; in mpt3sas_setup_direct_io() 261 struct scsiio_tracker *st = scsi_cmd_priv(scmd); in mpt3sas_setup_direct_io() 272 io_size = scsi_bufflen(scmd) >> raid_device->block_exponent; in mpt3sas_setup_direct_io()
|