mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
iommu: rk-iovmm: fix back to back sg entries condition
Change-Id: Ie493d3d8b34ac4229b3a5a2a84cd52568425f106 Signed-off-by: Simon <xxm@rock-chips.com>
This commit is contained in:
parent
e0958c3066
commit
8ad3d6962f
|
|
@ -98,17 +98,15 @@ dma_addr_t rockchip_iovmm_map(struct device *dev,
|
|||
addr = start;
|
||||
do {
|
||||
phys_addr_t phys;
|
||||
struct scatterlist *sg_tmp;
|
||||
size_t len;
|
||||
|
||||
phys = sg_phys(sg);
|
||||
len = sg->length;
|
||||
|
||||
/* if back to back sg entries are contiguous consolidate them */
|
||||
sg_tmp = sg_next(sg);
|
||||
while (sg_next(sg) && sg_phys(sg) + sg->length == sg_phys(sg_next(sg))) {
|
||||
len += sg_tmp->length;
|
||||
sg = sg_next(sg);
|
||||
len += sg->length;
|
||||
}
|
||||
|
||||
if (offset > 0) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user