From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
Vladimir Zapolskiy <vz@mleia.com>,
Nathan Royce <nroycea+kernel@gmail.com>
Subject: Re: [PATCH 4/4] crypto: s5p-sss - Use mutex instead of spinlock
Date: Fri, 17 Mar 2017 18:28:29 +0100 [thread overview]
Message-ID: <4289522.7Nbtc4pSSm@amdc3058> (raw)
In-Reply-To: <20170317144922.27379-5-krzk@kernel.org>
Hi,
On Friday, March 17, 2017 04:49:22 PM Krzysztof Kozlowski wrote:
> Driver uses threaded interrupt handler so there is no real need for
> using spinlocks for synchronization. Mutexes would do fine and are
> friendlier for overall system preemptivness and real-time behavior.
Are you sure that this conversion is safe? This driver also uses
a tasklet and tasklets run in the interrupt context.
> @@ -667,18 +666,17 @@ static void s5p_tasklet_cb(unsigned long data)
> struct s5p_aes_dev *dev = (struct s5p_aes_dev *)data;
> struct crypto_async_request *async_req, *backlog;
> struct s5p_aes_reqctx *reqctx;
> - unsigned long flags;
>
> - spin_lock_irqsave(&dev->lock, flags);
> + mutex_lock(&dev->lock);
> backlog = crypto_get_backlog(&dev->queue);
> async_req = crypto_dequeue_request(&dev->queue);
>
> if (!async_req) {
> dev->busy = false;
> - spin_unlock_irqrestore(&dev->lock, flags);
> + mutex_unlock(&dev->lock);
> return;
> }
> - spin_unlock_irqrestore(&dev->lock, flags);
> + mutex_unlock(&dev->lock);
Best regards,
WARNING: multiple messages have this Message-ID (diff)
From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
Vladimir Zapolskiy <vz@mleia.com>,
Nathan Royce <nroycea+kernel@gmail.com>
Subject: Re: [PATCH 4/4] crypto: s5p-sss - Use mutex instead of spinlock
Date: Fri, 17 Mar 2017 18:28:29 +0100 [thread overview]
Message-ID: <4289522.7Nbtc4pSSm@amdc3058> (raw)
In-Reply-To: <20170317144922.27379-5-krzk@kernel.org>
Hi,
On Friday, March 17, 2017 04:49:22 PM Krzysztof Kozlowski wrote:
> Driver uses threaded interrupt handler so there is no real need for
> using spinlocks for synchronization. Mutexes would do fine and are
> friendlier for overall system preemptivness and real-time behavior.
Are you sure that this conversion is safe? This driver also uses
a tasklet and tasklets run in the interrupt context.
> @@ -667,18 +666,17 @@ static void s5p_tasklet_cb(unsigned long data)
> struct s5p_aes_dev *dev = (struct s5p_aes_dev *)data;
> struct crypto_async_request *async_req, *backlog;
> struct s5p_aes_reqctx *reqctx;
> - unsigned long flags;
>
> - spin_lock_irqsave(&dev->lock, flags);
> + mutex_lock(&dev->lock);
> backlog = crypto_get_backlog(&dev->queue);
> async_req = crypto_dequeue_request(&dev->queue);
>
> if (!async_req) {
> dev->busy = false;
> - spin_unlock_irqrestore(&dev->lock, flags);
> + mutex_unlock(&dev->lock);
> return;
> }
> - spin_unlock_irqrestore(&dev->lock, flags);
> + mutex_unlock(&dev->lock);
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
next prev parent reply other threads:[~2017-03-17 17:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-17 14:49 [PATCH 0/4] crypto: s5p-sss - Fix and minor improvements Krzysztof Kozlowski
2017-03-17 14:49 ` [PATCH 1/4] crypto: s5p-sss - Close possible race for completed requests Krzysztof Kozlowski
2017-03-17 17:57 ` Bartlomiej Zolnierkiewicz
2017-03-17 17:57 ` Bartlomiej Zolnierkiewicz
2017-03-17 14:49 ` [PATCH 2/4] crypto: s5p-sss - Remove unused variant field from state container Krzysztof Kozlowski
2017-03-17 17:57 ` Bartlomiej Zolnierkiewicz
2017-03-17 14:49 ` [PATCH 3/4] crypto: s5p-sss - Document the struct s5p_aes_dev Krzysztof Kozlowski
2017-03-17 17:57 ` Bartlomiej Zolnierkiewicz
2017-03-17 17:57 ` Bartlomiej Zolnierkiewicz
2017-03-17 14:49 ` [PATCH 4/4] crypto: s5p-sss - Use mutex instead of spinlock Krzysztof Kozlowski
2017-03-17 17:28 ` Bartlomiej Zolnierkiewicz [this message]
2017-03-17 17:28 ` Bartlomiej Zolnierkiewicz
2017-03-17 17:54 ` Krzysztof Kozlowski
2017-03-24 14:13 ` [PATCH 0/4] crypto: s5p-sss - Fix and minor improvements Herbert Xu
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=4289522.7Nbtc4pSSm@amdc3058 \
--to=b.zolnierkie@samsung.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=krzk@kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nroycea+kernel@gmail.com \
--cc=vz@mleia.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.