]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iommu/rockchip: Handle errors returned from PM framework
authorMarc Zyngier <marc.zyngier@arm.com>
Fri, 24 Aug 2018 15:06:36 +0000 (16:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Sep 2018 07:46:45 +0000 (09:46 +0200)
commit5a476ca109bc0043e868c7bb61221f52193eac10
tree919f3047443a6f37eb9b160d7563b37f9cef467c
parent9f01147244738aad6e758862ab3426d14d237511
iommu/rockchip: Handle errors returned from PM framework

[ Upstream commit 3fc7c5c0cff3150e471f5fd12f59971c6d2c6513 ]

pm_runtime_get_if_in_use can fail: either PM has been disabled
altogether (-EINVAL), or the device hasn't been enabled yet (0).
Sadly, the Rockchip IOMMU driver tends to conflate the two things
by considering a non-zero return value as successful.

This has the consequence of hiding other bugs, so let's handle this
case throughout the driver, with a WARN_ON_ONCE so that we can try
and work out what happened.

Fixes: 0f181d3cf7d98 ("iommu/rockchip: Add runtime PM support")
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iommu/rockchip-iommu.c