]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/iova: Fix tracking of recently failed iova address
authorRobert Richter <rrichter@marvell.com>
Wed, 20 Mar 2019 18:57:23 +0000 (18:57 +0000)
committerJoerg Roedel <jroedel@suse.de>
Fri, 22 Mar 2019 11:01:58 +0000 (12:01 +0100)
commitd43cabf4f7bbbb5a2a0fc55d2dfae831fb0cb584
treeca955b70bf998d4b527e0e1f2de41c9ce50029a7
parent2cbbebf563c25449ab2d31eab0a58011563feb2f
iommu/iova: Fix tracking of recently failed iova address

If a 32 bit allocation request is too big to possibly succeed, it
early exits with a failure and then should never update max32_alloc_
size. This patch fixes current code, now the size is only updated if
the slow path failed while walking the tree. Without the fix the
allocation may enter the slow path again even if there was a failure
before of a request with the same or a smaller size.

Cc: <stable@vger.kernel.org> # 4.20+
Fixes: 09ac253e4a41 ("iommu/iova: Optimise attempts to allocate iova from 32bit address range")
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Robert Richter <rrichter@marvell.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iova.c