drivers/misc/habanalabs: atomic_t api usage inconsistencies
From: Shuah Khan
Date: Mon Sep 21 2020 - 18:14:31 EST
All,
While I was looking at the atomic_t api usages for an unrelated issue,
I noticed free_slots_cnt in struct hl_cq incerment/decrement/reads are
not consistent.
atomic_inc() and atomic_set() are used, however instead of atomic_read()
the value is referenced directly in
drivers/misc/habanalabs/common/hw_queue.c
hl_queue_add_ptr()
atomic_t *free_slots = &hdev->completion_queue[q->cq_id].free_slots_cnt;
hl_hw_queue_schedule_cs()
atomic_t *free_slots = &hdev->completion_queue[i].free_slots_cnt;
Any reason why this is necessary. I don't know that this is causing
any problems, it is just odd that access is inconsistent.
thanks,
-- Shuah