linux-stable/drivers/accel
Jeffrey Hugo e997c218ad accel/qaic: Fix NNC message corruption
If msg_xfer() is unable to queue part of a NNC message because the MHI ring
is full, it will attempt to give the QSM some time to drain the queue.
However, if QSM fails to make any room, msg_xfer() will fail and tell the
caller to try again.  This is problematic because part of the message may
have been committed to the ring and there is no mechanism to revoke that
content.  This will cause QSM to receive a corrupt message.

The better way to do this is to check if the ring has enough space for the
entire message before committing any of the message.  Since msg_xfer() is
under the cntl_mutex no one else can come in and consume the space.

Fixes: 129776ac2e ("accel/qaic: Add control path")
Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Reviewed-by: Pranjal Ramajor Asha Kanojiya <quic_pkanojiy@quicinc.com>
Reviewed-by: Carl Vanderlip <quic_carlv@quicinc.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230517193540.14323-6-quic_jhugo@quicinc.com
2023-05-23 09:51:38 -06:00
..
habanalabs Driver core changes for 6.4-rc1 2023-04-27 11:53:57 -07:00
ivpu drm next for 6.4-rc1 2023-04-25 16:12:15 -07:00
qaic accel/qaic: Fix NNC message corruption 2023-05-23 09:51:38 -06:00
Kconfig accel/qaic: Add qaic driver to the build system 2023-04-06 08:23:03 +02:00
Makefile accel/qaic: Add qaic driver to the build system 2023-04-06 08:23:03 +02:00
drm_accel.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00