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

From: Krzysztof Halasa
Date: Sat Jun 19 2004 - 08:56:09 EST


James Bottomley <James.Bottomley@xxxxxxxxxxxx> 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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/