accel/qaic: Expand DRM device lifecycle
authorCarl Vanderlip <quic_carlv@quicinc.com>
Fri, 17 Nov 2023 17:43:37 +0000 (10:43 -0700)
committerJeffrey Hugo <quic_jhugo@quicinc.com>
Fri, 1 Dec 2023 17:37:06 +0000 (10:37 -0700)
commit5f0a0ebca2b98eeda10715433c7d9418ef2e6d01
tree37ba724f17d351f05e44db2c9220ced34c33346a
parent44df9a2a13211955ae98f8650e4dc04065e8ec0b
accel/qaic: Expand DRM device lifecycle

Currently the QAIC DRM device registers itself when the MHI QAIC_CONTROL
channel becomes available. This is when the device is able to process
workloads. However, the DRM driver also provides the debugfs interface
bootlog for the device. If the device fails to boot to the QSM (which
brings up the MHI QAIC_CONTROL channel), the bootlog won't be available for
debugging why it failed to boot.

Change when the DRM device registers itself from when QAIC_CONTROL is
available to when the card is first probed on the PCI bus. Additionally,
make the DRM driver persist through reset/error cases so the driver
doesn't have to be reloaded to access the card again. Send
KOBJ_ONLINE/OFFLINE uevents so userspace can know when DRM device is
ready to handle requests.

Signed-off-by: Carl Vanderlip <quic_carlv@quicinc.com>
Reviewed-by: Pranjal Ramajor Asha Kanojiya <quic_pkanojiy@quicinc.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231117174337.20174-3-quic_jhugo@quicinc.com
Documentation/accel/qaic/qaic.rst
drivers/accel/qaic/mhi_controller.c
drivers/accel/qaic/qaic.h
drivers/accel/qaic/qaic_drv.c