From: Ian Munsie <imunsie@au1.ibm.com>
To: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
Cc: Philippe Bergheaud <felix@linux.vnet.ibm.com>,
linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
mikey <mikey@neuling.org>,
"Matthew R. Ochs" <mrochs@linux.vnet.ibm.com>,
manoj <manoj@linux.vnet.ibm.com>
Subject: Re: [v6, 1/2] cxl: Add mechanism for delivering AFU driver specific events
Date: Tue, 21 Jun 2016 14:49:33 +1000 [thread overview]
Message-ID: <1466483778-sup-4320@x230.ozlabs.ibm.com> (raw)
In-Reply-To: <87k2hkgs6v.fsf@vajain21.in.ibm.com>
Excerpts from Vaibhav Jain's message of 2016-06-20 14:20:16 +0530:
> > +int cxl_unset_driver_ops(struct cxl_context *ctx)
> > +{
> > + if (atomic_read(&ctx->afu_driver_events))
> > + return -EBUSY;
> > +
> > + ctx->afu_driver_ops = NULL;
> Need a write memory barrier so that afu_driver_ops isnt possibly called
> after this store.
What situation do you think this will help? I haven't looked closely at
the last few iterations of this patch set, but if you're in a situation
where you might be racing with some code doing e.g.
if (ctx->afu_driver_ops)
ctx->afu_driver_ops->something();
You have a race with or without a memory barrier. Ideally you would just
have the caller guarantee that it will only call cxl_unset_driver_ops if
no further calls to afu_driver_ops is possible, otherwise you may need
locking here which would be far from ideal.
What exactly is the use case for this API? I'd vote to drop it if we can
do without it.
-Ian
next prev parent reply other threads:[~2016-06-21 4:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-16 14:13 [v6, 1/2] cxl: Add mechanism for delivering AFU driver specific events Philippe Bergheaud
2016-06-16 14:13 ` [v6,2/2] cxl: Add set and get private data to context struct Philippe Bergheaud
2016-06-17 16:21 ` [v6, 1/2] cxl: Add mechanism for delivering AFU driver specific events Matthew R. Ochs
2016-06-20 8:50 ` Vaibhav Jain
2016-06-21 4:49 ` Ian Munsie [this message]
2016-06-21 10:34 ` Vaibhav Jain
2016-06-21 13:27 ` Matthew R. Ochs
2016-06-22 14:02 ` Philippe Bergheaud
2016-06-22 14:02 ` Philippe Bergheaud
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=1466483778-sup-4320@x230.ozlabs.ibm.com \
--to=imunsie@au1.ibm.com \
--cc=felix@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=manoj@linux.vnet.ibm.com \
--cc=mikey@neuling.org \
--cc=mrochs@linux.vnet.ibm.com \
--cc=vaibhav@linux.vnet.ibm.com \
/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;
as well as URLs for NNTP newsgroup(s).