All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: jgarzik@pobox.com, alan@lxorguk.ukuu.org.uk, axboe@suse.de,
	albertcc@tw.ibm.com, lkosewsk@gmail.com,
	linux-ide@vger.kernel.org
Cc: Tejun Heo <htejun@gmail.com>
Subject: [PATCH 2/5] sata_sil24: better error message from softreset
Date: Tue, 11 Apr 2006 22:22:29 +0900	[thread overview]
Message-ID: <11447617493747-git-send-email-htejun@gmail.com> (raw)
In-Reply-To: <11447617493149-git-send-email-htejun@gmail.com>

Improve softreset error message.

Signed-off-by: Tejun Heo <htejun@gmail.com>

---

 drivers/scsi/sata_sil24.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

acf5b3fda42c68a0f4a84131e50f8514faebee94
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c
index 512ee6f..c75c228 100644
--- a/drivers/scsi/sata_sil24.c
+++ b/drivers/scsi/sata_sil24.c
@@ -435,6 +435,7 @@ static int sil24_softreset(struct ata_po
 	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");
 
@@ -474,8 +475,11 @@ static int sil24_softreset(struct ata_po
 	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);
@@ -487,6 +491,10 @@ static int sil24_softreset(struct ata_po
  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)
-- 
1.2.4



  parent reply	other threads:[~2006-04-11 13:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-11 13:22 [PATCHSET 2/9] implement and use ata_wait_register (repost) Tejun Heo
2006-04-11 13:22 ` [PATCH 1/5] sata_sil24: fix timeout calculation in sil24_softreset Tejun Heo
2006-04-11 17:19   ` Jeff Garzik
2006-04-11 13:22 ` [PATCH 4/5] ahci: use ata_wait_register() Tejun Heo
2006-04-11 13:22 ` [PATCH 3/5] libata: implement ata_wait_register() Tejun Heo
2006-04-11 13:22 ` Tejun Heo [this message]
2006-04-11 13:22 ` [PATCH 5/5] sata_sil24: use ata_wait_register() Tejun Heo
  -- strict thread matches above, loose matches on Subject: below --
2006-04-07  8:02 [PATCHSET] libata: implement and " Tejun Heo
2006-04-07  8:02 ` [PATCH 2/5] sata_sil24: better error message from softreset Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11447617493747-git-send-email-htejun@gmail.com \
    --to=htejun@gmail.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=albertcc@tw.ibm.com \
    --cc=axboe@suse.de \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=lkosewsk@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.