Add comment explaining the reason for retrying capacity reads.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26083 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2008-06-22 18:32:02 +00:00
parent 27b95d52b8
commit 6cf7524447

View File

@ -426,6 +426,12 @@ usb_disk_update_capacity(device_lun *lun)
uint32 dataLength = sizeof(scsi_read_capacity_10_parameter);
scsi_read_capacity_10_parameter parameter;
status_t result = B_ERROR;
// Retry reading the capacity up to three times. The first try might only
// yield a unit attention telling us that the device or media status
// changed, which is more or less expected if it is the first operation
// on the device or the device only clears the unit atention for capacity
// reads.
for (int32 i = 0; i < 3; i++) {
result = usb_disk_operation(lun, SCSI_READ_CAPACITY_10, 10, 0, 0,
&parameter, &dataLength, true);