Repository navigation
Conversation
aiamadeus
commented
Sep 22, 2025
- Replace the eip93 patch with upstream version
- Update the kmod-crypto-hw-eip93 package
- Remove the downstream version in ramips
|
Hi @aiamadeus. Is this tested on mt7621? |
Not yet, I'm waiting for @libiunc 's test results. |
|
@aiamadeus what about fallback mode for mt7621? See #10042 (comment) |
|
The upstream version of EIP93 creashes under load. This is fixed now? |
Looks like it works fine on an7581 and mt7621 with kernel 6.12. |
|
The upstream driver lacks software fallback for small data chunks. It would be best not to lose this feature. |
abajk
left a comment
There was a problem hiding this comment.
Build fails on 6.6:
o_hw_eip93 -c -o drivers/crypto/inside-secure/eip93/eip93-main.o drivers/crypto/inside-secure/eip93/eip93-main.c
drivers/crypto/inside-secure/eip93/eip93-main.c:490:19: error: initialization of 'int (*)(struct platform_device *)' from incompatible pointer type 'void (*)(struct platform_device *)' [-Wincompatible-pointer-types]
490 | .remove = eip93_crypto_remove,
| ^~~~~~~~~~~~~~~~~~~
drivers/crypto/inside-secure/eip93/eip93-main.c:490:19: note: (near initialization for 'eip93_crypto_driver.remove')
The patches involved may need to be placed in the hack directory. |
|
@abajk just change remove to remove_new. @aiamadeus I would revaluate that and check the performance improvement. But it's ok to have that in hack as a dedicated patch or also pending since it can be upstreamed. |
I have tested EIP93 on AN7581 with kernel 6.12. The driver works correctly. However, the software crypto is significantly faster for data blocks smaller than 1024. |
|
@aiamadeus please rebase |
b06502a to
0f9dd3d
Compare
|
@Ansuel @Linaro1985 The software fallback mode has been |
|
Very nice now we need to test mt7530
Il Dom 30 Nov 2025, 15:40 aiamadeus ***@***.***> ha scritto:
… *aiamadeus* left a comment (openwrt/openwrt#20130)
<#20130 (comment)>
@Ansuel <https://github.com/Ansuel> @Linaro1985
<https://github.com/Linaro1985> The software fallback mode has been
split into a separate patch and placed in the hack directory.
—
Reply to this email directly, view it on GitHub
<#20130 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE2ZMQQKVWTIOVZJCLETGPT37L6V5AVCNFSM6AAAAACHFUUSCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKOJSGYYTINBWG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
You mean the mt7621? |
|
Yes Sorry confused it with the switch
Il Dom 30 Nov 2025, 20:17 Aleksander Bajkowski ***@***.***>
ha scritto:
… *abajk* left a comment (openwrt/openwrt#20130)
<#20130 (comment)>
Very nice now we need to test mt7530
You mean the mt7621?
—
Reply to this email directly, view it on GitHub
<#20130 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE2ZMQRU2MTC7MX24FTC3ML37M7FDAVCNFSM6AAAAACHFUUSCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKOJTGE2TEMZRHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
| Mediatek EIP93 Crypto engine is a crypto accelerator which | ||
| is available in the Mediatek MT7621 SoC. |
There was a problem hiding this comment.
This message does not really describe the patch. I think it would be good to mention the why of the patch, i.e. show some performance numbers showing that this patch improves performance.
That's sad. In the ZynqMP SoC, there was a bit that allowed certain peripherals to be rerouted via a different coherent AXI bus. The eip93 has its own DMA engine. Are those 3 others generic DMA engines, or DMA engines from other peripherals like Ethernet? |
|
Cache synchronization consumes a lot of CPU cycles. On the Marvell platform, the coherent EIP97 delivers three times as many IOPS. |
|
Ok, I kinda understand the how it works now. Can you validate this reg? |
The AN7581 have 2 generic DMA engines. GDMA and HS-DMA, then we have the packet processing DMA, TDMA(AKA PDMA) and QDMA. |
The point is, the specification says it should be BIT(1), right?
Old driver also use BIT(1): https://github.com/openwrt/openwrt/blob/openwrt-25.12/target/linux/ramips/patches-6.12/860-ramips-add-eip93-driver.patch#L3081. |
Correct. Does that fix the crash though? Where can I find the document you are referring to? I looked in the MT7621 documentation and it does not look like this. |
My research shows that EIP93 is integrated into Econet/Airoha SoCs, the MT7621, Analog Devices' Blackgin series, and Renesas SoCs. Only Analog publishes documentation for this IP core. Some registers are missing in the Analog documentation. This may be due to the fact that this IP core is in a different revision. All Airoha, MediaTek, and Econet SoCs use EIP93 revision 3.0p1. |
|
For the record MT7621 ProgrammingGuide DMA containes documentation for this part. |
The crash still exists when multiple operations are running in parallel (
But this regression is fixed. I've sent patch upstream. |
openwrt-ai
left a comment
There was a problem hiding this comment.
Reviewed 3 new commits; no new issues found. The PR commits are identical (byte-for-byte same diffs and commit messages) to the previously reviewed revision — only the base has advanced.
Generated by Claude Code
|
Lots of models (even local Qwen) think the issue is that "idr_alloc can fail and return a negative error code, which gets silently converted to (u16) in cdesc." "This bug manifests under heavy load (multibuffer mode with large num_mb) because the IDR runs out of available IDs when many concurrent requests are in flight, causing idr_alloc to return -ENOSPC." |
openwrt-ai
left a comment
There was a problem hiding this comment.
Reviewed the changes since the last review. Only the third commit ("kernel: backport eip93 driver fixes") was rebased; the other two commits are byte-for-byte identical (verified via patch-id). The rebase adds two new patches — backport-6.12/837-v7.2-... and backport-6.18/832-v7.2-crypto-eip93-fix-reset-ring-register-definition.patch — which are identical to each other and apply a single EIP93_PE_CONFIG_RST_RING BIT(2) → BIT(1) fix. Context and patch numbering match the in-tree eip93-regs.h (confirmed against the v6.18.33 reference tree), and the commit message accurately describes the change. No new issues found.
Generated by Claude Code
Replace the eip93 patch in the airoha target with upstream version. Also move it to generic for use by other targets. Signed-off-by: Chukun Pan <[email protected]>
Split the fallback mode from ramips target into a separate patch. Also update the path of crypto-hw-eip93 package. Signed-off-by: Chukun Pan <[email protected]>
Backport minor fixes for the eip93 driver from upstream. Signed-off-by: Aleksander Jan Bajkowski <[email protected]>
openwrt-ai
left a comment
There was a problem hiding this comment.
Reviewed the changes since the last review. The first two commits ("kernel: replace eip93 patch with upstream", "kernel: update crypto-hw-eip93 driver") are byte-for-byte identical to the previously reviewed revision (verified via patch-id). Only the third commit ("kernel: backport eip93 driver fixes") changed.
The rebased third commit reworks the 6.18 backports:
- Drops
backport-6.18/831-v7.1-crypto-eip93-fix-hmac-setkey-algo-selection.patch. Confirmed against the v6.18.33 reference tree that this fix is already upstream there —eip93-common.ccallscrypto_alloc_ahash(alg_name, 0, 0)(mask 0, noCRYPTO_ALG_ASYNC), which is exactly what that patch applies. Correct to drop for 6.18 (still needed for 6.12 as836, since 6.12 mainline has no eip93 driver). - Renumbers the 6.18 make-it-selectable patch 829 → 831; no collision (830 is the emc2305 patch).
- Adds
backport-6.18/832-v7.2-crypto-eip93-fix-reset-ring-register-definition.patch, identical to the 6.12837counterpart. v6.18.33 still hasEIP93_PE_CONFIG_RST_RING BIT(2), so this BIT(2)→BIT(1) fix is still required there; context lines match the in-tree header.
The make-it-selectable (ECONET) patch is also still needed for 6.18 — the v6.18.33 Kconfig depends line lacks ECONET. No dangling references to the old pending-6.18/928 patch remain, and no patch-number collisions in either backport directory. The commit message still accurately describes the change. No new issues found.
Generated by Claude Code
libiunc
left a comment
There was a problem hiding this comment.
It's time to merge. It tested successfully on my device, and EIP93 works correctly.
|
For those tracking the thread. Known remaining issues:
The first issue seems to be the most critical. The big endian panic can be fixed later and should not block this PR. |
|
Here is claude's analysis on the Big endian crash ( Claude has access to live device, all the verification and finding are by claude, I did not review or check anything, Also the testing was on main, not with any commits on this PR) Big-endian bring-up on EcoNet EN751221 (MIPS 34Kc, BE)I brought the in-tree driver up on a big-endian EN75xx SoC (Genexis The crash
The endian register (the combinations you asked about)EN751221 implements only the Airoha variant at What I tried and the outcome:
So on big-endian the register must be written with a full byte-lane reversal if (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN))
writel(FIELD_PREP(EIP93_PE_ENDIAN_TARGET_BYTE_SWAP, 0x1b) |
FIELD_PREP(EIP93_PE_ENDIAN_MASTER_BYTE_SWAP, 0x1b),
eip93->base + EIP93_AIROHA_REG_PE_ENDIAN_CONFIG);
/* ... in the PE_CONFIG reset write: */
if (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN))
val |= EIP93_PE_CONFIG_SWAP_CDRD;What works now (crypto manager self-tests, big-endian)
Still broken on big-endian — help appreciatedAny hash op without Repro (self-tests off, |
The reset doesn't work on the openWRT main branch yet. The patch is in the upstream backport queue. The backport |
| @@ -0,0 +1,27 @@ | |||
| From 09e6b79b8ce388993aec9ac91b1cb2c181c27bd9 Mon Sep 17 00:00:00 2001 | |||
There was a problem hiding this comment.
|
ping @hauke |
Hi @merbanan. I compared the rest of the bit macros between the old and new drivers. EIP93_SA_CMD_SSL_MAC doesn't match either. This bit isn't described in the Analog Devices documentation. Does the MT7621 Programming Guide mention whether it's 11 or 12 bit? :) |
