diff options
Diffstat (limited to 'drivers/scsi/scsi_scan.c')
-rw-r--r-- | drivers/scsi/scsi_scan.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index b14dc02c3ded..18486b51668d 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c | |||
@@ -216,7 +216,7 @@ static void scsi_unlock_floptical(struct scsi_device *sdev, | |||
216 | scsi_cmd[4] = 0x2a; /* size */ | 216 | scsi_cmd[4] = 0x2a; /* size */ |
217 | scsi_cmd[5] = 0; | 217 | scsi_cmd[5] = 0; |
218 | scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE, result, 0x2a, NULL, | 218 | scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE, result, 0x2a, NULL, |
219 | SCSI_TIMEOUT, 3); | 219 | SCSI_TIMEOUT, 3, NULL); |
220 | } | 220 | } |
221 | 221 | ||
222 | /** | 222 | /** |
@@ -573,6 +573,8 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result, | |||
573 | 573 | ||
574 | /* Each pass gets up to three chances to ignore Unit Attention */ | 574 | /* Each pass gets up to three chances to ignore Unit Attention */ |
575 | for (count = 0; count < 3; ++count) { | 575 | for (count = 0; count < 3; ++count) { |
576 | int resid; | ||
577 | |||
576 | memset(scsi_cmd, 0, 6); | 578 | memset(scsi_cmd, 0, 6); |
577 | scsi_cmd[0] = INQUIRY; | 579 | scsi_cmd[0] = INQUIRY; |
578 | scsi_cmd[4] = (unsigned char) try_inquiry_len; | 580 | scsi_cmd[4] = (unsigned char) try_inquiry_len; |
@@ -581,7 +583,8 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result, | |||
581 | 583 | ||
582 | result = scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE, | 584 | result = scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE, |
583 | inq_result, try_inquiry_len, &sshdr, | 585 | inq_result, try_inquiry_len, &sshdr, |
584 | HZ / 2 + HZ * scsi_inq_timeout, 3); | 586 | HZ / 2 + HZ * scsi_inq_timeout, 3, |
587 | &resid); | ||
585 | 588 | ||
586 | SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO "scsi scan: INQUIRY %s " | 589 | SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO "scsi scan: INQUIRY %s " |
587 | "with code 0x%x\n", | 590 | "with code 0x%x\n", |
@@ -602,6 +605,14 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result, | |||
602 | (sshdr.ascq == 0)) | 605 | (sshdr.ascq == 0)) |
603 | continue; | 606 | continue; |
604 | } | 607 | } |
608 | } else { | ||
609 | /* | ||
610 | * if nothing was transferred, we try | ||
611 | * again. It's a workaround for some USB | ||
612 | * devices. | ||
613 | */ | ||
614 | if (resid == try_inquiry_len) | ||
615 | continue; | ||
605 | } | 616 | } |
606 | break; | 617 | break; |
607 | } | 618 | } |
@@ -1390,7 +1401,7 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags, | |||
1390 | 1401 | ||
1391 | result = scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE, | 1402 | result = scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE, |
1392 | lun_data, length, &sshdr, | 1403 | lun_data, length, &sshdr, |
1393 | SCSI_TIMEOUT + 4 * HZ, 3); | 1404 | SCSI_TIMEOUT + 4 * HZ, 3, NULL); |
1394 | 1405 | ||
1395 | SCSI_LOG_SCAN_BUS(3, printk (KERN_INFO "scsi scan: REPORT LUNS" | 1406 | SCSI_LOG_SCAN_BUS(3, printk (KERN_INFO "scsi scan: REPORT LUNS" |
1396 | " %s (try %d) result 0x%x\n", result | 1407 | " %s (try %d) result 0x%x\n", result |