From: Jens Axboe <jens.axboe@oracle.com>
To: Robert Hancock <hancockr@shaw.ca>
Cc: Allen Martin <AMartin@nvidia.com>, Jeff Garzik <jeff@garzik.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
linux-ide@vger.kernel.org, prakash@punnoor.de
Subject: Re: [RFC PATCH] nForce4 ADMA with NCQ: It's aliiiive..
Date: Fri, 13 Oct 2006 10:04:35 +0200 [thread overview]
Message-ID: <20061013080434.GE6515@kernel.dk> (raw)
In-Reply-To: <452F053B.2000906@shaw.ca>
On Thu, Oct 12 2006, Robert Hancock wrote:
> Jens Axboe wrote:
> >On Tue, Oct 10 2006, Robert Hancock wrote:
> >>Allen Martin wrote:
> >>>>But I really don't think that is necessary. I will take a
> >>>>look at docs and see how things match up, when I am much more
> >>>>awake. Most likely you need to be using another set of
> >>>>registers, and be all MMIO, all the time.
> >>>You shouldn't be touching BM registers when ADMA is enabled, it can
> >>>cause bad things to happen.
> >>>
> >>>You should be using BM registers when doing ATAPI protocol though, as it
> >>>doesn't work through ADMA. So I wouldn't say you should be using MMIO
> >>>all the time.
> >>>
> >>>-Allen
> >>OK, I've updated the code to take this into account, an updated patch is
> >>attached. However, this does raise an issue. If we have to fall back to
> >>legacy mode to do ATAPI DMA, this means that we can't do 64-bit DMA for
> >>such transfers. Since by the time the driver gets a request the SGs have
> >>already been created based on the set DMA mask, the only way I can see
> >>to handle this is to either allow ATAPI DMA or 64-bit DMA, not both.
> >>I've chosen to default to 64-bit DMA in this version, but there is a
> >>module parameter which allows overriding this if you care more about
> >>using ATAPI devices than efficiency with over 4GB of RAM. I'm open to
> >>suggestions on a better way to handle this..
> >
> >Should be easily fixable - in general, set 64-bit dma mask. Then when
> >you detect an atapi device, lower the dma mask settings to 32-bit dma
> >for that device only. So the pci device in question gets a full 64-bit
> >dma mask, the attached scsi devices can have lower masks if necessary.
> >I'd suggest doing this off slave config.
> >
>
> I think that should be feasible.. However, one problem is that
> slave_config only has access to the struct scsi_device and the
> ata_scsi_find_dev function to turn that into a struct ata_device isn't
> exported, which it would need to be in order to do anything useful
> inside the driver for slave_config. We could export it, or I suppose the
> other place we could do this handling would be postreset, as at that
> point we should know what kind of device is attached.. any comments?
What else do you need? From the scsi device, call the
blk_queue_bounce_limit() on the queue tored in there. That shold be it.
> Also, how is the driver supposed to be setting the DMA mask for the SCSI
> device? I suppose blk_queue_bounce_limit would work, but it seems a bit
> odd to use block layer calls at the libata driver level.
That is the right thing to do.
> I also noticed that I'm still using the default 64KB libata dma_boundary
> value, this should be 4GB for ADMA mode (but fixed up back to the
> default if an ATAPI device is connected, same as with the DMA mask).
You can set that from the same location as the bounce limit.
--
Jens Axboe
next prev parent reply other threads:[~2006-10-13 8:04 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-07 8:08 [RFC PATCH] nForce4 ADMA with NCQ: It's aliiiive Robert Hancock
2006-10-07 9:42 ` Prakash Punnoor
2006-10-07 15:54 ` Robert Hancock
2006-10-10 6:44 ` Allen Martin
2006-10-10 7:52 ` Prakash Punnoor
2006-11-30 16:46 ` Prakash Punnoor
2006-12-01 0:07 ` Robert Hancock
2006-10-07 15:28 ` Jeff Garzik
2006-10-07 23:49 ` Robert Hancock
2006-10-10 6:52 ` Allen Martin
2006-10-11 5:07 ` Robert Hancock
2006-10-11 10:30 ` Jens Axboe
2006-10-13 3:17 ` Robert Hancock
2006-10-13 8:04 ` Jens Axboe [this message]
2006-10-17 3:34 ` [PATCH] sata_nv ADMA/NCQ support for nForce4 Robert Hancock
2006-10-17 3:37 ` Mark Lord
2006-10-17 4:24 ` Robert Hancock
2006-10-17 16:22 ` Mark Lord
2006-10-17 17:58 ` Roland Dreier
2006-10-17 20:54 ` Mark Lord
2006-10-16 16:17 ` [RFC PATCH] nForce4 ADMA with NCQ: It's aliiiive Mark Lord
2006-10-16 23:40 ` Robert Hancock
2006-10-17 0:04 ` Mark Lord
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=20061013080434.GE6515@kernel.dk \
--to=jens.axboe@oracle.com \
--cc=AMartin@nvidia.com \
--cc=hancockr@shaw.ca \
--cc=jeff@garzik.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=prakash@punnoor.de \
/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).