]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
media: nxp: imx8-isi: better handle the m2m usage_count
authorLaurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Wed, 23 Oct 2024 08:56:43 +0000 (11:56 +0300)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 1 May 2025 12:07:00 +0000 (14:07 +0200)
commit910efa649076be9c2e1326059830327cf4228cf6
tree6aed3a8296c2cb4dcff8fb794582d81c6ed334e3
parent543f81b86cf4046c7454a05c741c491a4fac44dd
media: nxp: imx8-isi: better handle the m2m usage_count

Currently, if streamon/streamoff calls are imbalanced we can either end up
with a negative ISI m2m usage_count (if streamoff() is called more times
than streamon()) in which case we'll not be able to restart the ISI pipe
next time, or the usage_count never gets to 0 and the pipe is never
switched off.

To avoid that, add a 'streaming' flag to mxc_isi_m2m_ctx_queue_data and use it
in the streamon/streamoff to avoid incrementing/decrementing the usage_count
uselessly, if called multiple times from the same context.

Fixes: cf21f328fcafac ("media: nxp: Add i.MX8 ISI driver")
Cc: stable@vger.kernel.org
Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20241023085643.978729-1-laurentiu.palcu@oss.nxp.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c