On Thu, Jun 05, 2014 at 09:26:42AM +0200, Hannes Reinecke wrote: > REPORT_LUN_SCAN does not report any outstanding unit attention > condition as per SAM. However, the target might not be fully > initialized at that time, so we might end up getting a > default entry (or even a partially filled one). > But as we're not able to process the REPORT LUN DATA HAS CHANGED > unit attention correctly we'll be missing out some LUNs during > startup. > So it's better to send a TEST UNIT READY for modern implementations > and wait until the unit attention condition goes away. > > Signed-off-by: Hannes Reinecke <hare@xxxxxxx> > --- > drivers/scsi/scsi_scan.c | 86 ++++++++++++++++++++++++++++++++++++++++-------- > 1 file changed, 73 insertions(+), 13 deletions(-) > > diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c > index e02b3aa..a8e59c3 100644 > --- a/drivers/scsi/scsi_scan.c > +++ b/drivers/scsi/scsi_scan.c > @@ -123,6 +123,13 @@ MODULE_PARM_DESC(inq_timeout, > "Timeout (in seconds) waiting for devices to answer INQUIRY." > " Default is 20. Some devices may need more; most need less."); > > +static unsigned int scsi_scan_timeout = SCSI_TIMEOUT/HZ + 58; > + > +module_param_named(scan_timeout, scsi_scan_timeout, uint, S_IRUGO|S_IWUSR); > +MODULE_PARM_DESC(scan_timeout, > + "Timeout (in seconds) waiting for devices to become ready" > + " after INQUIRY. Default is 60."); Should this be called tur_timeout, similar to the inq_timeout parameter? Otherwise looks good to me, Reviewed-by: Christoph Hellwig <hch@xxxxxx> -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html