All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Hancock <hancockr@shaw.ca>
To: Alistair John Strachan <s0348365@sms.ed.ac.uk>
Cc: "Jeff Garzik" <jeff@garzik.org>,
	"Björn Steinbrink" <B.Steinbrink@gmx.de>,
	linux-kernel@vger.kernel.org, htejun@gmail.com,
	jens.axboe@oracle.com, lwalton@real.com
Subject: Re: SATA exceptions with 2.6.20-rc5
Date: Fri, 19 Jan 2007 20:41:36 -0600	[thread overview]
Message-ID: <45B18160.9020602@shaw.ca> (raw)
In-Reply-To: <200701191505.33480.s0348365@sms.ed.ac.uk>

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

Alistair John Strachan wrote:
> On Tuesday 16 January 2007 01:53, Jeff Garzik wrote:
>> Robert Hancock wrote:
>>> I'll try your stress test when I get a chance, but I doubt I'll run into
>>> the same problem and I haven't seen any similar reports. Perhaps it's
>>> some kind of wierd timing issue or incompatibility between the
>>> controller and that drive when running in ADMA mode? I seem to remember
>>> various reports of issues with certain Maxtor drives and some nForce
>>> SATA controllers under Windows at least..
>> Just to eliminate things, has disabling ADMA been attempted?
>>
>> It can be disabled using the sata_nv.adma module parameter.
> 
> Setting this option fixes the problem for me. I suggest that ADMA defaults off 
> in 2.6.20, if there's still time to do that.
> 

Can you guys that are having this problem try the attached debug patch? 
It's possible it will fix the problem, as I'm trying a private 
exec_command implementation that flushes the write by reading a 
controller register instead of reading altstatus from the drive like the 
libata core code does.

If the problem still happens, I also added some more debugging in to 
help figure out what is going on, so please post full dmesg.

By the way, I assume that you guys are using reiserfs or xfs, as it 
appears no other file systems issue flush commands automatically. I had 
to test this by "echo 1 > delete" on the SCSI disk in sysfs, as I am 
using ext3.

-- 
Robert Hancock      Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/


[-- Attachment #2: sata_nv-debug-flushes.patch --]
[-- Type: text/plain, Size: 3164 bytes --]

--- linux-2.6.20-rc5/drivers/ata/sata_nv.c	2007-01-19 19:18:53.000000000 -0600
+++ linux-2.6.20-rc5debug/drivers/ata/sata_nv.c	2007-01-19 20:25:31.000000000 -0600
@@ -245,6 +245,7 @@ static void nv_adma_bmdma_setup(struct a
 static void nv_adma_bmdma_start(struct ata_queued_cmd *qc);
 static void nv_adma_bmdma_stop(struct ata_queued_cmd *qc);
 static u8 nv_adma_bmdma_status(struct ata_port *ap);
+static void nv_adma_exec_command(struct ata_port *ap, const struct ata_taskfile *tf);
 
 enum nv_host_type
 {
@@ -409,7 +410,7 @@ static const struct ata_port_operations 
 	.tf_load		= ata_tf_load,
 	.tf_read		= ata_tf_read,
 	.check_atapi_dma	= nv_adma_check_atapi_dma,
-	.exec_command		= ata_exec_command,
+	.exec_command		= nv_adma_exec_command,
 	.check_status		= ata_check_status,
 	.dev_select		= ata_std_dev_select,
 	.bmdma_setup		= nv_adma_bmdma_setup,
@@ -617,6 +618,14 @@ static int nv_adma_check_atapi_dma(struc
 	return !(pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE);
 }
 
+static void nv_adma_exec_command(struct ata_port *ap, const struct ata_taskfile *tf)
+{
+	void __iomem* mmio = nv_adma_ctl_block(ap);
+	writeb(tf->command, (void __iomem *) ap->ioaddr.command_addr);
+	readw(mmio + NV_ADMA_CTL); /* flush */
+	ndelay(400);
+}
+
 static unsigned int nv_adma_tf_to_cpb(struct ata_taskfile *tf, __le16 *cpb)
 {
 	unsigned int idx = 0;
@@ -701,6 +710,9 @@ static int nv_host_intr(struct ata_port 
 {
 	struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag);
 	int handled;
+	u8 cmd = 0;
+	if(qc)
+		cmd = qc->tf.command;
 
 	/* freeze if hotplugged */
 	if (unlikely(irq_stat & (NV_INT_ADDED | NV_INT_REMOVED))) {
@@ -709,8 +721,11 @@ static int nv_host_intr(struct ata_port 
 	}
 
 	/* bail out if not our interrupt */
-	if (!(irq_stat & NV_INT_DEV))
+	if (!(irq_stat & NV_INT_DEV)) {
+		if( cmd == ATA_CMD_FLUSH || cmd == ATA_CMD_FLUSH_EXT )
+			ata_port_printk(ap, KERN_NOTICE, "cmd 0x%x active but stat 0x%x\n", cmd, irq_stat);
 		return 0;
+	}
 
 	/* DEV interrupt w/ no active qc? */
 	if (unlikely(!qc || (qc->tf.flags & ATA_TFLAG_POLLING))) {
@@ -720,6 +735,8 @@ static int nv_host_intr(struct ata_port 
 
 	/* handle interrupt */
 	handled = ata_host_intr(ap, qc);
+	if( cmd == ATA_CMD_FLUSH || cmd == ATA_CMD_FLUSH_EXT )
+		ata_port_printk(ap, KERN_NOTICE, "cmd 0x%x active, stat = 0x%x, handled = 0x%x\n", cmd, irq_stat, handled);
 	if (unlikely(!handled)) {
 		/* spurious, clear it */
 		ata_check_status(ap);
@@ -870,7 +887,7 @@ static void nv_adma_bmdma_setup(struct a
 	outb(dmactl, ap->ioaddr.bmdma_addr + ATA_DMA_CMD);
 
 	/* issue r/w command */
-	ata_exec_command(ap, &qc->tf);
+	nv_adma_exec_command(ap, &qc->tf);
 }
 
 static void nv_adma_bmdma_start(struct ata_queued_cmd *qc)
@@ -1161,6 +1178,9 @@ static unsigned int nv_adma_qc_issue(str
 		/* use ATA register mode */
 		VPRINTK("no dmamap or ATAPI, using ATA register mode: 0x%lx\n", qc->flags);
 		nv_adma_register_mode(qc->ap);
+		if(qc->tf.command == ATA_CMD_FLUSH ||
+		   qc->tf.command == ATA_CMD_FLUSH_EXT )
+			ata_port_printk(qc->ap, KERN_NOTICE, "issue flush cmd 0x%x\n", qc->tf.command);
 		return ata_qc_issue_prot(qc);
 	} else
 		nv_adma_mode(qc->ap);

  parent reply	other threads:[~2007-01-20  2:41 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fa.hif5u4ZXua+b0mVNaWEcItWv9i0@ifi.uio.no>
2007-01-14 23:43 ` SATA exceptions with 2.6.20-rc5 Robert Hancock
2007-01-15  0:22   ` Jeff Garzik
2007-01-15  0:34     ` Björn Steinbrink
2007-01-15  2:47       ` Björn Steinbrink
2007-01-15  2:25     ` Robert Hancock
2007-01-15  2:53       ` Jens Axboe
2007-01-15 13:42         ` Jeff Garzik
2007-01-16  0:23           ` Jens Axboe
2007-01-16  0:36             ` Robert Hancock
2007-01-16  1:51               ` Jeff Garzik
2007-01-16  1:51             ` Jeff Garzik
2007-01-22 18:17               ` Eric D. Mudama
2007-01-15 21:17   ` Björn Steinbrink
2007-01-15 23:46     ` Björn Steinbrink
2007-01-16  0:34       ` Robert Hancock
2007-01-16  1:35         ` Björn Steinbrink
2007-01-16  3:00           ` Robert Hancock
2007-01-16  1:53         ` Jeff Garzik
2007-01-19 15:05           ` Alistair John Strachan
2007-01-19 19:51             ` chunkeey
2007-01-20  2:41             ` Robert Hancock [this message]
2007-01-20  2:47               ` Alistair John Strachan
2007-01-20  4:15               ` Björn Steinbrink
     [not found]               ` <20070120072755.GA4652@atjola.homenet>
2007-01-20  7:50                 ` Björn Steinbrink
2007-01-20 18:50               ` Chr
2007-01-20 22:32               ` Chr
2007-01-21  1:50                 ` Robert Hancock
2007-01-21  3:34                   ` Jeff Garzik
2007-01-21  4:54                     ` Björn Steinbrink
2007-01-21  6:39                       ` Robert Hancock
2007-01-21  8:36                         ` Björn Steinbrink
2007-01-21 17:34                           ` Chr
2007-01-21 18:01                             ` Björn Steinbrink
2007-01-21 20:13                               ` Chr
2007-01-22  2:39                                 ` Tejun Heo
2007-01-22 12:32                                   ` Chr
2007-01-21 18:40                           ` Björn Steinbrink
2007-01-21 19:58                             ` Robert Hancock
2007-01-21 22:08                               ` Björn Steinbrink
2007-01-21 22:11                                 ` Björn Steinbrink
2007-01-21 22:26                                   ` Robert Hancock
2007-01-21 22:27                               ` Björn Steinbrink
2007-01-22  0:17                                 ` Robert Hancock
2007-01-22 16:12                                   ` Björn Steinbrink
2007-01-22 16:57                                     ` Björn Steinbrink
2007-01-22 17:53                                       ` Björn Steinbrink
2007-01-19 14:53         ` Alistair John Strachan
     [not found] <fa.1kBz5luWz8nR0lLqm1VD4hZZYdw@ifi.uio.no>
     [not found] ` <fa.QZxgjxcwtENaZNY24NMTlKBSgIM@ifi.uio.no>
     [not found]   ` <fa.fkPTbUGmKc/1pt0eD6TE4d02n+Q@ifi.uio.no>
     [not found]     ` <fa.6iQt5OtHZ3x5w8eYbLxwULhLTJ0@ifi.uio.no>
     [not found]       ` <fa.1aqo3IxNGJClHcBVZNTagX6bL9o@ifi.uio.no>
     [not found]         ` <fa.rI60BGlFbSyfLyumqmgiOfDqCI4@ifi.uio.no>
2007-01-23 23:18           ` Robert Hancock
2007-01-24  0:39             ` Björn Steinbrink
2007-02-03  1:42               ` Björn Steinbrink
2007-02-03  5:48                 ` Robert Hancock
2007-02-04  1:13                   ` Björn Steinbrink
2007-02-09 12:03                     ` Björn Steinbrink
2007-01-24  8:24             ` Ian Kumlien
2007-01-24 14:41               ` Björn Steinbrink
     [not found] <fa.ow4pXUncgdZmfLf3oyfrn1W+Bk0@ifi.uio.no>
     [not found] ` <fa.SoSeidhDuEr/K0kN+L4vW61Vpnc@ifi.uio.no>
     [not found]   ` <fa.m8QbVQMhuOshKzTdlSjNjOhaNcc@ifi.uio.no>
     [not found]     ` <fa.hDS02YCM8Tv1/STeTpJGEQD/49s@ifi.uio.no>
     [not found]       ` <fa.eqBbU9XvtTizNMpuUjctnk8vuOI@ifi.uio.no>
     [not found]         ` <fa.4QxeKMcmkoyhlL26AivZV6BFQJQ@ifi.uio.no>
2007-01-23  1:24           ` Robert Hancock
2007-01-23  1:34             ` Alistair John Strachan
2007-01-23  1:41               ` Robert Hancock
2007-01-23 15:29                 ` Larry Walton
2007-01-23  2:44             ` Björn Steinbrink
2007-01-23  5:03               ` Robert Hancock
2007-01-20 15:03 Ian Kumlien
2007-01-20 19:59 ` Robert Hancock
2007-01-20 21:43   ` Alistair John Strachan
2007-01-20 22:11     ` Ian Kumlien
     [not found] <fa.U/G88R1fWKOeQK3EBPHKK4MeRsQ@ifi.uio.no>
     [not found] ` <fa.2D0TIXbVTOgZmGg9ZJU+R7te70k@ifi.uio.no>
     [not found]   ` <fa.hMhdefkReYJ4idUyqqEWJFnWUBE@ifi.uio.no>
     [not found]     ` <fa.8TPWeOrcwkkHutPX5NOcJsTBO8Y@ifi.uio.no>
     [not found]       ` <fa.b92BqwV090pDj7q0iBG6BChksbI@ifi.uio.no>
     [not found]         ` <fa.O3RzvckSjB73Y0uL8P1nTXDRd6U@ifi.uio.no>
2007-01-19  0:09           ` Robert Hancock
2007-01-19  0:52             ` Björn Steinbrink
  -- strict thread matches above, loose matches on Subject: below --
2007-01-14 22:44 Björn Steinbrink
2007-01-15  6:48 ` Mikael Pettersson
2007-01-15 13:43   ` Jeff Garzik
2007-01-15 13:47   ` Björn Steinbrink

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=45B18160.9020602@shaw.ca \
    --to=hancockr@shaw.ca \
    --cc=B.Steinbrink@gmx.de \
    --cc=htejun@gmail.com \
    --cc=jeff@garzik.org \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lwalton@real.com \
    --cc=s0348365@sms.ed.ac.uk \
    /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.