On Tue, Sep 08, 2020 at 11:51:06AM +1000, Alexey Kardashevskiy wrote: > What is dma_get_required_mask() for anyway? What "requires" what here?
Yes, it is a really odd API. It comes from classic old PCI where 64-bit addressing required an additional bus cycle, and various devices had different addressing schemes, with the smaller addresses beeing more efficient. So this allows the driver to request the "required" addressing mode to address all memory. "preferred" might be a better name as we'll bounce buffer if it isn't met. I also don't really see why a driver would ever want to use it for a modern PCIe device.