diff options
author | Carl Vanderlip <quic_carlv@quicinc.com> | 2023-11-17 10:43:36 -0700 |
---|---|---|
committer | Jeffrey Hugo <quic_jhugo@quicinc.com> | 2023-12-01 10:35:32 -0700 |
commit | 44df9a2a13211955ae98f8650e4dc04065e8ec0b (patch) | |
tree | 7b216de414ebd4be9176cdbc76bf8f0129eef93e /drivers/accel/qaic/qaic.h | |
parent | ff3670877e7c73d06c2a835d9abb62efcae0145c (diff) |
accel/qaic: Increase number of in_reset states
'in_reset' holds the state of the device. As part of bringup, the device
needs to be queried to check if it's in a valid state. Add a new state
that indicates that the device is coming up, but not ready for users
yet. Rename to 'dev_state' to better describe the variable.
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-2-quic_jhugo@quicinc.com
Diffstat (limited to 'drivers/accel/qaic/qaic.h')
-rw-r--r-- | drivers/accel/qaic/qaic.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/accel/qaic/qaic.h b/drivers/accel/qaic/qaic.h index bc40d52dc010..cb04f7f9cdb3 100644 --- a/drivers/accel/qaic/qaic.h +++ b/drivers/accel/qaic/qaic.h @@ -31,6 +31,15 @@ #define to_drm(qddev) (&(qddev)->drm) #define to_accel_kdev(qddev) (to_drm(qddev)->accel->kdev) /* Return Linux device of accel node */ +enum __packed dev_states { + /* Device is offline or will be very soon */ + QAIC_OFFLINE, + /* Device is booting, not clear if it's in a usable state */ + QAIC_BOOT, + /* Device is fully operational */ + QAIC_ONLINE, +}; + extern bool datapath_polling; struct qaic_user { @@ -121,8 +130,8 @@ struct qaic_device { struct workqueue_struct *cntl_wq; /* Synchronizes all the users of device during cleanup */ struct srcu_struct dev_lock; - /* true: Device under reset; false: Device not under reset */ - bool in_reset; + /* Track the state of the device during resets */ + enum dev_states dev_state; /* true: single MSI is used to operate device */ bool single_msi; /* |