linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Attenberger <valdyn@gmail.com>
To: Gene Heskett <gene.heskett@gmail.com>
Cc: Jeff Garzik <jeff@garzik.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux IDE mailing list <linux-ide@vger.kernel.org>
Subject: Re: Problem with ata layer in 2.6.24
Date: Tue, 29 Jan 2008 07:41:27 +0100	[thread overview]
Message-ID: <20080129074127.5699afcf.valdyn@gmail.com> (raw)
In-Reply-To: <200801281413.21347.gene.heskett@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2912 bytes --]

On Mon, 28 Jan 2008 14:13:21 -0500
Gene Heskett <gene.heskett@gmail.com> wrote:


> >> I had to reboot early this morning due to a freezeup, and I had a
> >> bunch of these in the messages log:
> >> ==============
> >> Jan 27 19:42:11 coyote kernel: [42461.915961] ata1.00: exception Emask 0x0
> >> SAct 0x0 SErr 0x0 action 0x2 frozen Jan 27 19:42:11 coyote kernel:
> >> [42461.915973] ata1.00: cmd ca/00:08:b1:66:46/00:00:00:00:00/e8 tag 0 dma
> >> 4096 out Jan 27 19:42:11 coyote kernel: [42461.915974]          res
> >> 40/00:01:00:4f:c2/00:00:00:00:00/00 Emask 0x4 (timeout) Jan 27 19:42:11
> >> coyote kernel: [42461.915978] ata1.00: status: { DRDY } Jan 27 19:42:11
> >> coyote kernel: [42461.916005] ata1: soft resetting link Jan 27 19:42:12
> >> coyote kernel: [42462.078216] ata1.00: configured for UDMA/100 Jan 27
> >> 19:42:12 coyote kernel: [42462.078232] ata1: EH complete
> >> Jan 27 19:42:12 coyote kernel: [42462.090700] sd 0:0:0:0: [sda] 390721968
> >> 512-byte hardware sectors (200050 MB) Jan 27 19:42:12 coyote kernel:
> >> [42462.114230] sd 0:0:0:0: [sda] Write Protect is off Jan 27 19:42:12
> >> coyote kernel: [42462.115079] sd 0:0:0:0: [sda] Write cache: enabled, read
> >> cache: enabled, doesn't support DPO or FUA
> >> ===============


I had this error too, or maybe only a similar one, and another, neither
of which of i still have the error output laying around, so I'm posting both
fixes, that i found here on lkml:
1) disabling ncq like that:
"echo 1 > /sys/block/sda/device/queue_depth" 
2) this patch: libata_drain_fifo_on_stuck_drq_hsm.patch 
( applies to 2.6.24 too )

Signed-off-by: Mark Lord <mlord@pobox.com>
---

--- old/drivers/ata/libata-sff.c	2007-09-28 09:29:22.000000000 -0400
+++ linux/drivers/ata/libata-sff.c	2007-09-28 09:39:44.000000000 -0400
@@ -420,6 +420,28 @@
 	ap->ops->irq_on(ap);
 }
 
