UPSTREAM: iommu/rockchip: Fix "is stall active" check
authorJeffy Chen <jeffy.chen@rock-chips.com>
Mon, 28 Nov 2016 12:21:25 +0000 (20:21 +0800)
committerJeffy Chen <jeffy.chen@rock-chips.com>
Mon, 28 Nov 2016 12:42:22 +0000 (20:42 +0800)
commit2e70264d33ac767134278bc4275eace299cdede3
tree3e880c8e7ad140f84cac5570ba18a8ec0246148f
parent183f198ab71e611e375db654ddf00b3362ca8074
UPSTREAM: 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>
(cherry picked from commit fbedd9b9905c1643b9f7244d88999e39632bbd87)

Conflicts:
drivers/iommu/rockchip-iommu.c

Change-Id: I5a43eb19d515eba7daf1dc4b1592ac692c115df0
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
drivers/iommu/rockchip-iommu.c