[libata] improve device scan even more
commit3f19ee8cb3a1003cb5183696bc55934f5865f868
authorJeff Garzik <jgarzik@pobox.com>
Tue, 4 Oct 2005 01:36:41 +0000 (3 21:36 -0400)
committerJeff Garzik <jgarzik@pobox.com>
Tue, 4 Oct 2005 01:36:41 +0000 (3 21:36 -0400)
tree106eda632143805fcc4fccef4d601c4d5d579bd7
parent644dd0cc494702ecd0698f467de113ace9593888
[libata] improve device scan even more

Since our max_lun is unconditionally set to 1, we might as well
hardcode a LUN 0 probe, rather than a wildcard LUN scan.

The ide-scsi driver sets max_lun to a value greater than under
certain conditions:

        if ((drive->id->last_lun & 0x7) != 7)
                host->max_lun = (drive->id->last_lun & 0x7) + 1;
        else
                host->max_lun = 1;

last_lun is Word 126 of IDENTIFY PACKET DEVICE, marked as obsolete
and undocumented in non-ancient specs.  We'll leave it out for now.
Should the need arise to support multi-LUN ATAPI devices, we'll
probably want to add the above code.

Finally, there have been reports of REPORT LUNS commands locking up
ATAPI drives.  Eliminating the wildcard LUN scan could help reduce
the trouble from problematic drives.
drivers/scsi/libata-scsi.c