From: Gary R Hook <ghook@amd.com>
To: Herbert Xu <herbert@gondor.apana.org.au>,
Gary R Hook <gary.hook@amd.com>
Cc: <linux-crypto@vger.kernel.org>, <thomas.lendacky@amd.com>,
<davem@davemloft.net>
Subject: Re: [PATCH] crypto: ccp - Use different flag vars for nested locks
Date: Mon, 14 Mar 2016 09:15:39 -0500 [thread overview]
Message-ID: <56E6C78B.60504@amd.com> (raw)
In-Reply-To: <20160312022202.GA29618@gondor.apana.org.au>
On 03/11/2016 08:22 PM, Herbert Xu wrote:
> On Fri, Mar 11, 2016 at 10:40:11AM -0600, Gary R Hook wrote:
>> @@ -128,14 +128,14 @@ static struct ccp_device *ccp_get_device(void)
>> */
>> read_lock_irqsave(&ccp_unit_lock, flags);
>> if (!list_empty(&ccp_units)) {
>> - write_lock_irqsave(&ccp_rr_lock, flags);
>> + write_lock_irqsave(&ccp_rr_lock, rrflags);
> The right thing to do is to drop the _irqsave on the inner lock.
>
> Also why is this a write lock at all as nobody seems to take it
> as a read lock?
Roger on the _irqsave.
As for this being a read-write lock: an optimization during development
removed the need for a read acquisition. This use of the lock was
overlooked, and now only needs to be a spin lock.
Since the function of this patch has changed, and the subject line
should be different, do you prefer a v2 patch, or a new patch? This one
can be ignored, of course.
Gary
prev parent reply other threads:[~2016-03-14 14:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-11 16:40 [PATCH] crypto: ccp - Use different flag vars for nested locks Gary R Hook
2016-03-11 23:01 ` Tom Lendacky
2016-03-12 2:22 ` Herbert Xu
2016-03-14 14:15 ` Gary R Hook [this message]
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=56E6C78B.60504@amd.com \
--to=ghook@amd.com \
--cc=davem@davemloft.net \
--cc=gary.hook@amd.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=thomas.lendacky@amd.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.