• Robin Murphy's avatar
    drivers: flag buses which demand DMA configuration · d89e2378
    Robin Murphy authored
    We do not want the common dma_configure() pathway to apply
    indiscriminately to all devices, since there are plenty of buses which
    do not have DMA capability, and if their child devices were used for
    DMA API calls it would only be indicative of a driver bug. However,
    there are a number of buses for which DMA is implicitly expected even
    when not described by firmware - those we whitelist with an automatic
    opt-in to dma_configure(), assuming that the DMA address space and the
    physical address space are equivalent if not otherwise specified.
    
    Commit 72328883 ("of: restrict DMA configuration") introduced a
    short-term fix by comparing explicit bus types, but this approach is far
    from pretty, doesn't scale well, and fails to cope at all with bus
    drivers which may be built as modules, like host1x. Let's refine things
    by making that opt-in a property of the bus type, which neatly addresses
    those problems and lets the decision of whether firmware description of
    DMA capability should be optional or mandatory stay internal to the bus
    drivers themselves.
    Signed-off-by: 's avatarRobin Murphy <robin.murphy@arm.com>
    Acked-by: 's avatarRob Herring <robh@kernel.org>
    Acked-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Acked-by: 's avatarThierry Reding <treding@nvidia.com>
    Signed-off-by: 's avatarChristoph Hellwig <hch@lst.de>
    d89e2378