On Tue, Sep 08, 2020 at 10:06:56PM +1000, Alexey Kardashevskiy wrote: > On 08/09/2020 15:44, Christoph Hellwig wrote: >> 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. > > > a-ha, this makes more sense, thanks. Then I guess we need to revert that > one bit from yours f1565c24b596, do not we?
Why? The was the original intent of the API, but now we also use internally to check the addressing capabilities.