diff options
Diffstat (limited to 'drivers/scsi/sata_sil24.c')
-rw-r--r-- | drivers/scsi/sata_sil24.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c index 8fb62427be84..fa1a5ac60639 100644 --- a/drivers/scsi/sata_sil24.c +++ b/drivers/scsi/sata_sil24.c | |||
@@ -440,6 +440,12 @@ static int sil24_softreset(struct ata_port *ap, int verbose, | |||
440 | 440 | ||
441 | DPRINTK("ENTER\n"); | 441 | DPRINTK("ENTER\n"); |
442 | 442 | ||
443 | if (!sata_dev_present(ap)) { | ||
444 | DPRINTK("PHY reports no device\n"); | ||
445 | *class = ATA_DEV_NONE; | ||
446 | goto out; | ||
447 | } | ||
448 | |||
443 | /* temporarily turn off IRQs during SRST */ | 449 | /* temporarily turn off IRQs during SRST */ |
444 | irq_enable = readl(port + PORT_IRQ_ENABLE_SET); | 450 | irq_enable = readl(port + PORT_IRQ_ENABLE_SET); |
445 | writel(irq_enable, port + PORT_IRQ_ENABLE_CLR); | 451 | writel(irq_enable, port + PORT_IRQ_ENABLE_CLR); |
@@ -469,18 +475,18 @@ static int sil24_softreset(struct ata_port *ap, int verbose, | |||
469 | /* restore IRQs */ | 475 | /* restore IRQs */ |
470 | writel(irq_enable, port + PORT_IRQ_ENABLE_SET); | 476 | writel(irq_enable, port + PORT_IRQ_ENABLE_SET); |
471 | 477 | ||
472 | if (sata_dev_present(ap)) { | 478 | if (!(irq_stat & PORT_IRQ_COMPLETE)) { |
473 | if (!(irq_stat & PORT_IRQ_COMPLETE)) { | 479 | DPRINTK("EXIT, srst failed\n"); |
474 | DPRINTK("EXIT, srst failed\n"); | 480 | return -EIO; |
475 | return -EIO; | ||
476 | } | ||
477 | |||
478 | sil24_update_tf(ap); | ||
479 | *class = ata_dev_classify(&pp->tf); | ||
480 | } | 481 | } |
482 | |||
483 | sil24_update_tf(ap); | ||
484 | *class = ata_dev_classify(&pp->tf); | ||
485 | |||
481 | if (*class == ATA_DEV_UNKNOWN) | 486 | if (*class == ATA_DEV_UNKNOWN) |
482 | *class = ATA_DEV_NONE; | 487 | *class = ATA_DEV_NONE; |
483 | 488 | ||
489 | out: | ||
484 | DPRINTK("EXIT, class=%u\n", *class); | 490 | DPRINTK("EXIT, class=%u\n", *class); |
485 | return 0; | 491 | return 0; |
486 | } | 492 | } |