aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r--drivers/scsi/libata-core.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 1efe8a1ba81d..19ae3fa1cfcb 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -2585,7 +2585,7 @@ int ata_std_probe_reset(struct ata_port *ap, unsigned int *classes)
2585} 2585}
2586 2586
2587int ata_do_reset(struct ata_port *ap, ata_reset_fn_t reset, 2587int ata_do_reset(struct ata_port *ap, ata_reset_fn_t reset,
2588 ata_postreset_fn_t postreset, unsigned int *classes) 2588 unsigned int *classes)
2589{ 2589{
2590 int i, rc; 2590 int i, rc;
2591 2591
@@ -2609,9 +2609,6 @@ int ata_do_reset(struct ata_port *ap, ata_reset_fn_t reset,
2609 if (classes[i] == ATA_DEV_UNKNOWN) 2609 if (classes[i] == ATA_DEV_UNKNOWN)
2610 classes[i] = ATA_DEV_NONE; 2610 classes[i] = ATA_DEV_NONE;
2611 2611
2612 if (postreset)
2613 postreset(ap, classes);
2614
2615 return 0; 2612 return 0;
2616} 2613}
2617 2614
@@ -2655,7 +2652,7 @@ int ata_drive_probe_reset(struct ata_port *ap, ata_probeinit_fn_t probeinit,
2655 probeinit(ap); 2652 probeinit(ap);
2656 2653
2657 if (softreset && !sata_set_spd_needed(ap)) { 2654 if (softreset && !sata_set_spd_needed(ap)) {
2658 rc = ata_do_reset(ap, softreset, postreset, classes); 2655 rc = ata_do_reset(ap, softreset, classes);
2659 if (rc == 0 && classes[0] != ATA_DEV_UNKNOWN) 2656 if (rc == 0 && classes[0] != ATA_DEV_UNKNOWN)
2660 goto done; 2657 goto done;
2661 printk(KERN_INFO "ata%u: softreset failed, will try " 2658 printk(KERN_INFO "ata%u: softreset failed, will try "
@@ -2667,7 +2664,7 @@ int ata_drive_probe_reset(struct ata_port *ap, ata_probeinit_fn_t probeinit,
2667 goto done; 2664 goto done;
2668 2665
2669 while (1) { 2666 while (1) {
2670 rc = ata_do_reset(ap, hardreset, postreset, classes); 2667 rc = ata_do_reset(ap, hardreset, classes);
2671 if (rc == 0) { 2668 if (rc == 0) {
2672 if (classes[0] != ATA_DEV_UNKNOWN) 2669 if (classes[0] != ATA_DEV_UNKNOWN)
2673 goto done; 2670 goto done;
@@ -2688,12 +2685,16 @@ int ata_drive_probe_reset(struct ata_port *ap, ata_probeinit_fn_t probeinit,
2688 ap->id); 2685 ap->id);
2689 ssleep(5); 2686 ssleep(5);
2690 2687
2691 rc = ata_do_reset(ap, softreset, postreset, classes); 2688 rc = ata_do_reset(ap, softreset, classes);
2692 } 2689 }
2693 2690
2694 done: 2691 done:
2695 if (rc == 0 && classes[0] == ATA_DEV_UNKNOWN) 2692 if (rc == 0) {
2696 rc = -ENODEV; 2693 if (postreset)
2694 postreset(ap, classes);
2695 if (classes[0] == ATA_DEV_UNKNOWN)
2696 rc = -ENODEV;
2697 }
2697 return rc; 2698 return rc;
2698} 2699}
2699 2700