linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] iommu/mediatek: fix tlb flush logic
@ 2021-11-22 10:43 Dafna Hirschfeld
  2021-11-22 10:43 ` [PATCH 1/2] iommu/mediatek: Always tlb_flush_all when each PM resume Dafna Hirschfeld
  2021-11-22 10:44 ` [PATCH 2/2] iommu/mediatek: always check runtime PM status in tlb flush range callback Dafna Hirschfeld
  0 siblings, 2 replies; 8+ messages in thread
From: Dafna Hirschfeld @ 2021-11-22 10:43 UTC (permalink / raw)
  To: iommu
  Cc: Dafna Hirschfeld, kernel, Yong Wu, Joerg Roedel, Will Deacon,
	Matthias Brugger, moderated list:MEDIATEK IOMMU DRIVER,
	moderated list:ARM/Mediatek SoC support, open list, linux-media,
	sebastian.reichel

Often devices allocate dma buffers before they do
runtime pm resume. This is the case for example with v4l2
devices where buffers are allocated during 'VIDIOC_REQBUFS`
and runtime resume happens later usually during 'VIDIOC_STREAMON'.
In such cases the partial tlb flush when allocating will fail
since the the iommu is runtime suspended. This will print a warning
and try to do full flush. But there is actually no need to flush
the tlb before the consumer device is turned on.

Fix the warning by skipping parital flush when allocating and instead
do full flash in runtime resume

This patchset is a combination of a patch already sent in a different
patchset: [1] and a warning fix from Sebastian Reichel

[1] https://lore.kernel.org/linux-devicetree/20210923115840.17813-13-yong.wu@mediatek.com/

Sebastian Reichel (1):
  iommu/mediatek: always check runtime PM status in tlb flush range
    callback

Yong Wu (1):
  iommu/mediatek: Always tlb_flush_all when each PM resume

 drivers/iommu/mtk_iommu.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-12-08 10:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-22 10:43 [PATCH 0/2] iommu/mediatek: fix tlb flush logic Dafna Hirschfeld
2021-11-22 10:43 ` [PATCH 1/2] iommu/mediatek: Always tlb_flush_all when each PM resume Dafna Hirschfeld
2021-11-27  2:46   ` Yong Wu
2021-12-07  8:31     ` Dafna Hirschfeld
2021-12-08  9:50       ` Dafna Hirschfeld
2021-12-08 10:18         ` Dafna Hirschfeld
2021-11-22 10:44 ` [PATCH 2/2] iommu/mediatek: always check runtime PM status in tlb flush range callback Dafna Hirschfeld
2021-11-27  2:46   ` Yong Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).