+static void ata_drain_fifo(struct ata_port *ap, struct ata_queued_cmd *qc)
+{
+	u8 stat = ata_chk_status(ap);
+	/*
+	 * Try to clear stuck DRQ if necessary,
+	 * by reading/discarding up to two sectors worth of data.
+	 */
+	if ((stat & ATA_DRQ) && (!qc || qc->dma_dir != DMA_TO_DEVICE)) {
+		unsigned int i;
+		unsigned int limit = qc ? qc->sect_size : ATA_SECT_SIZE;
+
+		printk(KERN_WARNING "Draining up to %u words from data FIFO.\n",
+									limit);
+		for (i = 0; i < limit ; ++i) {
+			ioread16(ap->ioaddr.data_addr);
+			if (!(ata_chk_status(ap) & ATA_DRQ))
+				break;
+		}
+		printk(KERN_WARNING "Drained %u/%u words.\n", i, limit);
+	}
+}
+
 /**
  *	ata_bmdma_drive_eh - Perform EH with given methods for BMDMA controller
  *	@ap: port to handle error for
@@ -476,7 +498,7 @@
 	}
 
 	ata_altstatus(ap);
-	ata_chk_status(ap);
+	ata_drain_fifo(ap, qc);
 	ap->ops->irq_clear(ap);
 
 	spin_unlock_irqrestore(ap->lock, flags);
-





-- 
Florian Attenberger <valdyn@gmail.com>

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2008-01-29  6:41 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200801272122.21823.gene.heskett@gmail.com>
     [not found] ` <18333.36746.819935.641383@harpo.it.uu.se>
     [not found]   ` <1201521783.6149.33.camel@lappy>
2008-01-28 12:54     ` Problem with ata layer in 2.6.24 Gene Heskett
2008-01-28 13:19       ` Gene Heskett
2008-01-28 13:57       ` Mikael Pettersson
2008-01-28 16:35         ` Gene Heskett
2008-01-28 16:50           ` Calvin Walton
2008-01-28 17:20             ` Zan Lynx
2008-01-28 17:30               ` Gene Heskett
2008-01-28 17:44                 ` Gene Heskett
2008-01-28 17:59                 ` Daniel Barkalow
2008-01-28 18:23                   ` Richard Heck
2008-01-28 20:01                     ` Daniel Barkalow
2008-01-29  0:05                       ` Gene Heskett
2008-01-29  0:34                         ` Daniel Barkalow
2008-01-29  1:31                           ` Gene Heskett
2008-01-29  1:51                             ` Daniel Barkalow
2008-01-29  4:48                             ` Michal Jaegermann
2008-01-29 12:12                     ` Alan Cox
2008-01-29 14:30                       ` Gene Heskett
2008-01-29 14:51                       ` Gene Heskett
2008-01-29 15:47                         ` Alan Cox
2008-01-29 16:32                           ` Gene Heskett
2008-01-29 16:48                             ` Mikael Pettersson
2008-01-29 17:04                               ` Gene Heskett
2008-01-29 17:38                                 ` Daniel Barkalow
2008-01-29 17:44                                   ` Alan Cox
2008-01-29 18:12                                     ` Daniel Barkalow
2008-01-29 17:59                                   ` Gene Heskett
2008-01-29 18:54                                 ` Alan Cox
2008-01-29 22:41                                   ` Gene Heskett
2008-01-29 22:48                                     ` Alan Cox
2008-01-30  0:19                                     ` rgheck
2008-01-30  0:19                                     ` Mark Lord
2008-01-29 17:06                       ` rgheck
2008-01-29 17:12                         ` Alan Cox
2008-01-29 17:24                           ` rgheck
2008-01-29 17:40                             ` Alan Cox
2008-01-29 18:11                         ` Mark Lord
2008-01-29 18:28                           ` rgheck
2008-01-29 18:32                             ` Mark Lord
2008-01-29 18:14                       ` Daniel Barkalow
2008-01-29 18:46                         ` Alan Cox
2008-01-29 19:14                           ` Daniel Barkalow
2008-01-29 19:34                             ` Alan Cox
2008-01-28 16:56           ` Gene Heskett
2008-01-28 18:20             ` Mark Lord
2008-01-28 18:59               ` Gene Heskett
2008-01-28 20:43                 ` Mark Lord
2008-01-29  0:06                   ` Gene Heskett
2008-01-29  3:16                     ` Mark Lord
2008-01-29  4:07                       ` Gene Heskett
2008-01-28 17:06           ` Dave Neuer
2008-01-29  4:23           ` Kasper Sandberg
2008-01-29  4:49             ` Gene Heskett
2008-01-29  5:01               ` Kasper Sandberg
2008-02-02  7:13                 ` Tejun Heo
2008-01-28 14:44       ` Richard Heck
2008-01-28 17:01         ` Gene Heskett
2008-01-28 18:38       ` Mark Lord
2008-01-28 20:01         ` Alan Cox
2008-01-28 20:29           ` Mark Lord
     [not found] ` <479E24F7.4090502@rtr.ca>
2008-01-28 19:01   ` Mark Lord
     [not found]   ` <200801281404.12937.gene.heskett@gmail.com>
     [not found]     ` <479E399C.1030409@rtr.ca>
2008-01-28 20:32       ` Mark Lord
2008-01-28 19:08 ` Jeff Garzik
2008-01-28 19:13   ` Gene Heskett
2008-01-29  6:41     ` Florian Attenberger [this message]
2008-01-29 15:04       ` Gene Heskett
2008-01-29 16:12         ` Mark Lord
2008-01-29 16:36           ` Gene Heskett
2008-01-29 18:09             ` Mark Lord
2008-01-29 16:50           ` rgheck
2008-01-29 16:58         ` Jeff Garzik
2008-01-29 17:12           ` Gene Heskett
2008-01-29 17:32             ` Jeff Garzik
2008-01-29 17:53               ` Gene Heskett

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=20080129074127.5699afcf.valdyn@gmail.com \
    --to=valdyn@gmail.com \
    --cc=gene.heskett@gmail.com \
    --cc=jeff@garzik.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@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).