From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: benh@kernel.crashing.org
Cc: linux-ide@vger.kernel.org, Jeff Garzik <jgarzik@pobox.com>,
Tejun Heo <htejun@gmail.com>
Subject: Re: libata and DMA quirks
Date: Fri, 27 Jun 2008 09:54:54 +0100 [thread overview]
Message-ID: <20080627095454.665b7229@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <1214548895.8011.526.camel@pasglop>
> a) For any ATAPI DMA, If the transfer size is not a multiple of 16
> bytes, switch to PIO for this command.
Old IDE does this internally. Tejun has done a lot of this stuff for the
ATAPI layer in libata. See the check_atapi_dma method (example at
it821x_check_atapi_dma with a size rule)
> b) Double buffer all ATAPI DMA reads. They allocate a 128K DMA buffer
> and limit all requests to 128K. Then, they route all incoming DMAs to
> that buffer and copy back to the original buffer on completion.
That seems pretty icky. For overrun space on the standard SFF controllers
we just tack padding on the end of the DMA sg list.
> The comments in the code seem to indicate this has to do with "alignment
> restrictions", unfortunately, I have no more infos so I don't know what
> the actual underlying HW issues are.
Quite a bit of hardware has rules about the internal FIFO being fed in
internal burst sized chunks, especially older devices. For ATA that isn't
usually a problem, for ATAPI it is.
> I could use some tips as to how to implement these in the libata driver.
> For a) I'm not sure about either overriding qc_prep or qc_issue and what
> would be the consequence of changing tf.protocol there ? Among others,
You can't just change the protocol, you must change the command issued.
> For b) I should be able to completely hide that within my qc_prep and
> completion, by silently using a different DMA target. I suppose I can
> use tf.command == ATA_CMD_ID_ATAPI to differenciate with ATA commands.
if (ata_is_atapi(prot))
> How do I set the max request size with the block layer tho from a libata
> sub-driver ?
Set max_sectors for the disk in your dev_config method
See it821x_dev_config for a simple example
next prev parent reply other threads:[~2008-06-27 9:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-27 6:41 libata and DMA quirks Benjamin Herrenschmidt
2008-06-27 8:37 ` Sergei Shtylyov
2008-06-27 8:51 ` Benjamin Herrenschmidt
2008-06-27 9:10 ` Sergei Shtylyov
2008-06-27 9:31 ` Benjamin Herrenschmidt
2008-06-27 8:54 ` Alan Cox [this message]
2008-06-27 9:29 ` Benjamin Herrenschmidt
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=20080627095454.665b7229@lxorguk.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=benh@kernel.crashing.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox