From: Shuah Khan <skhan@linuxfoundation.org>
To: oded.gabbay@gmail.com, Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
obitton@habana.ai, lee.jones@linaro.org, oshpigelman@habana.ai
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Shuah Khan <skhan@linuxfoundation.org>
Subject: drivers/misc/habanalabs: atomic_t api usage inconsistencies
Date: Mon, 21 Sep 2020 16:08:37 -0600 [thread overview]
Message-ID: <3dfdda44-3564-1775-c844-f7a2680c9c58@linuxfoundation.org> (raw)
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
next reply other threads:[~2020-09-21 22:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-21 22:08 Shuah Khan [this message]
2020-09-23 8:41 ` Oded Gabbay
2020-09-23 19:38 ` Shuah Khan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3dfdda44-3564-1775-c844-f7a2680c9c58@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=obitton@habana.ai \
--cc=oded.gabbay@gmail.com \
--cc=oshpigelman@habana.ai \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®