From: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
To: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>, linuxppc-dev@lists.ozlabs.org
Cc: Philippe Bergheaud <philippe.bergheaud@fr.ibm.com>,
Christophe Lombard <clombard@linux.vnet.ibm.com>,
Ian Munsie <imunsie@au1.ibm.com>,
Andrew Donnellan <andrew.donnellan@au1.ibm.com>,
gkurz@linux.vnet.ibm.com
Subject: Re: [PATCH v3] cxl: Prevent adapter reset if an active context exists
Date: Thu, 13 Oct 2016 18:35:43 +0200 [thread overview]
Message-ID: <0b835a13-db86-bba8-2c74-6250e15da62d@linux.vnet.ibm.com> (raw)
In-Reply-To: <1476356908-302-1-git-send-email-vaibhav@linux.vnet.ibm.com>
Hi Vaibhav,
Le 13/10/2016 à 13:08, Vaibhav Jain a écrit :
> This patch prevents resetting the cxl adapter via sysfs in presence of
> one or more active cxl_context on it. This protects against an
> unrecoverable error caused by PSL owning a dirty cache line even after
> reset and host tries to touch the same cache line. In case a force reset
> of the card is required irrespective of any active contexts, the int
> value -1 can be stored in the 'reset' sysfs attribute of the card.
>
> The patch introduces a new atomic_t member named contexts_num inside
> struct cxl that holds the number of active context attached to the card
> , which is checked against '0' before proceeding with the reset. To
> prevent against a race condition where a context is activated just after
> reset check is performed, the contexts_num is atomically set to '-1'
> after reset-check to indicate that no more contexts can be activated on
> the card anymore.
>
> Before activating a context we atomically test if contexts_num is
> non-negative and if so, increment its value by one. In case the value of
> contexts_num is negative then it indicates that the card is about to be
> reset and context activation is error-ed out at that point.
>
> Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
Looks good to me, thanks! And sorry, I could have saved you an iteration.
Reviewed-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Actually, I guess I'm supposed to do that now:
Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Fred
next prev parent reply other threads:[~2016-10-13 16:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-13 11:08 [PATCH v3] cxl: Prevent adapter reset if an active context exists Vaibhav Jain
2016-10-13 16:35 ` Frederic Barrat [this message]
2016-10-14 0:35 ` Michael Ellerman
2016-10-14 9:13 ` Vaibhav Jain
2016-10-14 6:19 ` Andrew Donnellan
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=0b835a13-db86-bba8-2c74-6250e15da62d@linux.vnet.ibm.com \
--to=fbarrat@linux.vnet.ibm.com \
--cc=andrew.donnellan@au1.ibm.com \
--cc=clombard@linux.vnet.ibm.com \
--cc=gkurz@linux.vnet.ibm.com \
--cc=imunsie@au1.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=philippe.bergheaud@fr.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).