Re: DMA masks

From: James Bottomley
Date: Fri Aug 09 2013 - 10:56:22 EST


On Fri, 2013-08-09 at 11:12 +0200, Krzysztof HaÅasa wrote:
> Hi,
>
> I'm trying to understand why the struct device contains a pointer to
> dma_mask and not the actual dma_mask:

It's an anachronism. The original reason was when this was introduced,
struct pci_device was the only device that actually had one. On PA-RISC
we needed to walk the device tree by generic device and set the DMA mask
on generic devices, which meant we either had to special case the PCI
device, rearchitect the whole of the PCI device mask setting to use the
generic device, or cheat and make the generic device dma mask a pointer
to the PCI one. I took the latter option because it's simpler.

James

¢éì®&Þ~º&¶¬–+-±éÝ¥Šw®žË±Êâmébžìdz¹Þ)í…æèw*jg¬±¨¶‰šŽŠÝj/êäz¹ÞŠà2ŠÞ¨è­Ú&¢)ß«a¶Úþø®G«éh®æj:+v‰¨Šwè†Ù>Wš±êÞiÛaxPjØm¶Ÿÿà -»+ƒùdš_