linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libata: give devices one last chance even if recovery failed with -EINVAL
@ 2007-05-11 12:46 Tejun Heo
  2007-05-11 22:10 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Tejun Heo @ 2007-05-11 12:46 UTC (permalink / raw)
  To: Jeff Garzik, IDE/ATA development list


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:

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-05-11 22:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-11 12:46 [PATCH] libata: give devices one last chance even if recovery failed with -EINVAL Tejun Heo
2007-05-11 22:10 ` Jeff Garzik

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).