All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brad Campbell <brad@wasp.net.au>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: linux-ide@vger.kernel.org
Subject: libata & scsi error handling
Date: Wed, 18 Aug 2004 01:22:34 +0400	[thread overview]
Message-ID: <4122771A.4070203@wasp.net.au> (raw)

G'day Jeff

I think I have this timeout error issue pegged now.

I know this is both wrong, ugly and likely to cause internal kernel damage, but for the purpose of 
pegging what I think may be the culprit it works around the error nicely here

brad@srv:/usr/src$ diff -u temp/linux-2.6.8.1/drivers/scsi/libata-scsi.c 
linux-2.6.8.1/drivers/scsi/libata-scsi.c
--- temp/linux-2.6.8.1/drivers/scsi/libata-scsi.c       2004-08-14 14:55:19.000000000 +0400
+++ linux-2.6.8.1/drivers/scsi/libata-scsi.c    2004-08-18 01:04:11.000000000 +0400
@@ -213,6 +213,7 @@

         ap = (struct ata_port *) &host->hostdata[0];
         ap->ops->eng_timeout(ap);
+       host->host_failed--;

         DPRINTK("EXIT\n");
         return 0;

The issue is that the libata installed eh_strategy_handler does not complete the error as
scsi_unjam_host -> scsi_eh_abort_cmds -> scsi_eh_finish_cmd does.

This leaves shost->host_failed to increment to one above shost->host_busy which means in 
scsi_eh_wakeup we never actually wakeup the error handler thread after the first error.

By adding that line above and doing a
dd if=/dev/sda count=1 > /dev/null

I get constant errors every 20 seconds (which is right given it's incrementing lba by 1 sector at a 
time and readahead seems to ask it to read 0x7F. I assume if I left it be it would error out after 
0x7F retries and then die.) If I plug the cable back in, boom dd drops a read error and we are back 
in business.

I'm not sure where to go from here as I can't seem to find a way to call scsi_eh_finish_cmd from 
within libata-scsi and I'm really well out of my depth here. I hope I can at least contribute to 
debugging.

Regards,
Brad

             reply	other threads:[~2004-08-17 21:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-17 21:22 Brad Campbell [this message]
2004-08-18  2:08 ` libata & scsi error handling Jeff Garzik
2004-08-18  5:11   ` Douglas Gilbert
2004-08-18  5:31     ` Jeff Garzik
2004-08-18  7:04   ` Brad Campbell
2004-08-18  5:32 ` Jeff Garzik
2004-08-19 11:49 ` Kevin Shanahan

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=4122771A.4070203@wasp.net.au \
    --to=brad@wasp.net.au \
    --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 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.