Re: [PATCH] RFC: kills consistent_dma_mask

Krzysztof Halasa
2003-08-19T20:37:26Z

"David S. Miller" <davem@redhat.com> writes:

> (d) Makes implementations have to verify the mask is usable
> on every mapping attempt.

No, unless we have hardware which can return success on first mask check
then result error on subsequent mapping request.

We need to decide, though, as I'm going to fix it that way or another:

1) provide the mask argument to actual mapping requests (pci_map_*,
pci_alloc_*, DMA API) and drop pci_dev->*dma_mask, or

2) add coherent_dma_mask pointer to struct driver as with normal mask,
pointing to pci_dev->consistent_dma_mask

1: non-trivial, but IMHO makes things more clean and natural (from both
system's and driver's view), and fits all special cases.

BTW: Why do we have this pointer (I mean u64 *dma_mask) in struct device?
Does it always point to pci_dev->dma_mask (and to similar value on EISA
etc)? I see some code checks for struct device->dma_mask=NULL, is it only
a safety check or does NULL have some meaning there?

Would it make sense to drop the masks in pci_dev and use (u64 not
pointers) *dma_masks in struct device? If so, would 0 there have the same
meaning as now NULL?
--
Krzysztof Halasa
Network Administrator