mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Myeonghun Pak <mhun512@gmail.com>
Cc: Corentin Labbe <clabbe@baylibre.com>,
	"David S. Miller" <davem@davemloft.net>,
	linux-crypto@vger.kernel.org, linux-amlogic@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Ijae Kim <ae878000@gmail.com>,
	Mohamad Raizudeen <raizudeen.kerneldev@gmail.com>
Subject: Re: [PATCH] crypto: amlogic - Free channel IRQs before disabling the clock
Date: Mon, 26 Oct 2026 12:49:55 +0800	[thread overview]
Message-ID: <at7b8-V0gl-a3d8T@gondor.apana.org.au> (raw)
In-Reply-To: <179203206852.2659709.13834828335447558448.G3@gmail.com>

On Wed, Oct 14, 2026 at 10:41:48PM -0400, Myeonghun Pak wrote:
> The channel IRQs are requested before the managed channel array is
> allocated. Automatic cleanup consequently frees that array before
> releasing the IRQs. An interrupt handler that has already read a channel
> completion status can still write chanlist[flow].status and complete the
> channel completion after the array is released. A cipher timeout allows
> such a late handler even after its crypto engine becomes idle.
> 
> Release the IRQs explicitly before disabling the bus clock and before
> devres can release the channel array. Do this after crypto_engine_exit()
> so normal requests retain their interrupt-driven completion while the
> engines drain. Use the same cleanup on probe failures after the clock
> has been enabled, preserving the channel allocator's existing unwind.
> 
> This issue was identified as part of our ongoing research while
> reviewing kernel code.
> 
> Fixes: 48fe583fe541 ("crypto: amlogic - Add crypto accelerator for amlogic GXL")
> Assisted-by: LLM
> Co-developed-by: Ijae Kim <ae878000@gmail.com>
> Signed-off-by: Ijae Kim <ae878000@gmail.com>
> Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
> ---
> Compile-tested with GCC, W=1 (arm). No runtime testing.
> 
> This bounds IRQ access to completion state and registers; hardware DMA
> handling after a cipher timeout is unchanged.
> 
>  drivers/crypto/amlogic/amlogic-gxl-core.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)

The patch description does not apply to the current cryptodev tree.
Please review this change:

commit e273759a0e29395a6e35e5f17ce03b2690476b2c
Author: Mohamad Raizudeen <raizudeen.kerneldev@gmail.com>
Date:   Wed Sep 16 23:12:27 2026 +0530

    crypto: amlogic - Use devm APIs for clock management

    The driver currently gets the core clock and manually enables it using
    clk_prepare_enable(). This requires matching calls to
    clk_disable_unprepare() in the error paths and remove function.

    Switch to devm_clk_get_enabled() instead. This lets the kernel handle
    enabling and disabling the clock automatically, which allow us to drop
    the manual cleanup code and keeps the probe function simple.

    Reported-by: kernel test robot <lkp@intel.com>
    Closes: https://lore.kernel.org/oe-kbuild-all/202608310329.QgxCCMs1-lkp@intel.com/
    Signed-off-by: Mohamad Raizudeen <raizudeen.kerneldev@gmail.com>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

      reply	other threads:[~2026-10-26  4:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15  2:41 Myeonghun Pak
2026-10-26  4:49 ` Herbert Xu [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=at7b8-V0gl-a3d8T@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=ae878000@gmail.com \
    --cc=clabbe@baylibre.com \
    --cc=davem@davemloft.net \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhun512@gmail.com \
    --cc=neil.armstrong@linaro.org \
    --cc=raizudeen.kerneldev@gmail.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

all inboxes | Powered by JetHome®