Name

scsi_internal_device_block — try to transition to the SDEV_BLOCK state

Synopsis

int scsi_internal_device_block (struct scsi_device * sdev,
 bool wait);
 

Arguments

sdev

device to block

wait

Whether or not to wait until ongoing .queuecommand / .queue_rq calls have finished.

Description

Pause SCSI command processing on the specified device and wait until all ongoing scsi_request_fn / scsi_queue_rq calls have finished. May sleep.

Returns zero if successful or a negative error code upon failure.

Note

This routine transitions the device to the SDEV_BLOCK state (which must be a legal transition). When the device is in this state, command processing is paused until the device leaves the SDEV_BLOCK state. See also scsi_internal_device_unblock.

To do

avoid that scsi_send_eh_cmnd calls queuecommand after scsi_internal_device_block has blocked a SCSI device and also remove the rport mutex lock and unlock calls from srp_queuecommand.