From: John Ernberg john.ernberg@actia.se
[ Upstream commit ac8aff0035fa58e53b39bd565ad6422a90ccdc87 ]
The iMX8QXP (and variants such as the QX, DX, DXP) all identify as iMX8QXP.
They have the exact same restrictions as the supported iMX8QM introduced at commit 61bb8db6f682 ("crypto: caam - Add support for i.MX8QM")
Loosen the check a little bit with a wildcard to also match the iMX8QXP and its variants.
Signed-off-by: John Ernberg john.ernberg@actia.se Reviewed-by: Frank Li Frank.Li@nxp.com Reviewed-by: Peng Fan peng.fan@nxp.com Signed-off-by: Herbert Xu herbert@gondor.apana.org.au Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
Great! The code uses `glob_match()` for pattern matching, which means wildcards like `*` are supported. Now I have all the information needed to analyze this commit.
## Analysis Summary:
**Backport Status: YES**
## Extensive Explanation:
This commit should be backported to stable kernel trees for the following reasons:
### 1. **Bug Fix Nature** This is clearly a bug fix, not a new feature. The iMX8QXP and its variants (QX, DX, DXP) are existing hardware that should have been supported but weren't due to an overly restrictive string matching pattern. The commit message explicitly states these variants "all identify as iMX8QXP" but were not being recognized by the CAAM driver.
### 2. **Small and Contained Change** The change is minimal - only a single line modification from: ```c { .soc_id = "i.MX8QM", .data = &caam_imx8ulp_data }, ``` to: ```c { .soc_id = "i.MX8Q*", .data = &caam_imx8ulp_data }, ```
This is a low-risk change that only affects the pattern matching for SoC identification.
### 3. **Hardware Enablement Fix** Looking at the firmware driver code (`/home/sasha/linux/drivers/firmware/imx/imx-scu-soc.c`), we can see that iMX8QXP is identified with ID 0x2 and returns the string "i.MX8QXP". Without this fix, CAAM crypto hardware acceleration is completely non-functional on these SoCs because the driver fails to match the SoC ID.
### 4. **Same Configuration as iMX8QM** The commit correctly reuses `caam_imx8ulp_data` which is an empty structure, meaning these SoCs have special handling where: - CAAM clocks are managed automatically by hardware (not by Linux) - Linux doesn't have access to the CAAM controller's register page This is the same configuration used for iMX8QM (added in commit 61bb8db6f682), confirming that iMX8QXP variants have identical requirements.
### 5. **No Architectural Changes** The change doesn't introduce any new functionality, APIs, or architectural modifications. It simply extends existing pattern matching to include variants that should have been supported from the beginning.
### 6. **User Impact** Without this fix, users of iMX8QXP, iMX8QX, iMX8DX, and iMX8DXP SoCs cannot use hardware crypto acceleration through CAAM, which is a significant functionality loss for these platforms. The crypto subsystem would fall back to software implementations, resulting in degraded performance for cryptographic operations.
### 7. **Wildcard Pattern is Safe** The use of "i.MX8Q*" wildcard is appropriate here because: - It matches both iMX8QM (existing) and iMX8QXP variants (new) - The glob_match() function in the kernel properly handles this pattern - Both SoC families have identical CAAM requirements (no clock control, no register page access)
This is a textbook example of a stable-appropriate fix: it corrects a clear oversight that prevents hardware from working properly, with minimal code change and risk.
drivers/crypto/caam/ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index 38ff931059b4..9cd5e3d54d9d 100644 --- a/drivers/crypto/caam/ctrl.c +++ b/drivers/crypto/caam/ctrl.c @@ -573,7 +573,7 @@ static const struct soc_device_attribute caam_imx_soc_table[] = { { .soc_id = "i.MX7*", .data = &caam_imx7_data }, { .soc_id = "i.MX8M*", .data = &caam_imx7_data }, { .soc_id = "i.MX8ULP", .data = &caam_imx8ulp_data }, - { .soc_id = "i.MX8QM", .data = &caam_imx8ulp_data }, + { .soc_id = "i.MX8Q*", .data = &caam_imx8ulp_data }, { .soc_id = "VF*", .data = &caam_vf610_data }, { .family = "Freescale i.MX" }, { /* sentinel */ }