diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-03 21:36:41 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-03 21:36:41 -0400 |
commit | 3f19ee8cb3a1003cb5183696bc55934f5865f868 (patch) | |
tree | 106eda632143805fcc4fccef4d601c4d5d579bd7 | |
parent | 644dd0cc494702ecd0698f467de113ace9593888 (diff) |
[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.
-rw-r--r-- | drivers/scsi/libata-scsi.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c index 4fc0134d4272..8295a656e521 100644 --- a/drivers/scsi/libata-scsi.c +++ b/drivers/scsi/libata-scsi.c | |||
@@ -1680,13 +1680,17 @@ void ata_scsi_simulate(u16 *id, | |||
1680 | 1680 | ||
1681 | void ata_scsi_scan_host(struct ata_port *ap) | 1681 | void ata_scsi_scan_host(struct ata_port *ap) |
1682 | { | 1682 | { |
1683 | struct ata_device *dev; | ||
1683 | unsigned int i; | 1684 | unsigned int i; |
1684 | 1685 | ||
1685 | if (ap->flags & ATA_FLAG_PORT_DISABLED) | 1686 | if (ap->flags & ATA_FLAG_PORT_DISABLED) |
1686 | return; | 1687 | return; |
1687 | 1688 | ||
1688 | for (i = 0; i < ATA_MAX_DEVICES; i++) | 1689 | for (i = 0; i < ATA_MAX_DEVICES; i++) { |
1689 | if (ata_dev_present(&ap->device[i])) | 1690 | dev = &ap->device[i]; |
1690 | scsi_scan_target(&ap->host->shost_gendev, 0, i, ~0, 0); | 1691 | |
1692 | if (ata_dev_present(dev)) | ||
1693 | scsi_scan_target(&ap->host->shost_gendev, 0, i, 0, 0); | ||
1694 | } | ||
1691 | } | 1695 | } |
1692 | 1696 | ||