Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Harsh Jain <h.jain@amd.com>
To: <herbert@gondor.apana.org.au>, <davem@davemloft.net>,
	<linux-crypto@vger.kernel.org>, <sarat.chand.savitala@amd.com>,
	<michal.simek@amd.com>, <linux-arm-kernel@lists.infradead.org>
Cc: Harsh Jain <h.jain@amd.com>
Subject: [PATCH 3/3] crypto: xilinx: zynqmp-aes-gcm: Send firmware decoded code instead of EBADMSG
Date: Mon, 6 Jul 2026 16:32:54 +0530	[thread overview]
Message-ID: <20260706110254.2427551-4-h.jain@amd.com> (raw)
In-Reply-To: <20260706110254.2427551-1-h.jain@amd.com>

Currently Failure in GCM AES decrypt is converted to -EBADMSG ignoring
actual firmware error code.
Update driver to send firmware reported error code.

Signed-off-by: Harsh Jain <h.jain@amd.com>
---
 drivers/crypto/xilinx/zynqmp-aes-gcm.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/crypto/xilinx/zynqmp-aes-gcm.c b/drivers/crypto/xilinx/zynqmp-aes-gcm.c
index 2421bf30556d..7fcdd56f9046 100644
--- a/drivers/crypto/xilinx/zynqmp-aes-gcm.c
+++ b/drivers/crypto/xilinx/zynqmp-aes-gcm.c
@@ -344,10 +344,8 @@ static int versal_aes_aead_cipher(struct aead_request *req)
 			goto clearkey;
 
 		ret = versal_pm_aes_dec_final(dma_addr_data + gcm_offset);
-		if (ret) {
-			ret = -EBADMSG;
+		if (ret)
 			goto clearkey;
-		}
 	}
 	dma_unmap_single(dev, dma_addr_data, kbuf_size, DMA_BIDIRECTIONAL);
 	dma_unmap_single(dev, dma_addr_hw_req, dmabuf_size, DMA_BIDIRECTIONAL);
-- 
2.34.1


      parent reply	other threads:[~2026-07-06 11:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06 11:02 [PATCH 0/3] crypto: xilinx: Map PLM error codes to Linux error Harsh Jain
2026-07-06 11:02 ` [PATCH 1/3] firmware: xilinx: Rephrase documentation of aes API Harsh Jain
2026-07-06 11:02 ` [PATCH 2/3] firmware: xilinx: Update AES PM-APIs to capture PLM error codes Harsh Jain
2026-07-06 11:02 ` Harsh Jain [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=20260706110254.2427551-4-h.jain@amd.com \
    --to=h.jain@amd.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=sarat.chand.savitala@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox