diff options
author | Tal Cohen <talcohen@habana.ai> | 2022-05-11 16:50:30 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-05-22 21:01:21 +0200 |
commit | 90de6805267f8c79cd2b1a36805071e257c39b5c (patch) | |
tree | 39c231c96c3412ab46780b3a3b0cd8c617cca141 /drivers/misc/habanalabs/common/command_submission.c | |
parent | f873a27fd50d161111d0e52087af0f5b2111c5c4 (diff) | |
download | linux-90de6805267f8c79cd2b1a36805071e257c39b5c.tar.gz linux-90de6805267f8c79cd2b1a36805071e257c39b5c.tar.bz2 linux-90de6805267f8c79cd2b1a36805071e257c39b5c.zip |
habanalabs: use separate structure info for each error collect data
Create separate info structure for each error type.
The structures shall be used inside the large structure that contains
the last session error.
This is more scalable for adding more errors in the future.
Signed-off-by: Tal Cohen <talcohen@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/habanalabs/common/command_submission.c')
-rw-r--r-- | drivers/misc/habanalabs/common/command_submission.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/misc/habanalabs/common/command_submission.c b/drivers/misc/habanalabs/common/command_submission.c index d8b6a2a4b210..fb30b7de4aab 100644 --- a/drivers/misc/habanalabs/common/command_submission.c +++ b/drivers/misc/habanalabs/common/command_submission.c @@ -735,11 +735,10 @@ static void cs_timedout(struct work_struct *work) hdev = cs->ctx->hdev; /* Save only the first CS timeout parameters */ - rc = atomic_cmpxchg(&hdev->last_error.cs_write_disable, 0, 1); + rc = atomic_cmpxchg(&hdev->last_error.cs_timeout.write_disable, 0, 1); if (!rc) { - hdev->last_error.open_dev_timestamp = hdev->last_successful_open_ktime; - hdev->last_error.cs_timeout_timestamp = ktime_get(); - hdev->last_error.cs_timeout_seq = cs->sequence; + hdev->last_error.cs_timeout.timestamp = ktime_get(); + hdev->last_error.cs_timeout.seq = cs->sequence; } switch (cs->type) { |