From: Mark Lord <liml@rtr.ca>
To: Grant Grundler <grundler@google.com>
Cc: Jeff Garzik <jgarzik@pobox.com>, Tejun Heo <htejun@gmail.com>,
IDE/ATA development list <linux-ide@vger.kernel.org>
Subject: Re: [PATCH 03/12] sata_mv wait for empty+idle
Date: Fri, 02 May 2008 13:45:24 -0400 [thread overview]
Message-ID: <481B5334.7030200@rtr.ca> (raw)
In-Reply-To: <da824cf30805020942q27466cbbk5c7877d6caa6c3d1@mail.gmail.com>
Grant Grundler wrote:
> On Thu, May 1, 2008 at 11:09 PM, Mark Lord <liml@rtr.ca> wrote:
>> When performing EH, it is recommended to wait for the EDMA engine
>> to empty out requests-in-progress before disabling EDMA.
>>
>> Introduce code to poll the EDMA_STATUS register for idle/empty bits
>> before disabling EDMA. For non-EH operation, this will normally exit
>> without delay, other than the register read.
..
>> +static void mv_wait_for_edma_empty_idle(struct ata_port *ap)
>> +{
>> + void __iomem *port_mmio = mv_ap_base(ap);
>> + const u32 empty_idle = (EDMA_STATUS_CACHE_EMPTY |
>> EDMA_STATUS_IDLE);
>> + const int per_loop = 5, timeout = (15 * 1000 / per_loop);
>
> I reccomend setting per_loop to 10 or 20 at least. 5us is not very long.
> It takes about 1us to do an MMIO read. Each additional MMIO read will exacerbate
> the problem of DMA not finishing since MMIO reads interfere with DMA streams.
>
> Also can you add a comment why 15ms is right amount of time to wait?
..
I would, if I knew. That's just a random number.
My own timings with a handful of drives here indicated
that it takes a few hundred microseconds worst case,
so I just picked a bigger number to start with.
No rationale == no comment in the original.
But if you have a good theory for what that number ought to be,
then go for it -- just patch it and stick an explanation in.
Thanks.
> BTW, I have no idea when EDMA stops on it's own or if we could
> safely get EDMA to stop "prematurely" (e.g. disable PCI Bus Master).
..
I don't know what you're talking about there.
???
next prev parent reply other threads:[~2008-05-02 17:45 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-02 6:07 [PATCH 00/12] sata_mv: The last big set for 2.6.26 Mark Lord
2008-05-02 6:07 ` [PATCH 01/12] sata_mv more cosmetic changes Mark Lord
2008-05-02 6:08 ` [PATCH 02/12] sata_mv pci features Mark Lord
2008-05-02 6:09 ` [PATCH 03/12] sata_mv wait for empty+idle Mark Lord
2008-05-02 6:10 ` [PATCH 04/12] sata_mv new mv_qc_defer method Mark Lord
2008-05-02 6:10 ` [PATCH 05/12] sata_mv errata workaround for sata25 part 1 Mark Lord
2008-05-02 6:11 ` [PATCH 06/12] sata_mv rearrange mv_config_fbs Mark Lord
2008-05-02 6:12 ` [PATCH 07/12] sata_mv NCQ and SError fixes for mv_err_intr Mark Lord
2008-05-02 6:13 ` [PATCH 08/12] sata_mv fix mv_host_intr bug for hc_irq_cause Mark Lord
2008-05-02 6:14 ` [PATCH 09/12] sata_mv new mv_port_intr function Mark Lord
2008-05-02 6:14 ` [PATCH 10/12] sata_mv libata: export ata_eh_analyze_ncq_error Mark Lord
2008-05-02 6:15 ` [PATCH 11/12] sata_mv delayed eh handling Mark Lord
2008-05-02 6:16 ` [PATCH 12/12] sata_mv NCQ-EH for FIS-based switching Mark Lord
2008-05-02 12:44 ` Mark Lord
2008-05-02 16:52 ` Grant Grundler
2008-05-02 16:54 ` Grant Grundler
2008-05-02 17:46 ` Mark Lord
2008-05-02 17:52 ` Alan Cox
2008-05-02 17:56 ` [PATCH 13/13] sata_mv use hweight16() for bit counting Mark Lord
2008-05-02 18:02 ` Mark Lord
2008-05-02 18:02 ` [PATCH 13/13] sata_mv use hweight16() for bit counting (V2) Mark Lord
2008-05-02 18:31 ` Grant Grundler
2008-05-02 16:42 ` [PATCH 03/12] sata_mv wait for empty+idle Grant Grundler
2008-05-02 17:45 ` Mark Lord [this message]
2008-05-02 18:39 ` Grant Grundler
2008-05-02 20:09 ` Mark Lord
2008-05-02 16:06 ` [PATCH 02/12] sata_mv pci features Grant Grundler
2008-05-02 17:41 ` Mark Lord
2008-05-02 18:28 ` Grant Grundler
2008-05-06 14:10 ` [PATCH 01/12] sata_mv more cosmetic changes Jeff Garzik
2008-05-06 17:57 ` Mark Lord
2008-05-06 14:17 ` Jeff Garzik
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=481B5334.7030200@rtr.ca \
--to=liml@rtr.ca \
--cc=grundler@google.com \
--cc=htejun@gmail.com \
--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.