Lines Matching refs:sdev
121 struct scsi_device *sdev = scmd->device; in scmd_eh_abort_handler() local
124 if (scsi_host_eh_past_deadline(sdev->host)) { in scmd_eh_abort_handler()
132 rtn = scsi_try_to_abort_cmd(sdev->host->hostt, scmd); in scmd_eh_abort_handler()
135 if (scsi_host_eh_past_deadline(sdev->host)) { in scmd_eh_abort_handler()
181 struct scsi_device *sdev = scmd->device; in scsi_abort_command() local
182 struct Scsi_Host *shost = sdev->host; in scsi_abort_command()
309 int scsi_block_when_processing_errors(struct scsi_device *sdev) in scsi_block_when_processing_errors() argument
313 wait_event(sdev->host->host_wait, !scsi_host_in_recovery(sdev->host)); in scsi_block_when_processing_errors()
315 online = scsi_device_online(sdev); in scsi_block_when_processing_errors()
317 SCSI_LOG_ERROR_RECOVERY(5, sdev_printk(KERN_INFO, sdev, in scsi_block_when_processing_errors()
334 struct scsi_device *sdev; in scsi_eh_prt_fail_stats() local
340 shost_for_each_device(sdev, shost) { in scsi_eh_prt_fail_stats()
342 if (scmd->device == sdev) { in scsi_eh_prt_fail_stats()
375 static void scsi_report_lun_change(struct scsi_device *sdev) in scsi_report_lun_change() argument
377 sdev->sdev_target->expecting_lun_change = 1; in scsi_report_lun_change()
386 static void scsi_report_sense(struct scsi_device *sdev, in scsi_report_sense() argument
394 sdev_printk(KERN_WARNING, sdev, in scsi_report_sense()
398 scsi_report_lun_change(sdev); in scsi_report_sense()
399 sdev_printk(KERN_WARNING, sdev, in scsi_report_sense()
405 sdev_printk(KERN_WARNING, sdev, in scsi_report_sense()
413 sdev_printk(KERN_WARNING, sdev, in scsi_report_sense()
421 sdev_printk(KERN_WARNING, sdev, in scsi_report_sense()
425 sdev_printk(KERN_WARNING, sdev, in scsi_report_sense()
428 sdev_printk(KERN_WARNING, sdev, in scsi_report_sense()
433 set_bit(evt_type, sdev->pending_events); in scsi_report_sense()
434 schedule_work(&sdev->event_work); in scsi_report_sense()
451 struct scsi_device *sdev = scmd->device; in scsi_check_sense() local
457 scsi_report_sense(sdev, &sshdr); in scsi_check_sense()
462 if (sdev->scsi_dh_data && sdev->scsi_dh_data->scsi_dh && in scsi_check_sense()
463 sdev->scsi_dh_data->scsi_dh->check_sense) { in scsi_check_sense()
466 rc = sdev->scsi_dh_data->scsi_dh->check_sense(sdev, &sshdr); in scsi_check_sense()
601 static void scsi_handle_queue_ramp_up(struct scsi_device *sdev) in scsi_handle_queue_ramp_up() argument
603 struct scsi_host_template *sht = sdev->host->hostt; in scsi_handle_queue_ramp_up()
607 sdev->queue_depth >= sdev->max_queue_depth) in scsi_handle_queue_ramp_up()
611 sdev->last_queue_ramp_up + sdev->queue_ramp_up_period)) in scsi_handle_queue_ramp_up()
615 sdev->last_queue_full_time + sdev->queue_ramp_up_period)) in scsi_handle_queue_ramp_up()
622 shost_for_each_device(tmp_sdev, sdev->host) { in scsi_handle_queue_ramp_up()
623 if (tmp_sdev->channel != sdev->channel || in scsi_handle_queue_ramp_up()
624 tmp_sdev->id != sdev->id || in scsi_handle_queue_ramp_up()
625 tmp_sdev->queue_depth == sdev->max_queue_depth) in scsi_handle_queue_ramp_up()
629 sdev->last_queue_ramp_up = jiffies; in scsi_handle_queue_ramp_up()
633 static void scsi_handle_queue_full(struct scsi_device *sdev) in scsi_handle_queue_full() argument
635 struct scsi_host_template *sht = sdev->host->hostt; in scsi_handle_queue_full()
641 shost_for_each_device(tmp_sdev, sdev->host) { in scsi_handle_queue_full()
642 if (tmp_sdev->channel != sdev->channel || in scsi_handle_queue_full()
643 tmp_sdev->id != sdev->id) in scsi_handle_queue_full()
800 static void __scsi_report_device_reset(struct scsi_device *sdev, void *data) in __scsi_report_device_reset() argument
802 sdev->was_reset = 1; in __scsi_report_device_reset()
803 sdev->expecting_cc_ua = 1; in __scsi_report_device_reset()
913 struct scsi_device *sdev = scmd->device; in scsi_eh_prep_cmnd() local
961 if (sdev->scsi_level <= SCSI_2 && sdev->scsi_level != SCSI_UNKNOWN) in scsi_eh_prep_cmnd()
963 (sdev->lun << 5 & 0xe0); in scsi_eh_prep_cmnd()
1013 struct scsi_device *sdev = scmd->device; in scsi_send_eh_cmnd() local
1014 struct Scsi_Host *shost = sdev->host; in scsi_send_eh_cmnd()
1262 struct scsi_device *sdev; in scsi_eh_test_devices() local
1267 sdev = scmd->device; in scsi_eh_test_devices()
1270 if (scsi_host_eh_past_deadline(sdev->host)) { in scsi_eh_test_devices()
1274 sdev_printk(KERN_INFO, sdev, in scsi_eh_test_devices()
1287 if (scmd->device == sdev) { in scsi_eh_test_devices()
1393 struct scsi_device *sdev; in scsi_eh_stu() local
1395 shost_for_each_device(sdev, shost) { in scsi_eh_stu()
1398 sdev_printk(KERN_INFO, sdev, in scsi_eh_stu()
1405 if (scmd->device == sdev && SCSI_SENSE_VALID(scmd) && in scsi_eh_stu()
1415 sdev_printk(KERN_INFO, sdev, in scsi_eh_stu()
1420 if (!scsi_device_online(sdev) || in scsi_eh_stu()
1424 if (scmd->device == sdev && in scsi_eh_stu()
1431 sdev_printk(KERN_INFO, sdev, in scsi_eh_stu()
1458 struct scsi_device *sdev; in scsi_eh_bus_device_reset() local
1461 shost_for_each_device(sdev, shost) { in scsi_eh_bus_device_reset()
1464 sdev_printk(KERN_INFO, sdev, in scsi_eh_bus_device_reset()
1471 if (scmd->device == sdev) { in scsi_eh_bus_device_reset()
1480 sdev_printk(KERN_INFO, sdev, in scsi_eh_bus_device_reset()
1484 if (!scsi_device_online(sdev) || in scsi_eh_bus_device_reset()
1489 if (scmd->device == sdev && in scsi_eh_bus_device_reset()
1497 sdev_printk(KERN_INFO, sdev, in scsi_eh_bus_device_reset()
1958 static void scsi_eh_lock_door(struct scsi_device *sdev) in scsi_eh_lock_door() argument
1966 req = blk_get_request(sdev->request_queue, READ, GFP_KERNEL); in scsi_eh_lock_door()
1998 struct scsi_device *sdev; in scsi_restart_operations() local
2006 shost_for_each_device(sdev, shost) { in scsi_restart_operations()
2007 if (scsi_device_online(sdev) && sdev->was_reset && sdev->locked) { in scsi_restart_operations()
2008 scsi_eh_lock_door(sdev); in scsi_restart_operations()
2009 sdev->was_reset = 0; in scsi_restart_operations()
2263 struct scsi_device *sdev; in scsi_report_bus_reset() local
2265 __shost_for_each_device(sdev, shost) { in scsi_report_bus_reset()
2266 if (channel == sdev_channel(sdev)) in scsi_report_bus_reset()
2267 __scsi_report_device_reset(sdev, NULL); in scsi_report_bus_reset()
2296 struct scsi_device *sdev; in scsi_report_device_reset() local
2298 __shost_for_each_device(sdev, shost) { in scsi_report_device_reset()
2299 if (channel == sdev_channel(sdev) && in scsi_report_device_reset()
2300 target == sdev_id(sdev)) in scsi_report_device_reset()
2301 __scsi_report_device_reset(sdev, NULL); in scsi_report_device_reset()