]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/rockchip: Fix "is stall active" check
authorJohn Keeping <john@metanate.com>
Tue, 5 Apr 2016 14:05:46 +0000 (15:05 +0100)
committerJoerg Roedel <jroedel@suse.de>
Thu, 7 Apr 2016 12:50:18 +0000 (14:50 +0200)
commitc6b7e26c12d3f98739240f9eaaf85b0a831f03aa
treeffa7def37d3a6843c3c9fc88018e1640c7a9d090
parenta7f8ace8ff9660dd4a7dabbec1a5d9b227468661
iommu/rockchip: Fix "is stall active" check

Since commit ea1682f362f5 ("iommu/rockchip: Reconstruct to support multi
slaves") rk_iommu_is_stall_active() always returns false because the
bitwise AND operates on the boolean flag promoted to an integer and a
value that is either zero or BIT(2).

Explicitly convert the right-hand value to a boolean so that both sides
are guaranteed to be either zero or one.

rk_iommu_is_paging_enabled() does not suffer from the same problem since
RK_MMU_STATUS_PAGING_ENABLED is BIT(0), but let's apply the same change
for consistency and to make it clear that it's correct without needing
to lookup the value.

Fixes: ea1682f362f5 ("iommu/rockchip: Reconstruct to support multi slaves")
Signed-off-by: John Keeping <john@metanate.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/rockchip-iommu.c