]> git.proxmox.com Git - mirror_ubuntu-eoan-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)
commitfbedd9b9905c1643b9f7244d88999e39632bbd87
treeffa7def37d3a6843c3c9fc88018e1640c7a9d090
parenteebb8034a5be8c2177cbf07ca2ecd2ff8a058958
iommu/rockchip: Fix "is stall active" check

Since commit cd6438c5f844 ("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: cd6438c5f844 ("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