[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e4f025d1-267d-4c80-b211-bdadfc31d2b1@linaro.org>
Date: Mon, 12 Feb 2024 18:12:02 +0100
From: neil.armstrong@...aro.org
To: Alexey Romanov <avromanov@...utedevices.com>, clabbe@...libre.com,
herbert@...dor.apana.org.au, davem@...emloft.net, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org, conor+dt@...nel.org,
khilman@...libre.com, jbrunet@...libre.com,
martin.blumenstingl@...glemail.com, vadim.fedorenko@...ux.dev
Cc: linux-crypto@...r.kernel.org, linux-amlogic@...ts.infradead.org,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, kernel@...utedevices.com
Subject: Re: [PATCH v4 06/20] drivers: crypto: meson: drop status field from
meson_flow
On 12/02/2024 14:50, Alexey Romanov wrote:
> This field is used only to check for timeout. But there is more
> convenient way to achive the same goal.
>
> Signed-off-by: Alexey Romanov <avromanov@...utedevices.com>
> ---
> drivers/crypto/amlogic/amlogic-gxl-cipher.c | 13 +++++++++----
> drivers/crypto/amlogic/amlogic-gxl-core.c | 1 -
> drivers/crypto/amlogic/amlogic-gxl.h | 2 --
> 3 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/crypto/amlogic/amlogic-gxl-cipher.c b/drivers/crypto/amlogic/amlogic-gxl-cipher.c
> index 18e9e2d39b1f..dc0b100c5de2 100644
> --- a/drivers/crypto/amlogic/amlogic-gxl-cipher.c
> +++ b/drivers/crypto/amlogic/amlogic-gxl-cipher.c
> @@ -219,13 +219,18 @@ static int meson_cipher(struct skcipher_request *areq)
> }
>
> reinit_completion(&mc->chanlist[flow].complete);
> - mc->chanlist[flow].status = 0;
> meson_dma_start(mc, flow);
> - wait_for_completion_interruptible_timeout(&mc->chanlist[flow].complete,
> - msecs_to_jiffies(500));
> - if (mc->chanlist[flow].status == 0) {
> +
> + err = wait_for_completion_interruptible_timeout(&mc->chanlist[flow].complete,
> + msecs_to_jiffies(500));
> + if (err == 0) {
> dev_err(mc->dev, "DMA timeout for flow %d\n", flow);
> err = -EINVAL;
> + } else if (err < 0) {
> + dev_err(mc->dev, "Waiting for DMA completion is failed (%d)\n", err);
> + } else {
> + /* No error */
> + err = 0;
> }
>
> dma_unmap_single(mc->dev, phykeyiv, keyivlen, DMA_TO_DEVICE);
> diff --git a/drivers/crypto/amlogic/amlogic-gxl-core.c b/drivers/crypto/amlogic/amlogic-gxl-core.c
> index 51291fdcf8b6..f7c60ebffbc3 100644
> --- a/drivers/crypto/amlogic/amlogic-gxl-core.c
> +++ b/drivers/crypto/amlogic/amlogic-gxl-core.c
> @@ -54,7 +54,6 @@ static irqreturn_t meson_irq_handler(int irq, void *data)
> for (flow = 0; flow < mc->flow_cnt; flow++) {
> if (mc->chanlist[flow].irq == irq) {
> if (meson_dma_ready(mc, flow)) {
> - mc->chanlist[flow].status = 1;
> complete(&mc->chanlist[flow].complete);
> return IRQ_HANDLED;
> }
> diff --git a/drivers/crypto/amlogic/amlogic-gxl.h b/drivers/crypto/amlogic/amlogic-gxl.h
> index 5f5e3115fcdf..e27908992ae3 100644
> --- a/drivers/crypto/amlogic/amlogic-gxl.h
> +++ b/drivers/crypto/amlogic/amlogic-gxl.h
> @@ -59,7 +59,6 @@ struct meson_desc {
> * @engine: ptr to the crypto_engine for this flow
> * @keylen: keylen for this flow operation
> * @complete: completion for the current task on this flow
> - * @status: set to 1 by interrupt if task is done
> * @irq: IRQ number for amlogic-crypto
> * @t_phy: Physical address of task
> * @tl: pointer to the current ce_task for this flow
> @@ -68,7 +67,6 @@ struct meson_desc {
> struct meson_flow {
> struct crypto_engine *engine;
> struct completion complete;
> - int status;
> int irq;
> unsigned int keylen;
> dma_addr_t t_phy;
Reviewed-by: Neil Armstrong <neil.armstrong@...aro.org>
Powered by blists - more mailing lists