• Home
  • Raw
  • Download

Lines Matching refs:sdev

727 	struct scsi_device *sdev = cmd->device;  in scsi_finish_command()  local
728 struct scsi_target *starget = scsi_target(sdev); in scsi_finish_command()
729 struct Scsi_Host *shost = sdev->host; in scsi_finish_command()
733 scsi_device_unbusy(sdev); in scsi_finish_command()
743 if (atomic_read(&sdev->device_blocked)) in scsi_finish_command()
744 atomic_set(&sdev->device_blocked, 0); in scsi_finish_command()
753 SCSI_LOG_MLCOMPLETE(4, sdev_printk(KERN_INFO, sdev, in scsi_finish_command()
793 void scsi_adjust_queue_depth(struct scsi_device *sdev, int tagged, int tags) in scsi_adjust_queue_depth() argument
803 spin_lock_irqsave(sdev->request_queue->queue_lock, flags); in scsi_adjust_queue_depth()
814 if (!shost_use_blk_mq(sdev->host) && !sdev->host->bqt) { in scsi_adjust_queue_depth()
815 if (blk_queue_tagged(sdev->request_queue) && in scsi_adjust_queue_depth()
816 blk_queue_resize_tags(sdev->request_queue, tags) != 0) in scsi_adjust_queue_depth()
820 sdev->queue_depth = tags; in scsi_adjust_queue_depth()
823 sdev->ordered_tags = 0; in scsi_adjust_queue_depth()
824 sdev->simple_tags = 0; in scsi_adjust_queue_depth()
827 sdev->ordered_tags = 1; in scsi_adjust_queue_depth()
828 sdev->simple_tags = 1; in scsi_adjust_queue_depth()
831 sdev->ordered_tags = 0; in scsi_adjust_queue_depth()
832 sdev->simple_tags = 1; in scsi_adjust_queue_depth()
835 sdev->ordered_tags = 0; in scsi_adjust_queue_depth()
836 sdev->simple_tags = 0; in scsi_adjust_queue_depth()
837 sdev_printk(KERN_WARNING, sdev, in scsi_adjust_queue_depth()
842 spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags); in scsi_adjust_queue_depth()
865 int scsi_track_queue_full(struct scsi_device *sdev, int depth) in scsi_track_queue_full() argument
873 if ((jiffies >> 4) == (sdev->last_queue_full_time >> 4)) in scsi_track_queue_full()
876 sdev->last_queue_full_time = jiffies; in scsi_track_queue_full()
877 if (sdev->last_queue_full_depth != depth) { in scsi_track_queue_full()
878 sdev->last_queue_full_count = 1; in scsi_track_queue_full()
879 sdev->last_queue_full_depth = depth; in scsi_track_queue_full()
881 sdev->last_queue_full_count++; in scsi_track_queue_full()
884 if (sdev->last_queue_full_count <= 10) in scsi_track_queue_full()
886 if (sdev->last_queue_full_depth < 8) { in scsi_track_queue_full()
888 scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun); in scsi_track_queue_full()
892 if (sdev->ordered_tags) in scsi_track_queue_full()
893 scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, depth); in scsi_track_queue_full()
895 scsi_adjust_queue_depth(sdev, MSG_SIMPLE_TAG, depth); in scsi_track_queue_full()
912 static int scsi_vpd_inquiry(struct scsi_device *sdev, unsigned char *buffer, in scsi_vpd_inquiry() argument
932 result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer, in scsi_vpd_inquiry()
958 int scsi_get_vpd_page(struct scsi_device *sdev, u8 page, unsigned char *buf, in scsi_get_vpd_page() argument
963 if (sdev->skip_vpd_pages) in scsi_get_vpd_page()
967 result = scsi_vpd_inquiry(sdev, buf, 0, buf_len); in scsi_get_vpd_page()
986 result = scsi_vpd_inquiry(sdev, buf, page, buf_len); in scsi_get_vpd_page()
1006 void scsi_attach_vpd(struct scsi_device *sdev) in scsi_attach_vpd() argument
1014 if (sdev->skip_vpd_pages) in scsi_attach_vpd()
1022 result = scsi_vpd_inquiry(sdev, vpd_buf, 0, vpd_len); in scsi_attach_vpd()
1048 result = scsi_vpd_inquiry(sdev, vpd_buf, 0x80, vpd_len); in scsi_attach_vpd()
1058 sdev->vpd_pg80_len = result; in scsi_attach_vpd()
1059 sdev->vpd_pg80 = vpd_buf; in scsi_attach_vpd()
1069 result = scsi_vpd_inquiry(sdev, vpd_buf, 0x83, vpd_len); in scsi_attach_vpd()
1079 sdev->vpd_pg83_len = result; in scsi_attach_vpd()
1080 sdev->vpd_pg83 = vpd_buf; in scsi_attach_vpd()
1095 int scsi_report_opcode(struct scsi_device *sdev, unsigned char *buffer, in scsi_report_opcode() argument
1102 if (sdev->no_report_opcodes || sdev->scsi_level < SCSI_SPC_3) in scsi_report_opcode()
1113 result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer, len, in scsi_report_opcode()
1136 int scsi_device_get(struct scsi_device *sdev) in scsi_device_get() argument
1138 if (sdev->sdev_state == SDEV_DEL) in scsi_device_get()
1140 if (!get_device(&sdev->sdev_gendev)) in scsi_device_get()
1144 try_module_get(sdev->host->hostt->module); in scsi_device_get()
1158 void scsi_device_put(struct scsi_device *sdev) in scsi_device_put() argument
1161 struct module *module = sdev->host->hostt->module; in scsi_device_put()
1168 put_device(&sdev->sdev_gendev); in scsi_device_put()
1211 struct scsi_device *sdev; in starget_for_each_device() local
1213 shost_for_each_device(sdev, shost) { in starget_for_each_device()
1214 if ((sdev->channel == starget->channel) && in starget_for_each_device()
1215 (sdev->id == starget->id)) in starget_for_each_device()
1216 fn(sdev, data); in starget_for_each_device()
1239 struct scsi_device *sdev; in __starget_for_each_device() local
1241 __shost_for_each_device(sdev, shost) { in __starget_for_each_device()
1242 if ((sdev->channel == starget->channel) && in __starget_for_each_device()
1243 (sdev->id == starget->id)) in __starget_for_each_device()
1244 fn(sdev, data); in __starget_for_each_device()
1267 struct scsi_device *sdev; in __scsi_device_lookup_by_target() local
1269 list_for_each_entry(sdev, &starget->devices, same_target_siblings) { in __scsi_device_lookup_by_target()
1270 if (sdev->sdev_state == SDEV_DEL) in __scsi_device_lookup_by_target()
1272 if (sdev->lun ==lun) in __scsi_device_lookup_by_target()
1273 return sdev; in __scsi_device_lookup_by_target()
1292 struct scsi_device *sdev; in scsi_device_lookup_by_target() local
1297 sdev = __scsi_device_lookup_by_target(starget, lun); in scsi_device_lookup_by_target()
1298 if (sdev && scsi_device_get(sdev)) in scsi_device_lookup_by_target()
1299 sdev = NULL; in scsi_device_lookup_by_target()
1302 return sdev; in scsi_device_lookup_by_target()
1325 struct scsi_device *sdev; in __scsi_device_lookup() local
1327 list_for_each_entry(sdev, &shost->__devices, siblings) { in __scsi_device_lookup()
1328 if (sdev->channel == channel && sdev->id == id && in __scsi_device_lookup()
1329 sdev->lun ==lun) in __scsi_device_lookup()
1330 return sdev; in __scsi_device_lookup()
1351 struct scsi_device *sdev; in scsi_device_lookup() local
1355 sdev = __scsi_device_lookup(shost, channel, id, lun); in scsi_device_lookup()
1356 if (sdev && scsi_device_get(sdev)) in scsi_device_lookup()
1357 sdev = NULL; in scsi_device_lookup()
1360 return sdev; in scsi_device_lookup()