linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: jgarzik@pobox.com, alan@lxorguk.ukuu.org.uk, albertcc@tw.ibm.com,
	linux-ide@vger.kernel.org
Cc: Tejun Heo <htejun@gmail.com>
Subject: [PATCH 4/7] libata: add 5s sleep between resets
Date: Sun, 2 Apr 2006 17:54:46 +0900	[thread overview]
Message-ID: <11439680861847-git-send-email-htejun@gmail.com> (raw)
In-Reply-To: <11439680863256-git-send-email-htejun@gmail.com>

Some devices react badly if resets are performed back-to-back.  Give
devices some time to breath and tell user that we're taking a nap.

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

---

 drivers/scsi/libata-core.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

648928e9d46f4d2d8426d83614c101c4a41d789e
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index f8ee314..dfa2b36 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -2577,6 +2577,9 @@ int ata_drive_probe_reset(struct ata_por
 		rc = ata_do_reset(ap, softreset, postreset, 0, classes);
 		if (rc == 0 && classes[0] != ATA_DEV_UNKNOWN)
 			goto done;
+		printk(KERN_INFO "ata%u: softreset failed, will try "
+		       "hardreset in 5 secs\n", ap->id);
+		ssleep(5);
 	}
 
 	if (!hardreset)
@@ -2592,10 +2595,20 @@ int ata_drive_probe_reset(struct ata_por
 
 		if (ata_down_sata_spd_limit(ap))
 			goto done;
+
+		printk(KERN_INFO "ata%u: hardreset failed, will retry "
+		       "in 5 secs\n", ap->id);
+		ssleep(5);
 	}
 
-	if (softreset)
+	if (softreset) {
+		printk(KERN_INFO "ata%u: hardreset succeeded without "
+		       "classification, will retry softreset in 5 secs",
+		       ap->id);
+		ssleep(5);
+
 		rc = ata_do_reset(ap, softreset, postreset, 0, classes);
+	}
 
  done:
 	if (rc == 0 && classes[0] == ATA_DEV_UNKNOWN)
-- 
1.2.4



  parent reply	other threads:[~2006-04-02  8:54 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-02  8:54 [PATCHSET] libata: improve ata_bus_probe failure handling, take 2 Tejun Heo
2006-04-02  8:54 ` [PATCH 6/7] libata: improve ata_bus_probe() Tejun Heo
2006-04-02 10:47   ` Jeff Garzik
2006-04-02  8:54 ` Tejun Heo [this message]
2006-04-02 11:55   ` [PATCH 4/7] libata: add 5s sleep between resets Tejun Heo
2006-04-02  8:54 ` [PATCH 3/7] libata: use SATA speed down in ata_drive_probe_reset() Tejun Heo
2006-04-02  8:54 ` [PATCH 1/7] libata: implement ata_dev_absent() Tejun Heo
2006-04-02  8:54 ` [PATCH 2/7] libata: implement ap->sata_spd_limit and helpers Tejun Heo
2006-04-02 10:43   ` Jeff Garzik
2006-04-02 11:04     ` Tejun Heo
2006-04-02 11:18       ` Jeff Garzik
2006-04-02 11:53         ` Tejun Heo
2006-04-02  8:54 ` [PATCH 5/7] libata: implement ata_down_xfermask_limit() Tejun Heo
2006-04-02  8:54 ` [PATCH 7/7] libata: consider disabled devices in ata_dev_xfermask() Tejun Heo
2006-04-02 14:35 ` [PATCHSET] libata: improve ata_bus_probe failure handling, take 2 Jeff Garzik
2006-04-03  9:37   ` Albert Lee
2006-04-03 10:38     ` Jeff Garzik
2006-04-03 14:37       ` Greg Freemyer
2006-04-03 16:20         ` Jeff Garzik
2006-04-04 13:02           ` Greg Freemyer
2006-04-04 13:11             ` Jeff Garzik
2006-04-04  5:02       ` Albert Lee
2006-04-03  9:43   ` [PATCH] libata-dev: irq-pio minor fix Albert Lee
2006-04-04 12:42     ` Jeff Garzik
2006-04-03 10:31   ` [PATCH] libata-dev: irq-pio minor fix 2 Albert Lee

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=11439680861847-git-send-email-htejun@gmail.com \
    --to=htejun@gmail.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=albertcc@tw.ibm.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).