Re: Proposal for new generic device API: dma_get_required_mask()

Krzysztof Halasa
2004-06-19T13:51:18Z

James Bottomley <James.Bottomley@steeleye.com> writes:

> It falls victim to the 95/5 rule---when you engineer an API, if 95% of
> the complexity is dealing with the 5% of special cases, you're over
> engineering.
>
> So the original proposal is the remaining 5% that covers 95% of the use
> cases (and will do better even on the remaining 5%).

I don't think so. We already have separate masks for coherent
and non-coherent mappings (in PCI API, and I'm told it's to be extended
to DMA API as well). And we need them.

The problem is we're missing DMA masks for non-alloc calls (depending
on the platform) and thus that it isn't very reliable. Drivers which
need this are forced to bounce buffers themselves, and many of them
will not work on 64-bit platforms (as of ~ 2.6.0, I don't check that
regularly). And yes, we really need reliable masks for non-alloc
mappings.

I can't see any added complexity in this scheme, we basically already
do all of that (except the cost, but it's hardly complex and most
drivers would just need to test check_dma_mask() for error).
--
Krzysztof Halasa, B*FH