]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
gpu: ipu-v3: image-convert: Prevent race between run and unprepare
authorSteve Longerbeam <slongerbeam@gmail.com>
Wed, 19 Sep 2018 23:07:18 +0000 (16:07 -0700)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit9643552cfc253ad01879e28e4e12b5e03302663a
treed64210a9bbc242d6016519b104c483ed4e559f07
parentbc3acb0eaa4df70c065b259b22cc07eedd2b2d64
gpu: ipu-v3: image-convert: Prevent race between run and unprepare

BugLink: https://bugs.launchpad.net/bugs/1837664
[ Upstream commit 819bec35c8c9706185498c9222bd244e0781ad35 ]

Prevent possible race by parallel threads between ipu_image_convert_run()
and ipu_image_convert_unprepare(). This involves setting ctx->aborting
to true unconditionally so that no new job runs can be queued during
unprepare, and holding the ctx->aborting flag until the context is freed.

Note that the "normal" ipu_image_convert_abort() case (e.g. not during
context unprepare) should clear the ctx->aborting flag after aborting
any active run and clearing the context's pending queue. This is because
it should be possible to continue to use the conversion context and queue
more runs after an abort.

Signed-off-by: Steve Longerbeam <slongerbeam@gmail.com>
Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/gpu/ipu-v3/ipu-image-convert.c