diff options
author | Lucas Stach <l.stach@pengutronix.de> | 2019-08-05 17:51:53 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-09-06 10:23:18 +0200 |
commit | 4ab6b15a00ca56ecc1ce372478916a611d369151 (patch) | |
tree | 0865bec91defcb2c103c85e73732572e7adc551e /kernel | |
parent | 583c8d3118e00e32b1fe64dc6c442e8f241f9198 (diff) | |
download | linux-stable-4ab6b15a00ca56ecc1ce372478916a611d369151.tar.gz linux-stable-4ab6b15a00ca56ecc1ce372478916a611d369151.tar.bz2 linux-stable-4ab6b15a00ca56ecc1ce372478916a611d369151.zip |
dma-direct: don't truncate dma_required_mask to bus addressing capabilities
[ Upstream commit d8ad55538abe443919e20e0bb996561bca9cad84 ]
The dma required_mask needs to reflect the actual addressing capabilities
needed to handle the whole system RAM. When truncated down to the bus
addressing capabilities dma_addressing_limited() will incorrectly signal
no limitations for devices which are restricted by the bus_dma_mask.
Fixes: b4ebe6063204 (dma-direct: implement complete bus_dma_mask handling)
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/dma/direct.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c index 2c2772e9702a..9912be7a970d 100644 --- a/kernel/dma/direct.c +++ b/kernel/dma/direct.c @@ -55,9 +55,6 @@ u64 dma_direct_get_required_mask(struct device *dev) { u64 max_dma = phys_to_dma_direct(dev, (max_pfn - 1) << PAGE_SHIFT); - if (dev->bus_dma_mask && dev->bus_dma_mask < max_dma) - max_dma = dev->bus_dma_mask; - return (1ULL << (fls64(max_dma) - 1)) * 2 - 1; } |