DMA Masks: How Many Address Bits a Device Can Reach
Not every device can reach every address: an older card may only be able to put 32 bits of address on the bus, so it cannot touch memory above four gigabytes. A DMA mask is how a driver tells the kernel how wide its device's addressing is, so the kernel only ever hands it buffers it can actually reach. Set it wrong or skip it, and on a large machine your driver works for a while and then mysteriously corrupts memory once an allocation lands too high.
Questions this Concept answers
- Why does a missing or wrong DMA mask often show up only on machines with a lot of memory?
Linux Kernel Documentation / DMA-API-HOWTO.txt
A device cannot always reach every address in memory; an older card might only drive 32 or even 24 bits of address, so it physically cannot touch memory above that line. The DMA mask is how a driver …