Lines Matching refs:sdev
123 struct scsi_device *sdev = scmd->device; in scmd_eh_abort_handler() local
126 if (scsi_host_eh_past_deadline(sdev->host)) { in scmd_eh_abort_handler()
134 rtn = scsi_try_to_abort_cmd(sdev->host->hostt, scmd); in scmd_eh_abort_handler()
137 if (scsi_host_eh_past_deadline(sdev->host)) { in scmd_eh_abort_handler()
183 struct scsi_device *sdev = scmd->device; in scsi_abort_command() local
184 struct Scsi_Host *shost = sdev->host; in scsi_abort_command()
311 int scsi_block_when_processing_errors(struct scsi_device *sdev) in scsi_block_when_processing_errors() argument
315 wait_event(sdev->host->host_wait, !scsi_host_in_recovery(sdev->host)); in scsi_block_when_processing_errors()
317 online = scsi_device_online(sdev); in scsi_block_when_processing_errors()
319 SCSI_LOG_ERROR_RECOVERY(5, sdev_printk(KERN_INFO, sdev, in scsi_block_when_processing_errors()
336 struct scsi_device *sdev; in scsi_eh_prt_fail_stats() local
342 shost_for_each_device(sdev, shost) { in scsi_eh_prt_fail_stats()
344 if (scmd->device == sdev) { in scsi_eh_prt_fail_stats()
377 static void scsi_report_lun_change(struct scsi_device *sdev) in scsi_report_lun_change() argument
379 sdev->sdev_target->expecting_lun_change = 1; in scsi_report_lun_change()
388 static void scsi_report_sense(struct scsi_device *sdev, in scsi_report_sense() argument
396 sdev_printk(KERN_WARNING, sdev, in scsi_report_sense()
400 scsi_report_lun_change(sdev); in scsi_report_sense()
401 sdev_printk(KERN_WARNING, sdev, in scsi_report_sense()
407 sdev_printk(KERN_WARNING, sdev, in scsi_report_sense()
415 sdev_printk(KERN_WARNING, sdev, in scsi_report_sense()
423 sdev_printk(KERN_WARNING, sdev, in scsi_report_sense()
427 sdev_printk(KERN_WARNING, sdev, in scsi_report_sense()
431 sdev_printk(KERN_WARNING, sdev, in scsi_report_sense()
434 sdev_printk(KERN_WARNING, sdev, in scsi_report_sense()
439 set_bit(evt_type, sdev->pending_events); in scsi_report_sense()
440 schedule_work(&sdev->event_work); in scsi_report_sense()
457 struct scsi_device *sdev = scmd->device; in scsi_check_sense() local
463 scsi_report_sense(sdev, &sshdr); in scsi_check_sense()
468 if (sdev->handler && sdev->handler->check_sense) { in scsi_check_sense()
471 rc = sdev->handler->check_sense(sdev, &sshdr); in scsi_check_sense()
607 static void scsi_handle_queue_ramp_up(struct scsi_device *sdev) in scsi_handle_queue_ramp_up() argument
609 struct scsi_host_template *sht = sdev->host->hostt; in scsi_handle_queue_ramp_up()
613 sdev->queue_depth >= sdev->max_queue_depth) in scsi_handle_queue_ramp_up()
617 sdev->last_queue_ramp_up + sdev->queue_ramp_up_period)) in scsi_handle_queue_ramp_up()
621 sdev->last_queue_full_time + sdev->queue_ramp_up_period)) in scsi_handle_queue_ramp_up()
628 shost_for_each_device(tmp_sdev, sdev->host) { in scsi_handle_queue_ramp_up()
629 if (tmp_sdev->channel != sdev->channel || in scsi_handle_queue_ramp_up()
630 tmp_sdev->id != sdev->id || in scsi_handle_queue_ramp_up()
631 tmp_sdev->queue_depth == sdev->max_queue_depth) in scsi_handle_queue_ramp_up()
635 sdev->last_queue_ramp_up = jiffies; in scsi_handle_queue_ramp_up()
639 static void scsi_handle_queue_full(struct scsi_device *sdev) in scsi_handle_queue_full() argument
641 struct scsi_host_template *sht = sdev->host->hostt; in scsi_handle_queue_full()
647 shost_for_each_device(tmp_sdev, sdev->host) { in scsi_handle_queue_full()
648 if (tmp_sdev->channel != sdev->channel || in scsi_handle_queue_full()
649 tmp_sdev->id != sdev->id) in scsi_handle_queue_full()
806 static void __scsi_report_device_reset(struct scsi_device *sdev, void *data) in __scsi_report_device_reset() argument
808 sdev->was_reset = 1; in __scsi_report_device_reset()
809 sdev->expecting_cc_ua = 1; in __scsi_report_device_reset()
919 struct scsi_device *sdev = scmd->device; in scsi_eh_prep_cmnd() local
967 if (sdev->scsi_level <= SCSI_2 && sdev->scsi_level != SCSI_UNKNOWN) in scsi_eh_prep_cmnd()
969 (sdev->lun << 5 & 0xe0); in scsi_eh_prep_cmnd()
1019 struct scsi_device *sdev = scmd->device; in scsi_send_eh_cmnd() local
1020 struct Scsi_Host *shost = sdev->host; in scsi_send_eh_cmnd()
1272 struct scsi_device *sdev; in scsi_eh_test_devices() local
1277 sdev = scmd->device; in scsi_eh_test_devices()
1280 if (scsi_host_eh_past_deadline(sdev->host)) { in scsi_eh_test_devices()
1284 sdev_printk(KERN_INFO, sdev, in scsi_eh_test_devices()
1297 if (scmd->device == sdev) { in scsi_eh_test_devices()
1403 struct scsi_device *sdev; in scsi_eh_stu() local
1405 shost_for_each_device(sdev, shost) { in scsi_eh_stu()
1408 sdev_printk(KERN_INFO, sdev, in scsi_eh_stu()
1415 if (scmd->device == sdev && SCSI_SENSE_VALID(scmd) && in scsi_eh_stu()
1425 sdev_printk(KERN_INFO, sdev, in scsi_eh_stu()
1430 if (!scsi_device_online(sdev) || in scsi_eh_stu()
1434 if (scmd->device == sdev && in scsi_eh_stu()
1441 sdev_printk(KERN_INFO, sdev, in scsi_eh_stu()
1468 struct scsi_device *sdev; in scsi_eh_bus_device_reset() local
1471 shost_for_each_device(sdev, shost) { in scsi_eh_bus_device_reset()
1474 sdev_printk(KERN_INFO, sdev, in scsi_eh_bus_device_reset()
1481 if (scmd->device == sdev) { in scsi_eh_bus_device_reset()
1490 sdev_printk(KERN_INFO, sdev, in scsi_eh_bus_device_reset()
1494 if (!scsi_device_online(sdev) || in scsi_eh_bus_device_reset()
1499 if (scmd->device == sdev && in scsi_eh_bus_device_reset()
1507 sdev_printk(KERN_INFO, sdev, in scsi_eh_bus_device_reset()
1968 static void scsi_eh_lock_door(struct scsi_device *sdev) in scsi_eh_lock_door() argument
1976 req = blk_get_request(sdev->request_queue, READ, GFP_KERNEL); in scsi_eh_lock_door()
2008 struct scsi_device *sdev; in scsi_restart_operations() local
2016 shost_for_each_device(sdev, shost) { in scsi_restart_operations()
2017 if (scsi_device_online(sdev) && sdev->was_reset && sdev->locked) { in scsi_restart_operations()
2018 scsi_eh_lock_door(sdev); in scsi_restart_operations()
2019 sdev->was_reset = 0; in scsi_restart_operations()
2276 struct scsi_device *sdev; in scsi_report_bus_reset() local
2278 __shost_for_each_device(sdev, shost) { in scsi_report_bus_reset()
2279 if (channel == sdev_channel(sdev)) in scsi_report_bus_reset()
2280 __scsi_report_device_reset(sdev, NULL); in scsi_report_bus_reset()
2309 struct scsi_device *sdev; in scsi_report_device_reset() local
2311 __shost_for_each_device(sdev, shost) { in scsi_report_device_reset()
2312 if (channel == sdev_channel(sdev) && in scsi_report_device_reset()
2313 target == sdev_id(sdev)) in scsi_report_device_reset()
2314 __scsi_report_device_reset(sdev, NULL); in scsi_report_device_reset()