accel/ivpu: Do not access HW registers after unbind
authorStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Thu, 23 Mar 2023 12:54:57 +0000 (13:54 +0100)
committerJacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Fri, 24 Mar 2023 09:50:26 +0000 (10:50 +0100)
commit4522ad764d7e99a79de817fcbc682ebcc75d01fe
tree80df813eac9c272432c598e27622c5744ae8df27
parent1a70ca89d59c7c8af006d29b965a95ede0abb0da
accel/ivpu: Do not access HW registers after unbind

We should not access hardware after we unbind from the bus.

Use drm_dev_enter() / drm_dev_exit() to mark code sections where
hardware is accessed (and not already protected by other locks)
and drm_dev_unplug() to mark device is gone.

Fixes: 35b137630f08 ("accel/ivpu: Introduce a new DRM driver for Intel VPU")
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230323125504.2586442-2-stanislaw.gruszka@linux.intel.com
drivers/accel/ivpu/ivpu_drv.c
drivers/accel/ivpu/ivpu_drv.h
drivers/accel/ivpu/ivpu_job.c