From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: firmware: qcom: Add OP-TEE PAS service support
Date: Mon, 25 May 2026 18:55:29 +1000 [thread overview]
Message-ID: <review-overall-20260522115936.201208-1-sumit.garg@kernel.org> (raw)
In-Reply-To: <20260522115936.201208-1-sumit.garg@kernel.org>
Overall Series Review
Subject: firmware: qcom: Add OP-TEE PAS service support
Author: Sumit Garg <sumit.garg@kernel.org>
Patches: 16
Reviewed: 2026-05-25T18:55:29.059603
---
This is a well-structured v7 series that introduces a generic Peripheral Authentication Service (PAS) abstraction layer for Qualcomm platforms, allowing multiple TrustZone backends (SCM/QTEE and OP-TEE) to be plugged in. The series follows a clean pattern: introduce the generic layer (patch 2), wire up SCM as a backend (patch 3), add the TEE backend (patch 4), migrate all client drivers (patches 5-13), remove the now-unused SCM wrappers (patch 14), and add MAINTAINERS (patch 15).
The overall design is sound and the migration is mechanical and correct across the client drivers. The series has good test coverage (Tested-by tags for Lemans and IPQ9650) and appropriate acks from subsystem maintainers. However, there are several concerns, primarily around the global singleton `ops_ptr` pattern, race conditions during registration, and some issues in the TEE backend error handling.
**Key concerns:**
1. **Global singleton `ops_ptr` with no locking**: Only one PAS backend can be active at a time. The registration uses `smp_store_release`/`smp_load_acquire` for visibility but has a TOCTOU race in `qcom_pas_ops_register()` -- the check-then-set is not atomic. If both SCM and TEE backends probe simultaneously, one could silently fail to register with only a `pr_err`.
2. **No module dependency between qcom_pas.c and backends**: `qcom_pas.c` is a module with no `init`/`probe` -- it's just a library of exported symbols. The `ops_ptr` is a module-scoped global. If `qcom_pas.ko` is unloaded while a backend is registered, the ops pointer becomes dangling.
3. **TEE `get_rsc_table` has subtle issues**: The first `tee_client_invoke_func` call is made without any shared memory backing `param[1].u.memref.shm`, which may not be valid for all TEE implementations.
4. **Client drivers still `select QCOM_SCM`**: Several migrated drivers (e.g., DRM_MSM, VIDEO_QCOM_IRIS, QCOM_Q6V5_PAS) still `select QCOM_SCM` alongside the new `select QCOM_PAS`. This is presumably intentional since those drivers still use other SCM APIs, but it means the SCM backend will always register, and the TEE backend will always fail to register when both are built.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-25 8:55 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-22 11:59 [PATCH v7 00/15] firmware: qcom: Add OP-TEE PAS service support Sumit Garg
2026-05-22 11:59 ` [PATCH v7 01/15] arm64: dts: qcom: kodiak: Add EL2 overlay Sumit Garg
2026-05-25 8:55 ` Claude review: " Claude Code Review Bot
2026-05-22 11:59 ` [PATCH v7 02/15] firmware: qcom: Add a generic PAS service Sumit Garg
2026-05-25 8:55 ` Claude review: " Claude Code Review Bot
2026-05-22 11:59 ` [PATCH v7 03/15] firmware: qcom_scm: Migrate to " Sumit Garg
2026-05-25 8:55 ` Claude review: " Claude Code Review Bot
2026-05-22 11:59 ` [PATCH v7 04/15] firmware: qcom: Add a PAS TEE service Sumit Garg
2026-05-25 8:55 ` Claude review: " Claude Code Review Bot
2026-05-22 11:59 ` [PATCH v7 05/15] remoteproc: qcom_q6v5_pas: Switch over to generic PAS TZ APIs Sumit Garg
2026-05-25 8:55 ` Claude review: " Claude Code Review Bot
2026-05-22 11:59 ` [PATCH v7 06/15] remoteproc: qcom_q6v5_mss: Switch " Sumit Garg
2026-05-25 8:55 ` Claude review: " Claude Code Review Bot
2026-05-22 11:59 ` [PATCH v7 07/15] remoteproc: qcom_wcnss: " Sumit Garg
2026-05-25 8:55 ` Claude review: " Claude Code Review Bot
2026-05-22 11:59 ` [PATCH v7 08/15] remoteproc: qcom: Select QCOM_PAS generic service Sumit Garg
2026-05-25 8:55 ` Claude review: " Claude Code Review Bot
2026-05-22 11:59 ` [PATCH v7 09/15] drm/msm: Switch to generic PAS TZ APIs Sumit Garg
2026-05-25 8:55 ` Claude review: " Claude Code Review Bot
2026-05-22 11:59 ` [PATCH v7 10/15] media: qcom: " Sumit Garg
2026-05-25 8:55 ` Claude review: " Claude Code Review Bot
2026-05-22 11:59 ` [PATCH v7 11/15] media: qcom: Pass proper PAS ID to set_remote_state API Sumit Garg
2026-05-25 8:55 ` Claude review: " Claude Code Review Bot
2026-05-22 11:59 ` [PATCH v7 12/15] net: ipa: Switch to generic PAS TZ APIs Sumit Garg
2026-05-25 8:55 ` Claude review: " Claude Code Review Bot
2026-05-22 11:59 ` [PATCH v7 13/15] wifi: ath12k: " Sumit Garg
2026-05-25 8:55 ` Claude review: " Claude Code Review Bot
2026-05-22 11:59 ` [PATCH v7 14/15] firmware: qcom_scm: Remove SCM PAS wrappers Sumit Garg
2026-05-25 8:55 ` Claude review: " Claude Code Review Bot
2026-05-22 11:59 ` [PATCH v7 15/15] MAINTAINERS: Add maintainer entry for Qualcomm PAS TZ service Sumit Garg
2026-05-25 8:55 ` Claude review: " Claude Code Review Bot
2026-05-25 8:55 ` Claude Code Review Bot [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-05-04 13:05 [PATCH v5 00/16] firmware: qcom: Add OP-TEE PAS service support Sumit Garg
2026-05-04 22:22 ` Claude review: " Claude Code Review Bot
2026-04-27 9:55 [PATCH v4 00/15] " Sumit Garg
2026-04-28 4:49 ` Claude review: " Claude Code Review Bot
2026-03-12 6:27 [PATCH v2 00/15] " Sumit Garg
2026-03-13 4:26 ` Claude review: " Claude Code Review Bot
2026-03-06 10:50 [PATCH 00/14] " Sumit Garg
2026-03-08 22:59 ` Claude review: " Claude Code Review Bot
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=review-overall-20260522115936.201208-1-sumit.garg@kernel.org \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.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