iommu/mediatek: Always check runtime PM status in tlb flush range callback
authorSebastian Reichel <sebastian.reichel@collabora.com>
Wed, 8 Dec 2021 12:07:41 +0000 (14:07 +0200)
committerJoerg Roedel <jroedel@suse.de>
Fri, 4 Mar 2022 10:04:45 +0000 (11:04 +0100)
commit4ea794452ae7220bb02ad950d77d86adcbb86b10
treeeefa3d296ae54aae9a7c25e917debcb803db7579
parent17224e08af73fbbc5334226ae75feecb1e037cae
iommu/mediatek: Always check runtime PM status in tlb flush range callback

In case of v4l2_reqbufs() it is possible, that a TLB flush is done
without runtime PM being enabled. In that case the "Partial TLB flush
timed out, falling back to full flush" warning is printed.

Commit c0b57581b73b ("iommu/mediatek: Add power-domain operation")
introduced has_pm as optimization to avoid checking runtime PM
when there is no power domain attached. But without the PM domain
there is still the device driver's runtime PM suspend handler, which
disables the clock. Thus flushing should also be avoided when there
is no PM domain involved.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Yong Wu <yong.wu@mediatek.com>
Link: https://lore.kernel.org/r/20211208120744.2415-3-dafna.hirschfeld@collabora.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/mtk_iommu.c