From: Tejun Heo <htejun@gmail.com>
To: Jeff Garzik <jeff@garzik.org>,
IDE/ATA development list <linux-ide@vger.kernel.org>
Subject: [PATCH] libata: give devices one last chance even if recovery failed with -EINVAL
Date: Fri, 11 May 2007 14:46:51 +0200 [thread overview]
Message-ID: <464465BB.5070203@gmail.com> (raw)
After certain errors, some devices report complete garbage on
IDENTIFY. This can cause ata_dev_read_id() to fail with -EINVAL
resulting in immediate disabling of the device. Give the device one
last chance after -EINVAL to allow recovery from such situations. As
-EINVAL is triggered very rarely, this shouldn't cause any noticeable
affect on more common error paths.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Harald Dunkel <harald.dunkel@t-online.de>
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 8256655..d7f62c7 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2201,14 +2201,10 @@ static int ata_eh_recover(struct ata_por
ehc->tries[dev->devno]--;
switch (rc) {
- case -EINVAL:
- /* eeek, something went very wrong, give up */
- ehc->tries[dev->devno] = 0;
- break;
-
case -ENODEV:
/* device missing or wrong IDENTIFY data, schedule probing */
ehc->i.probe_mask |= (1 << dev->devno);
+ case -EINVAL:
/* give it just one more chance */
ehc->tries[dev->devno] = min(ehc->tries[dev->devno], 1);
case -EIO:
next reply other threads:[~2007-05-11 12:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-11 12:46 Tejun Heo [this message]
2007-05-11 22:10 ` [PATCH] libata: give devices one last chance even if recovery failed with -EINVAL Jeff Garzik
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=464465BB.5070203@gmail.com \
--to=htejun@gmail.com \
--cc=jeff@garzik.org \
--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 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.