summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-04-11 22:22:29 +0900
committerJeff Garzik <jeff@garzik.org>2006-04-11 13:19:11 -0400
commit643be977f9feba8c3c1e768fc06cac84596ec6f8 (patch)
treef7c7b23e60cc726ba8874411956d15f3bfd7c9c4
parent1c1d832cea1ab851a3f9b9d83245f5bc8b5b04b6 (diff)
downloadop-kernel-dev-643be977f9feba8c3c1e768fc06cac84596ec6f8.zip
op-kernel-dev-643be977f9feba8c3c1e768fc06cac84596ec6f8.tar.gz
[PATCH] sata_sil24: better error message from softreset
Improve softreset error message. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r--drivers/scsi/sata_sil24.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c
index 24eed37a..d6cfd8e 100644
--- a/drivers/scsi/sata_sil24.c
+++ b/drivers/scsi/sata_sil24.c
@@ -434,6 +434,7 @@ static int sil24_softreset(struct ata_port *ap, unsigned int *class)
dma_addr_t paddr = pp->cmd_block_dma;
unsigned long timeout = jiffies + ATA_TMOUT_BOOT;
u32 irq_enable, irq_stat;
+ const char *reason;
DPRINTK("ENTER\n");
@@ -473,8 +474,11 @@ static int sil24_softreset(struct ata_port *ap, unsigned int *class)
writel(irq_enable, port + PORT_IRQ_ENABLE_SET);
if (!(irq_stat & PORT_IRQ_COMPLETE)) {
- printk(KERN_ERR "ata%u: softreset failed (timeout)\n", ap->id);
- return -EIO;
+ if (irq_stat & PORT_IRQ_ERROR)
+ reason = "SRST command error";
+ else
+ reason = "timeout";
+ goto err;
}
sil24_update_tf(ap);
@@ -486,6 +490,10 @@ static int sil24_softreset(struct ata_port *ap, unsigned int *class)
out:
DPRINTK("EXIT, class=%u\n", *class);
return 0;
+
+ err:
+ printk(KERN_ERR "ata%u: softreset failed (%s)\n", ap->id, reason);
+ return -EIO;
}
static int sil24_hardreset(struct ata_port *ap, unsigned int *class)
OpenPOWER on IntegriCloud