]> git.ipfire.org Git - thirdparty/linux.git/commit
media: rkvdec: Restore iommu addresses on errors
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 8 May 2025 21:00:15 +0000 (17:00 -0400)
committerHans Verkuil <hverkuil@xs4all.nl>
Fri, 20 Jun 2025 11:20:17 +0000 (13:20 +0200)
commitff8c5622f9f7c644e995d013af320b59e4d61b93
tree537f0e8744b214eb6f45aa88944c29943980b1eb
parent01350185fe02ae3ea2c12d578e06af0d5186f33e
media: rkvdec: Restore iommu addresses on errors

On errors, the rkvdec chip self resets. This can clear the addresses
programmed in the iommu. This case is signaled by the
RKVDEC_SOFTRESET_RDY status bit.

Since the iommu framework does not have a restore functionality, and
as recommended by the iommu subsystem maintainers, this patch
restores the iommu programming by attaching and detaching an empty
domain, which will clear and restore the default domain.

Suggested-by: Detlev Casanova <detlev.casanova@collabora.com>
Tested-by: Detlev Casanova <detlev.casanova@collabora.com>
Reviewed-by: Detlev Casanova <detlev.casanova@collabora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/staging/media/rkvdec/rkvdec.c
drivers/staging/media/rkvdec/rkvdec.h