]> git.baikalelectronics.ru Git - kernel.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)
committerOlof Johansson <olof@lixom.net>
Fri, 24 Aug 2018 15:50:29 +0000 (08:50 -0700)
commitc410b9d7ce7e23da2c396060714e1673de6aab11
tree34f6108a8a74f52907f0a5c74b9f6d879643ffca
parentc0fc841f2998ff592ccbc89887db4e89c2096341
iommu/rockchip: Handle errors returned from PM framework

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: 60b723cb80574 ("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>
drivers/iommu/rockchip-iommu.c