Further to the thread titled: "[PATCH] SG_SCSI_RESET ioctl should only perform requested operation" by Jeremy Linton a patch (v2) is presented that adds "no_escalate" versions to the existing ioctl. This requires no changes to SCSI low level drivers (LLDs); it adds several more finely tuned reset options to the user space. For example: /* This call remains the same, with the same escalating semantics * if the device (LU) reset fail. That is: on failure to try a * target reset and if that fails, try a bus reset, and if that fails * try a host (i.e. LLD) reset. */ val = SG_SCSI_RESET_DEVICE; res = ioctl(sg_or_block_fd, SG_SCSI_RESET, &val); /* What follows is a new option introduced by this patch. Only a * device reset is attempted. If that fails then an appropriate * error code is provided. N.B. There is no reset escalation. */ val = SG_SCSI_RESET_DEVICE + SG_SCSI_RESET_NO_ESCALATE; res = ioctl(sg_or_block_fd, SG_SCSI_RESET, &val); This patches applies to lk 3.7.8 and lk 3.8.0-rc7 . I will extend sg_reset in the sg3_utils package to use it. Note the bsg driver does not support the SG_SCSI_RESET ioctl and that continues to be the case. v2 of this patch modifies the SG_SCSI_RESET ioctl in scsi_ioctl.c so block device nodes (e.g. /dev/sdb) have this additional functionality. ChangeLog: - modify SG_SCSI_RESET ioctl so the SG_SCSI_RESET_NO_ESCALATE value may be added to the existing values. If so the existing device->target->bus->host escalation does not occur. The SG_SCSI_RESET ioctl is modified in both the sg driver and scsi_ioctl.c (so block devices can use it). - modify scsi_reset_provider() in the scsi_error.c file in a similar way to support this additional functionality. Signed-off-by: Douglas Gilbert