From: JiaJie Ho <jiajie.ho@starfivetech.com>
To: Hillf Danton <hdanton@sina.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Emil Renner Berthing <kernel@esmil.dk>,
Conor Dooley <conor.dooley@microchip.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-riscv@lists.infradead.org"
<linux-riscv@lists.infradead.org>
Subject: RE: [PATCH v3 4/4] crypto: starfive - Add hash and HMAC support
Date: Tue, 14 Mar 2023 03:24:39 +0000 [thread overview]
Message-ID: <a00427747c094f16acc78b536508bd16@EXMBX068.cuchost.com> (raw)
In-Reply-To: <20230314001744.1911-1-hdanton@sina.com>
> On 13 Mar 2023 21:56:46 +0800 Jia Jie Ho <jiajie.ho@starfivetech.com>
> > +static int starfive_hash_xmit_dma(struct starfive_cryp_ctx *ctx) {
[...]
> > + dmaengine_slave_config(cryp->tx, &cryp->cfg_in);
> > +
> > + in_desc = dmaengine_prep_slave_sg(cryp->tx, rctx->in_sg,
> > + rctx->in_sg_len,
> DMA_MEM_TO_DEV,
> > + DMA_PREP_INTERRUPT |
> DMA_CTRL_ACK);
> > +
> > + if (!in_desc)
> > + return -EINVAL;
> > +
> > + reinit_completion(&cryp->tx_comp);
>
> What breaks without reinit?
Hi Hillf,
So far, I don't see errors without the reinit.
I kept the reinit to reset the done field in case there is a prior transfer.
I'll remove this if it is not needed.
> > +
> > + in_desc->callback = starfive_hash_dma_callback;
> > + in_desc->callback_param = cryp;
> > +
> > + cookie = dmaengine_submit(in_desc);
> > + dma_async_issue_pending(cryp->tx);
> > +
> > + if (!wait_for_completion_timeout(&cryp->tx_comp,
> > + msecs_to_jiffies(10000))) {
> > + dev_err(cryp->dev, "wait_for_completion_timeout error,
> cookie = %x\n",
> > + dma_async_is_tx_complete(cryp->rx, cookie,
> > + NULL, NULL));
>
> What prevents wakeup from coming in case of timeout?
Usually, timeout is caused by failure to complete all data transfer.
It might be due to errors in dma chan setup or in case the hardware hangs.
Thanks for taking time looking into the patch.
Best regards,
Jia Jie
next prev parent reply other threads:[~2023-03-14 3:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-13 13:56 [PATCH v3 0/4] crypto: starfive - Add drivers for crypto engine Jia Jie Ho
2023-03-13 13:56 ` [PATCH v3 1/4] dt-bindings: crypto: Add StarFive crypto module Jia Jie Ho
2023-03-13 13:56 ` [PATCH v3 2/4] crypto: starfive - Add crypto engine support Jia Jie Ho
2023-03-13 13:56 ` [PATCH v3 3/4] riscv: dts: starfive: Add crypto and DMA node for VisionFive 2 Jia Jie Ho
2023-03-13 13:56 ` [PATCH v3 4/4] crypto: starfive - Add hash and HMAC support Jia Jie Ho
2023-03-24 9:44 ` Herbert Xu
2023-03-27 3:12 ` JiaJie Ho
2023-03-24 9:48 ` Herbert Xu
2023-03-24 9:50 ` Herbert Xu
2023-03-24 9:52 ` Herbert Xu
[not found] ` <20230314001744.1911-1-hdanton@sina.com>
2023-03-14 3:24 ` JiaJie Ho [this message]
2023-03-24 4:51 ` [PATCH v3 0/4] crypto: starfive - Add drivers for crypto engine JiaJie Ho
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=a00427747c094f16acc78b536508bd16@EXMBX068.cuchost.com \
--to=jiajie.ho@starfivetech.com \
--cc=conor.dooley@microchip.com \
--cc=hdanton@sina.com \
--cc=herbert@gondor.apana.org.au \
--cc=kernel@esmil.dk \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
/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
all inboxes | Powered by JetHome®