aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi_scan.c')
-rw-r--r--drivers/scsi/scsi_scan.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 6963d529e0f0..18486b51668d 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -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;
@@ -582,7 +584,7 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result,
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,
585 NULL); 587 &resid);
586 588
587 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 "
588 "with code 0x%x\n", 590 "with code 0x%x\n",
@@ -603,6 +605,14 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result,
603 (sshdr.ascq == 0)) 605 (sshdr.ascq == 0))
604 continue; 606 continue;
605 } 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;
606 } 616 }
607 break; 617 break;
608 } 618 }