linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Lord <liml@rtr.ca>
To: Robert Hancock <hancockr@shaw.ca>
Cc: Mark Lord <lkml@rtr.ca>, Allen Martin <AMartin@nvidia.com>,
	Jeff Garzik <jeff@garzik.org>, Tejun Heo <htejun@gmail.com>,
	Gabor Gombas <gombasg@sztaki.hu>,
	linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org,
	Kuan Luo <kluo@nvidia.com>, Peer Chen <pchen@nvidia.com>
Subject: Re: sata_nv + ADMA + Samsung disk problem
Date: Thu, 03 Jan 2008 10:47:43 -0500	[thread overview]
Message-ID: <477D039F.6000206@rtr.ca> (raw)
In-Reply-To: <477D02E0.5040301@rtr.ca>

Mark Lord wrote:
> Robert Hancock wrote:
>> Mark Lord wrote:
>>> Robert Hancock wrote:
>>> ..
>>>>  From some of the traces I took previously (posted on LKML as "sata_nv ADMA controller lockup investigation" way back in Feb 07), what seems to occur is that when the second command is issued very rapidly (within less than 20 microseconds, or potentially longer) after the previous command's completion, the ADMA status changes from 0x500 (STOPPED and IDLE) to 0x400 (just IDLE) as it typically does, but then it sticks there, no interrupt is ever raised, and CPB response flags remain at 0.
>>> ..
>>>
>>> Assuming that NVidia got their ADMA core logic from Pacific Digital
>>> (the inventors), then it may have some of the same bugs as the original.
>>>
>>> One of those bugs is that the aGO trigger is sampled in a "racey" way,
>>> such that it sometimes may miss a recent addition to the ring.
>>>
>>> The *only* way to guarantee things with the original Pacific Digital core
>>> was to (1) always retrigger aGO for a full ring scan with each new addition,
>>> and (2) poll periodically (every half second or so) rather than relying
>>> exclusively on the IRQ actually working..
>>>
>>> Dunno about the NVidia version.
>>
>> Theirs works rather differently - the GO bit is there, but there's another append register which is used to tell the controller that a new tag has been added to the CPB list.
> ..
> 
> The PacDigi core uses a "search count" register for that purpose,
> but the buggy nature of the core required that it always be set
> to "2 * ring_size" to ensure nothing got missed.
> 
> Here's some comments from the original ADMA driver.
> Maybe something from here might help with the NV stuff, too.
> 
>       // There is a chance that the chip will skip over a CPB if a SERVICE interrupt
>        // occurs while it's reading the CPB header.  This won't cause us to get
>        // stuck anywhere, but it might slow down execution of the new CPB if
>        // it has to wait for the next time we hit aGO.  So.. Dxxx/Dxxx suggest
>        // that all we need to do is tell the chip to do two passes around the ring
>        // from an aGO instead of one pass, so that it will find the "missed" CPB
>        // on the second pass.  This isn't as bad as it first looks.
>        //
>        writew(channel->num_cpbs * 2, &adma_regs->cpb_search_count);
> 
> Or again, the NV stuff may be completely different (?).
..

Another thing about the PacDigi core:  one has to be very careful
to avoid sequential accesses to sequential PCI locations when
programming the chip -- it cannot handle merged register writes.

So for any group of sequentially laid out registers, the code has
to ensure it never writes two adjacent registers in sequence..

-ml

  reply	other threads:[~2008-01-03 15:47 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-08 12:08 sata_nv + ADMA + Samsung disk problem Gabor Gombas
2007-08-14  9:30 ` Tejun Heo
2007-08-14 12:02   ` Gabor Gombas
2007-08-16 16:06   ` Gabor Gombas
2007-08-16 18:45     ` Jim Paris
2008-01-01 16:44 ` Gabor Gombas
2008-01-02  3:25   ` Tejun Heo
2008-01-02  4:03     ` Robert Hancock
2008-01-02  4:20       ` Robert Hancock
2008-01-02  4:25         ` Tejun Heo
2008-01-02  6:19           ` Jeff Garzik
2008-01-02  6:39             ` Robert Hancock
2008-01-02  6:55               ` Tejun Heo
2008-01-03  0:27                 ` Robert Hancock
2008-01-02 17:23       ` Allen Martin
2008-01-02 18:57         ` Jeff Garzik
2008-01-02 23:23           ` Allen Martin
2008-01-03  0:21             ` Robert Hancock
2008-01-03  4:14               ` Mark Lord
2008-01-03  4:17               ` Mark Lord
2008-01-03  4:54                 ` Robert Hancock
2008-01-03 15:44                   ` Mark Lord
2008-01-03 15:47                     ` Mark Lord [this message]
2008-01-03 21:13                       ` Benjamin Herrenschmidt
2008-01-04  1:43                         ` Robert Hancock
2008-01-04  5:51                           ` Benjamin Herrenschmidt
2008-01-04  0:41                   ` Allen Martin
2008-01-04  2:51                     ` Robert Hancock
2008-01-08  0:10                     ` Robert Hancock
2008-01-11 23:18                       ` Gabor Gombas
2008-01-12  1:10                         ` Robert Hancock

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=477D039F.6000206@rtr.ca \
    --to=liml@rtr.ca \
    --cc=AMartin@nvidia.com \
    --cc=gombasg@sztaki.hu \
    --cc=hancockr@shaw.ca \
    --cc=htejun@gmail.com \
    --cc=jeff@garzik.org \
    --cc=kluo@nvidia.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml@rtr.ca \
    --cc=pchen@nvidia.com \
    /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).