diff options
author | Robin Murphy <robin.murphy@arm.com> | 2017-10-12 16:56:14 +0100 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2017-10-19 16:34:52 +0200 |
commit | d89e2378a97fafdc74cbf997e7c88af75b81610a (patch) | |
tree | 1291cfc9e6a129e135f99449c007a59266f3a4d2 /drivers/base/platform.c | |
parent | 33d930e59a98fa10a0db9f56c7fa2f21a4aef9b9 (diff) | |
download | linux-d89e2378a97fafdc74cbf997e7c88af75b81610a.tar.bz2 |
drivers: flag buses which demand DMA configuration
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 723288836628 ("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: Robin Murphy <robin.murphy@arm.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/base/platform.c')
-rw-r--r-- | drivers/base/platform.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 9045c5f3734e..c203fb90c1a0 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -1143,6 +1143,7 @@ struct bus_type platform_bus_type = { .match = platform_match, .uevent = platform_uevent, .pm = &platform_dev_pm_ops, + .force_dma = true, }; EXPORT_SYMBOL_GPL(platform_bus_type); |