accel/habanalabs/gaudi2: avoid overriding existing undefined opcode data
authorTomer Tayar <ttayar@habana.ai>
Wed, 29 Nov 2023 14:20:31 +0000 (16:20 +0200)
committerOded Gabbay <ogabbay@kernel.org>
Tue, 19 Dec 2023 09:09:44 +0000 (11:09 +0200)
commitbc5f15abcf95ce7e4c2e33daddcb5850ee5e671d
treec790a7a18fd966cd50224b8c4f008328f656e0c0
parentaa5cea38ce687021bf97f9f4cdb18b26db290964
accel/habanalabs/gaudi2: avoid overriding existing undefined opcode data

Part of the undefined opcode data is updated in
gaudi2_handle_qman_err_generic() and some in
handle_lower_qman_data_on_err().
However, the 'write_enable' flag is checked only in
gaudi2_handle_qman_err_generic(), and information of more than a single
error can be mixed there.

Moreover, handle_lower_qman_data_on_err() is called only for the lower
QMAN, so for an error in the upper QMAN there is only a partial info.

Move all the data update to be done in a single place, protected by the
'write_enable' flag.
As mainly the lower QMAN's info is interesting, avoid saving the partial
info for the upper QMAN.

Signed-off-by: Tomer Tayar <ttayar@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/accel/habanalabs/gaudi2/gaudi2.c