I must admit my comment was slightly wrong. In some cases
it can make sense to start with a small mask and retry bigger.
The API was designed this way because many devices support different
hardware interfaces for different address sizes. So for example with a
32bit mask you might be able to transfer less data than with a 64bit
mask. And with the retry steps you should be able to figure out the
most efficient format for the current system.
See the discussion in Documentation/DMA-mapping.txt
cc: DaveM; I think the concept was from him originally.
-Andi
--