From: Tejun Heo <htejun@gmail.com>
To: Robert Hancock <hancockr@shaw.ca>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
ide <linux-ide@vger.kernel.org>, Jeff Garzik <jeff@garzik.org>
Subject: Re: [PATCH] sata_nv: fix ADMA ATAPI issues with memory over 4GB
Date: Tue, 13 Nov 2007 11:25:51 +0900 [thread overview]
Message-ID: <47390B2F.7090105@gmail.com> (raw)
In-Reply-To: <4738DE21.8090702@shaw.ca>
Hello, Robert.
Robert Hancock wrote:
> @@ -747,11 +748,29 @@
> on the port. */
> adma_enable = 0;
> nv_adma_register_mode(ap);
> + if (!(pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE)) {
> + /* Transitioning to legacy mode. Free the pad buffer. */
> + ata_pad_free(ap, ap->host->dev);
> + ap->pad = NULL;
> + ap->pad_dma = 0;
> + }
> } else {
> - bounce_limit = *ap->dev->dma_mask;
> + bounce_limit = pp->adma_dma_mask;
> segment_boundary = NV_ADMA_DMA_BOUNDARY;
> sg_tablesize = NV_ADMA_SGTBL_TOTAL_LEN;
> adma_enable = 1;
> +
> + if (pp->flags & NV_ADMA_ATAPI_SETUP_COMPLETE) {
> + /* Transitioning to ADMA mode. Free legacy PRD table
> + and the pad buffer. */
> + ata_pad_free(ap, ap->host->dev);
> + ap->pad = NULL;
> + ap->pad_dma = 0;
> + dmam_free_coherent(ap->host->dev, ATA_PRD_TBL_SZ,
> + ap->prd, ap->prd_dma);
> + ap->prd = NULL;
> + ap->prd_dma = 0;
> + }
How about always initialize DMA mask to ATA_DMA_MASK regardless of ADMA
mode such that PRD and PAD buffers are always accessible by register
mode and just raising PCI dma mask and queue bounce limit if ADMA mode
is active?
> + /* Set appropriate DMA mask. */
> + pci_set_dma_mask(pdev, bounce_limit);
> + pci_set_consistent_dma_mask(pdev, bounce_limit);
These can fail.
Also, please separate out the result TF handling to a separate patch. I
know it's a small change but as both introduces important behavior
changes, I think it would be nice to have a bisection point inbetween.
Thanks.
--
tejun
next prev parent reply other threads:[~2007-11-13 2:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-12 23:13 [PATCH] sata_nv: fix ADMA ATAPI issues with memory over 4GB Robert Hancock
2007-11-13 2:25 ` Tejun Heo [this message]
2007-11-13 4:26 ` Robert Hancock
2007-11-13 4:42 ` Tejun Heo
2007-11-13 14:12 ` Mark Lord
2007-11-14 1:57 ` Tejun Heo
2007-11-14 4:11 ` 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=47390B2F.7090105@gmail.com \
--to=htejun@gmail.com \
--cc=hancockr@shaw.ca \
--cc=jeff@garzik.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@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;
as well as URLs for NNTP newsgroup(s).