public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Hancock <hancockr@shaw.ca>
To: "Björn Steinbrink" <B.Steinbrink@gmx.de>,
	"Robert Hancock" <hancockr@shaw.ca>,
	"Jeff Garzik" <jeff@garzik.org>, Chr <chunkeey@web.de>,
	"Alistair John Strachan" <s0348365@sms.ed.ac.uk>,
	linux-kernel@vger.kernel.org, htejun@gmail.com,
	jens.axboe@oracle.com, lwalton@real.com, pomac@vapor.com
Subject: Re: SATA exceptions with 2.6.20-rc5
Date: Mon, 22 Jan 2007 19:24:22 -0600	[thread overview]
Message-ID: <45B563C6.5070505@shaw.ca> (raw)
In-Reply-To: <fa.4QxeKMcmkoyhlL26AivZV6BFQJQ@ifi.uio.no>

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

Björn Steinbrink wrote:
>>> Running a kernel with the return statement replace by a line that prints
>>> the irq_stat instead.
>>>
>>> Currently I'm seeing lots of 0x10 on ata1 and 0x0 on ata2.
>> 40 minutes stress test now and no exception yet. What's interesting is
>> that ata1 saw exactly one interrupt with irq_stat 0x0, all others that
>> might have get dropped are as above.
>> I'll keep it running for some time and will then re-enable the return
>> statement to see if there's a relation between the irq_stat 0x0 and the
>> exception.
> 
> No, doesn't seem to be related, did get 2 exceptions, but no irq_stat
> 0x0 for ata1. Syslog/dmesg has nothing new either, still the same
> pattern of dismissed irq_stats.

I've finally managed to reproduce this problem on my box, by doing:

watch --interval=0.1 /sbin/hdparm -I /dev/sda

on one drive and then running bonnie++ on /dev/sdb connected to the 
other port on the same controller device. Usually within a few minutes 
one of the IDENTIFY commands would time out in the same way you guys 
have been seeing.

Through some various trials and tribulations, the only conclusion I can 
come to is that this controller really doesn't like that 
NV_INT_STATUS_CK804 register being looked at in ADMA mode. I tried 
adding some debug code to the qc_issue function that would check to see 
if the BUSY flag in altstatus went high or that register showed an 
interrupt within a certain time afterwards, however that really seemed 
to hose things, the system wouldn't even boot.

Try out this patch, it just calls the ata_host_intr function where 
appropriate without using nv_host_intr which looks at the 
NV_INT_STATUS_CK804 register. This is what the original ADMA patch from 
Mr. Mysterious NVIDIA Person did, I'm guessing there may be a reason for 
that. With this patch I can get through a whole bonnie++ run with the 
repeated IDENTIFY requests running without seeing the error.

As an aside, there seems to be some dubious code in nv_host_intr, if 
ata_host_intr returns 0 for handled when a command is outstanding, it 
goes and calls ata_check_status anyway. This is rather dangerous since 
if an interrupt showed up right after ata_host_intr but before 
ata_check_status, the ata_check_status would clear it and we would 
forget about it. I tried fixing just that issue and still had this 
problem however. I suspect that code is truly broken and needs further 
thought, but this patch avoids calling it in the ADMA case, at any rate.

As a final aside, this is another case where the hardware docs for this 
controller would really be useful, in order to know whether we are 
actually supposed to be reading that register in ADMA mode or not. I 
sent a query to Allen Martin at NVIDIA asking if there's a way I could 
get access to the documents, but I haven't heard anything yet.

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


[-- Attachment #2: sata_nv-dont-check-ck804-int-status-in-adma.patch --]
[-- Type: text/plain, Size: 672 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-22 18:35:09.000000000 -0600
@@ -750,9 +750,9 @@ static irqreturn_t nv_adma_interrupt(int
 
 			/* if in ATA register mode, use standard ata interrupt handler */
 			if (pp->flags & NV_ADMA_PORT_REGISTER_MODE) {
-				u8 irq_stat = readb(host->mmio_base + NV_INT_STATUS_CK804)
-					>> (NV_INT_PORT_SHIFT * i);
-				handled += nv_host_intr(ap, irq_stat);
+				struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag);
+				if(qc && !(qc->tf.flags & ATA_TFLAG_POLLING))
+					handled += ata_host_intr(ap, qc);
 				continue;
 			}
 

       reply	other threads:[~2007-01-23  1:24 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
2007-01-23  1:34             ` SATA exceptions with 2.6.20-rc5 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
     [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
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
     [not found] <fa.hif5u4ZXua+b0mVNaWEcItWv9i0@ifi.uio.no>
2007-01-14 23:43 ` 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
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
  -- 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=45B563C6.5070505@shaw.ca \
    --to=hancockr@shaw.ca \
    --cc=B.Steinbrink@gmx.de \
    --cc=chunkeey@web.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=pomac@vapor.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox