[PATCH 1/2] accel/qaic: Increase number of in_reset states
Jacek Lawrynowicz
jacek.lawrynowicz at linux.intel.com
Mon Nov 20 08:18:26 UTC 2023
Hi,
On 17.11.2023 18:43, Jeffrey Hugo wrote:
> From: Carl Vanderlip <quic_carlv at quicinc.com>
>
> '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 'reset_state' to better describe the variable.
>
> Signed-off-by: Carl Vanderlip <quic_carlv at quicinc.com>
> Reviewed-by: Pranjal Ramajor Asha Kanojiya <quic_pkanojiy at quicinc.com>
> Reviewed-by: Jeffrey Hugo <quic_jhugo at quicinc.com>
> Signed-off-by: Jeffrey Hugo <quic_jhugo at quicinc.com>
> ---
> drivers/accel/qaic/qaic.h | 13 +++++++++++--
> drivers/accel/qaic/qaic_control.c | 5 +++--
> drivers/accel/qaic/qaic_data.c | 16 ++++++++--------
> drivers/accel/qaic/qaic_drv.c | 12 ++++++------
> 4 files changed, 28 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/accel/qaic/qaic.h b/drivers/accel/qaic/qaic.h
> index bc40d52dc010..bd0c884e6bf7 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 reset_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 reset_states reset_state;
I would rename this to dev_state but otherwise:
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz at linux.intel.com>
More information about the dri-devel
mailing list