UPSTREAM: iommu/dma: Implement scatterlist segment merging
authorRobin Murphy <robin.murphy@arm.com>
Mon, 11 Apr 2016 11:32:31 +0000 (12:32 +0100)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 6 Dec 2016 12:48:37 +0000 (20:48 +0800)
commitcdcf0e81e08100816c07a8145b4981db6b79c9f9
treeba7092b695d97d33bd5794c1380c7e670a603ec7
parent6c629fe42a5a3d628a244adbea55435be1eecbdb
UPSTREAM: iommu/dma: Implement scatterlist segment merging

Stop wasting IOVA space by over-aligning scatterlist segments for a
theoretical worst-case segment boundary mask, and instead take the real
limits into account to merge consecutive segments wherever appropriate,
so our callers can benefit from getting back nicely simplified lists.

This also represents the last piece of functionality wanted by users of
the current arch/arm implementation, thus brings us a small step closer
to converting that over to the common code.

Change-Id: Ie583142efece02dfa6678d5e8607b5bc7266f50c
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 809eac54cdd62c67afea1e17080e681dfa33dc09)
drivers/iommu/dma-iommu.c