• Douglas Gilbert's avatar
    scsi: scsi_debug: Implement tur_ms_to_ready parameter · fc13638a
    Douglas Gilbert authored
    The current driver responds to TEST UNIT READY (TUR) with a GOOD status
    immediately after a scsi_debug device (LU) is created. This is unrealistic
    as even SSDs take some time after power-on before accepting media access
    commands.
    
    Add the tur_ms_to_ready parameter whose unit is milliseconds (default 0)
    and is the period before which a TUR (or any media access command) will set
    the CHECK CONDITION status with a sense key of NOT READY and an additional
    sense of "Logical unit is in process of becoming ready".  The period starts
    when each scsi_debug device is created.
    
    This patch was prompted by T10 proposal 20-061r2 which was accepted on
    2020716. It adds that a TUR in the situation described in the previous
    paragraph may set the INFO field (or descriptor) in the sense data to the
    estimated number in milliseconds before a subsequent TUR will yield a GOOD
    status. This patch follows that advice.
    
    Link: https://lore.kernel.org/r/20200724155531.668144-1-dgilbert@interlog.comReported-by: default avatarkernel test robot <lkp@intel.com>
    Signed-off-by: default avatarDouglas Gilbert <dgilbert@interlog.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    fc13638a
scsi_debug.c 216 KB