6.18: Add PAS over OP-TEE support for open-firmware platforms - #1129
Ricardo Salveti (ricardosalveti) wants to merge 21 commits into
Conversation
Qcom platforms has the legacy of using non-standard SCM calls splintered over the various kernel drivers. These SCM calls aren't compliant with the standard SMC calling conventions which is a prerequisite to enable migration to the FF-A specifications from Arm. OP-TEE as an alternative trusted OS to Qualcomm TEE (QTEE) can't support these non-standard SCM calls. And even for newer architectures using S-EL2 with Hafnium support, QTEE won't be able to support SCM calls either with FF-A requirements coming in. And with both OP-TEE and QTEE drivers well integrated in the TEE subsystem, it makes further sense to reuse the TEE bus client drivers infrastructure. The added benefit of TEE bus infrastructure is that there is support for discoverable/enumerable services. With that client drivers don't have to manually invoke a special SCM call to know the service status. So enable the generic Peripheral Authentication Service (PAS) provided by the firmware. It acts as the common layer with different TZ backends plugged in whether it's an SCM implementation or a proper TEE bus based PAS service implementation. Reviewed-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> Tested-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> # Lemans Reviewed-by: Harshal Dev <harshal.dev@oss.qualcomm.com> Tested-by: Vignesh Viswanathan <vignesh.viswanathan@oss.qualcomm.com> # IPQ9650 Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260702115835.167602-2-sumit.garg@kernel.org Signed-off-by: Bjorn Andersson <andersson@kernel.org> (cherry picked from commit 08314e7) Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
With the availability of generic PAS service, let's add SCM calls as a backend to keep supporting legacy QTEE interfaces. The exported qcom_scm* wrappers will get dropped once all the client drivers get migrated as part of future patches. Tested-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> # Lemans Reviewed-by: Harshal Dev <harshal.dev@oss.qualcomm.com> Tested-by: Vignesh Viswanathan <vignesh.viswanathan@oss.qualcomm.com> # IPQ9650 Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260702115835.167602-3-sumit.garg@kernel.org Signed-off-by: Bjorn Andersson <andersson@kernel.org> (cherry picked from commit 5c1a297) Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
…drivers Similar to platform drivers (and others) create dedicated register and unregister functions and a macro to simplify modules that only need to handle driver registration in their init and exit handlers. Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> (cherry picked from commit a707eda) Link: https://lore.kernel.org/r/563931b951a69d579fa9a00134b09354c346789e.1765791463.git.u.kleine-koenig@baylibre.com [rsalveti: add the Link: trailer, which the upstream commit is missing; recovered from the lore op-tee archive, where the v2 posting matches both the commit diff and its author date] Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
Add support for Peripheral Authentication Service (PAS) driver based on TEE bus with OP-TEE providing the backend PAS service implementation. The TEE PAS service ABI is designed to be extensible with additional API as PTA_QCOM_PAS_CAPABILITIES. This allows to accommodate any future extensions of the PAS service needed while still maintaining backwards compatibility. Reviewed-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> Tested-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> # Lemans Reviewed-by: Harshal Dev <harshal.dev@oss.qualcomm.com> Tested-by: Vignesh Viswanathan <vignesh.viswanathan@oss.qualcomm.com> # IPQ9650 Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260702115835.167602-4-sumit.garg@kernel.org Signed-off-by: Bjorn Andersson <andersson@kernel.org> (cherry picked from commit b6f7978) [rsalveti: register the driver through struct device_driver's probe/remove callbacks, as this branch predates 71a3346 ("tee: Add probe, remove and shutdown bus callbacks to tee_client_driver"); that rework also requires converting every other tee client driver, so it is left out] Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
Add Sumit Garg as the maintainer for the Qualcomm generic Peripheral Authentication Service (PAS) as well as the PAS TEE backend driver. Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260702115835.167602-15-sumit.garg@kernel.org Signed-off-by: Bjorn Andersson <andersson@kernel.org> (cherry picked from commit 6701259) Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
Switch qcom_q6v5_pas client driver over to generic PAS TZ APIs. Generic PAS TZ service allows to support multiple TZ implementation backends like QTEE based SCM PAS service, OP-TEE based PAS service and any further future TZ backend service. Since qcom_q6v5_pas depends on MDT loader for PAS firmware loading, it has to be switched over to generic PAS APIs in this commit to avoid any build issues. Reviewed-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> Tested-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> # Lemans Tested-by: Vignesh Viswanathan <vignesh.viswanathan@oss.qualcomm.com> # IPQ9650 Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260702115835.167602-5-sumit.garg@kernel.org Signed-off-by: Bjorn Andersson <andersson@kernel.org> (cherry picked from commit 254030a) [rsalveti: keep this branch's PAS context allocation in qcom_pas_alloc_memory_region() and its dtb_pas_id guards, from 038ee40 ("FROMLIST: remoteproc: qcom: pas: Fix the dtb PAS context creation"), and keep qcom_mdt_pas_load() without the mem_region argument this branch's mdt_loader does not take] Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
Switch qcom_q6v5_mss client driver over to generic PAS TZ APIs. Generic PAS TZ service allows to support multiple TZ implementation backends like QTEE based SCM PAS service, OP-TEE based PAS service and any further future TZ backend service. Reviewed-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> Tested-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> # Lemans Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260702115835.167602-6-sumit.garg@kernel.org Signed-off-by: Bjorn Andersson <andersson@kernel.org> (cherry picked from commit f3b1357) [rsalveti: keep this branch's "qproc->version == MSS_MSM8953" condition, as f56052f ("remoteproc: qcom_q6v5_mss: Introduce need_pas_mem_setup") is not part of it] Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
Switch qcom_wcnss client driver over to generic PAS TZ APIs. Generic PAS TZ service allows to support multiple TZ implementation backends like QTEE based SCM PAS service, OP-TEE based PAS service and any further future TZ backend service. Reviewed-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> Tested-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> # Lemans Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260702115835.167602-7-sumit.garg@kernel.org Signed-off-by: Bjorn Andersson <andersson@kernel.org> (cherry picked from commit ea3b524) Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
Select PAS generic service driver to enable support for multiple PAS backends like OP-TEE in addition to SCM. Tested-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> # Lemans Tested-by: Vignesh Viswanathan <vignesh.viswanathan@oss.qualcomm.com> # IPQ9650 Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260702115835.167602-8-sumit.garg@kernel.org Signed-off-by: Bjorn Andersson <andersson@kernel.org> (cherry picked from commit c438325) Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
Switch drm/msm client drivers over to generic PAS TZ APIs. Generic PAS TZ service allows to support multiple TZ implementation backends like QTEE based SCM PAS service, OP-TEE based PAS service and any further future TZ backend service. Acked-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Reviewed-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> Tested-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> # Lemans Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260702115835.167602-9-sumit.garg@kernel.org Signed-off-by: Bjorn Andersson <andersson@kernel.org> (cherry picked from commit 0be72be) Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
Switch ipa client driver over to generic PAS TZ APIs. Generic PAS TZ service allows to support multiple TZ implementation backends like QTEE based SCM PAS service, OP-TEE based PAS service and any further future TZ backend service. Reviewed-by: Alex Elder <elder@riscstar.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Acked-by: Alex Elder <elder@riscstar.com> Link: https://lore.kernel.org/r/20260702115835.167602-12-sumit.garg@kernel.org Signed-off-by: Bjorn Andersson <andersson@kernel.org> (cherry picked from commit 85b88ce) Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
Switch qcom media client drivers over to generic PAS TZ APIs. Generic PAS TZ service allows to support multiple TZ implementation backends like QTEE based SCM PAS service, OP-TEE based PAS service and any further future TZ backend service. Reviewed-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> Tested-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> # Lemans Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260702115835.167602-10-sumit.garg@kernel.org Signed-off-by: Bjorn Andersson <andersson@kernel.org> (cherry picked from commit 94d3305) [rsalveti: convert this branch's PAS-context based iris and venus firmware paths instead, which upstream does not have: rename the context type and the init_image/mem_setup/metadata_release/prepare_and_auth_reset/shutdown/set_remote_state calls, and switch venus_firmware_init_auto_detect() to qcom_pas_is_available()/qcom_pas_supported(); qcom_scm_mem_protect_video_var() stays an SCM call, as upstream keeps it] Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
Commit 0be72be ("drm/msm: Switch to generic PAS TZ APIs") replaced the qcom_scm_is_available() check in adreno_zap_shader_load() with qcom_pas_is_available(). These are not equivalent: the former reports whether the SCM transport is up, the latter whether the TrustZone firmware implements the peripheral authentication service. On SC7180 Chromebooks (trogdor) TZ does not implement PAS at all. SCM call-availability queries return 0 for every PAS command while other services answer normally: svc 0x06 cmd 0x01 IS_CALL_AVAIL -> 1 svc 0x02 cmd 0x01 PAS_INIT_IMAGE -> 0 svc 0x02 cmd 0x05 PAS_AUTH_RESET -> 0 svc 0x02 cmd 0x07 PAS_IS_SUPPORTED -> 0 svc 0x0c cmd 0x16 MP_ASSIGN -> 1 svc 0x05 cmd 0x01 IO_READ -> 1 so qcom_scm_probe() never registers a PAS backend and qcom_pas_is_available() is false for the lifetime of the boot. That on its own need not matter, because sc7180-trogdor.dtsi does /delete-node/ &gpu_zap_shader;, and the intended path for such a board is for zap_shader_load_mdt() to find no zap-shader child, clear zap_available, return -ENODEV, and let the caller fall back to SECVID_TRUST_CNTL. The problem is the ordering. zap_available is a static initialised to true and is only ever cleared inside zap_shader_load_mdt(), but adreno_zap_shader_load() consults PAS before calling it. The discovery that decides whether a zap shader is needed at all can therefore never run, the flag is never cleared, and every call returns -EPROBE_DEFER: adreno 5000000.gpu: [drm:adreno_zap_shader_load] *ERROR* PAS is not available msm_dpu ae01000.display-controller: [drm:adreno_load_gpu] *ERROR* gpu hw init failed: -517 Nothing retries that deferral, either. adreno_zap_shader_load() is called from a6xx_hw_init() rather than from probe, so the -EPROBE_DEFER is not a probe return value: it propagates up until adreno_load_gpu() returns NULL. load_gpu() re-attempts on every DRM open while priv->gpu is NULL, each open fails identically, and PAS cannot become available in between - which is why the error repeats and userspace stays on llvmpipe. Move the availability check into zap_shader_load_mdt(), behind the zap-shader node lookup, so the driver only consults PAS once it knows it needs PAS. Boards with no zap-shader node take the intended -ENODEV fallback without ever asking, and boards that do have one keep the qcom_pas_is_available() gate. Fixes: 0be72be ("drm/msm: Switch to generic PAS TZ APIs") Link: https://lore.kernel.org/r/20260808034716.58888-1-phollinsky@holtechnik.com Signed-off-by: Paul Hollinsky <phollinsky@holtechnik.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Patchwork: https://patchwork.freedesktop.org/patch/747583/ Message-ID: <20260821081325.89088-1-phollinsky@holtechnik.com> Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com> (cherry picked from commit b7c0f84) Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
…tection Commit f3b1357 ("remoteproc: qcom_q6v5_mss: Switch to generic PAS TZ APIs") changed the probe-time gate for need_mem_protection platforms from qcom_scm_is_available() to qcom_pas_is_available(). Memory protection in this driver is implemented with qcom_scm_assign_mem(), which is a TZ service distinct from PAS. The only PAS call in the driver is qcom_pas_mem_setup(), and it is already guarded by need_pas_mem_setup. No descriptor sets both flags: sc7180, sc7280, sdm660, sdm845, msm8996 and msm8998 set need_mem_protection only, while msm8937, msm8940 and msm8953 set need_pas_mem_setup only. On TrustZone firmware that does not implement PAS - for example SC7180 Chromebooks, where call-availability queries report every QCOM_SCM_SVC_PIL command as unavailable - the modem consequently never probes: platform 4080000.remoteproc: deferred probe pending: (reason unknown) On those machines the modem is also what loads the WLAN firmware, so ath10k never receives QMI and wifi does not come up either. Gate memory protection on SCM availability as it was before, and require PAS only where a PAS call is actually issued. Keeping the SCM check matters: qcom_scm_assign_mem() passes __scm->mempool to qcom_tzmem_alloc() without testing __scm, so dropping the gate entirely would allow a NULL dereference when qcom_scm has not yet probed. Fixes: f3b1357 ("remoteproc: qcom_q6v5_mss: Switch to generic PAS TZ APIs") Link: https://lore.kernel.org/r/20260808034716.58888-1-phollinsky@holtechnik.com Signed-off-by: Paul Hollinsky <phollinsky@holtechnik.com> Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260821081540.89137-1-phollinsky@holtechnik.com Signed-off-by: Bjorn Andersson <andersson@kernel.org> (cherry picked from commit b853857) [rsalveti: gate on "desc->version == MSS_MSM8953", the condition this branch uses for the PAS memory setup, as f56052f ("remoteproc: qcom_q6v5_mss: Introduce need_pas_mem_setup") is not part of it] Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
Consumers may need to know which PAS backend is active, e.g. to decide whether SCM-specific calls apply. Add qcom_pas_get_backend() returning the active backend name (or NULL), and define QCOM_PAS_BACKEND_SCM/QCOM_PAS_BACKEND_TEE for consumers to match against. Use them in the SCM and OP-TEE backends too. Assisted-by: Copilot:claude-opus-4.8 Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez.ortiz@gmail.com> Co-developed-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260911-video-optee-pas-v1-v1-1-7bbddaaac5ba@kernel.org Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
qcom_scm_mem_protect_video_var() is only serviced by the SCM backend; with OP-TEE the TEE owns secure memory protection. Use qcom_pas_get_backend() to issue the SCM call only for the SCM backend. Assisted-by: Copilot:claude-opus-4.8 Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez.ortiz@gmail.com> Co-developed-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260911-video-optee-pas-v1-v1-2-7bbddaaac5ba@kernel.org [rsalveti: drop the hunk's qcom_pas_auth_and_reset() context, which this branch performs in iris_load_fw_to_memory() through the PAS context] Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
qcom_scm_mem_protect_video_var() is only serviced by the SCM backend; with OP-TEE the TEE owns secure memory protection. Use qcom_pas_get_backend() to issue the SCM call only for the SCM backend. Assisted-by: Copilot:claude-opus-4.8 Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260911-video-optee-pas-v1-v1-3-7bbddaaac5ba@kernel.org Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
…_ice_get() instead of NULL devm_of_qcom_ice_get() currently returns NULL if ICE SCM is not available or "qcom,ice" property is not found in DT. But this confuses the clients since NULL doesn't convey the reason for failure. So return proper error codes instead of NULL. Reported-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Tested-by: Sumit Garg <sumit.garg@oss.qualcomm.com> # OP-TEE as TZ Acked-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260518-qcom-ice-fix-v7-3-2a595382185b@oss.qualcomm.com Signed-off-by: Bjorn Andersson <andersson@kernel.org> (cherry picked from commit b9ab721) Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
…e_get() Now since the devm_of_qcom_ice_get() API never returns NULL, remove the NULL check and also simplify the error handling. Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Acked-by: Martin K. Petersen <martin.petersen@oracle.com> # UFS Tested-by: Sumit Garg <sumit.garg@oss.qualcomm.com> # OP-TEE as TZ Acked-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260518-qcom-ice-fix-v7-5-2a595382185b@oss.qualcomm.com Signed-off-by: Bjorn Andersson <andersson@kernel.org> (cherry picked from commit 4ac19b3) Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
Now since the devm_of_qcom_ice_get() API never returns NULL, remove the NULL check and also simplify the error handling. Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Acked-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Tested-by: Sumit Garg <sumit.garg@oss.qualcomm.com> # OP-TEE as TZ Acked-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260518-qcom-ice-fix-v7-4-2a595382185b@oss.qualcomm.com Signed-off-by: Bjorn Andersson <andersson@kernel.org> (cherry picked from commit 2ccbb3f) Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
… is not found When both 'ice' reg entry and 'qcom,ice' property are not found in DT, then it implies that ICE is not supported. So return -EOPNOTSUPP instead of -ENODEV to client drivers to specify ICE functionality is not supported. Fixes: b9ab721 ("soc: qcom: ice: Return proper error codes from devm_of_qcom_ice_get() instead of NULL") Reported-by: Marek Szyprowski <m.szyprowski@samsung.com> Closes: https://lore.kernel.org/linux-arm-msm/8bac0358-9da0-4cbb-98ee-333b85ba4908@samsung.com Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260520155704.130803-1-manivannan.sadhasivam@oss.qualcomm.com Signed-off-by: Bjorn Andersson <andersson@kernel.org> (cherry picked from commit 462a85f) Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
|
Merge Check Failed: No CR Numbers Found Error: No Change Request numbers were found. Please add Change Request numbers to your pull request description in the format CRs-Fixed: 12345 or link GitHub issues that are associated with Change Requests. |
PR #1129 — validate-patchPR: #1129
Final Summary
|
PR #1129 — checker-log-analyzerPR: #1129
Detailed report: Full report
|
Backport series enabling Peripheral Authentication Service (PAS) over OP-TEE on
qcom-6.18.y, so remoteproc firmware authenticates on platforms running a fully open
secure world (TF-A BL31 + OP-TEE, no Qualcomm TrustZone). 21 commits: 12 UPSTREAM,
5 BACKPORT, 1 FROMGIT, 3 FROMLIST.
Upstream v7.3-rc1 replaced the single SCM PAS implementation with a generic PAS layer
taking pluggable TZ backends, plus an OP-TEE backend that talks to the
cff7d191-7ca0-4784-af13-48223b9a4fbeTA instead of Qualcomm's proprietary PAS SCMcalls. Without it every PAS consumer fails on an OP-TEE secure world: the five lemans
DSPs stop at
Error in getting resource table: -5, the GPU falls back toSECVID_TRUST_CNTL, video never initialises. It has to land as a whole —
qcom_pas_probe()gains aqcom_pas_is_available()gate, so the consumer conversionswithout the TEE backend would turn today's loud failures into silent EPROBE_DEFERs.
(now registers only when
qcom_scm_is_pas_available(), which OP-TEE answers no to),the OP-TEE backend, the
tee_client_driverhelper it needs, MAINTAINERS.net/ipa, media (iris + venus), and the remoteproc
select QCOM_PAS. This branchalready carries patch 13/13 of the same series, 6ecc129 (ath12k), whose
select QCOM_PAScurrently names a symbol that does not exist — these make it real.Fixes:the above): adreno only checks PAS when a zap shaderis present; q6v5_mss no longer requires PAS for
qcom_scm_assign_mem()protection.and venus next fail at
qcom_scm_mem_protect_video_var, which only the SCM backendservices. The series exposes the active backend and skips that call for non-SCM ones.
Posted as
https://lore.kernel.org/all/20260911-video-optee-pas-v1-v1-0-7bbddaaac5ba@kernel.org/
(v1).
The five BACKPORTs are context-only except four, each explained in its own commit: the
PAS TEE service registers via
struct device_driverprobe/remove (this branch predates71a3346, see below); q6v5_pas keeps this branch's PAS-context placement from
FROMLIST 038ee40 and
qcom_mdt_pas_load()without themem_regionargument; bothq6v5_mss commits gate on
version == MSS_MSM8953, as f56052f is not on this branch;and the media commit converts this branch's downstream PAS-context iris/venus paths,
which upstream does not have.
Why the ICE patches are in this series
The branch is left half-applied by the upstream ICE fix series: it has cc160ce
(= d922113, the xarray race fix) and 633db9a (= 5a4dc80), but not
b9ab721, which makes
qcom_ice_create()return an ERR_PTR instead of NULL. So onany secure world without TZ ICE — every OP-TEE platform —
qcom_ice_probe()fails andstores nothing in
ice_handles, and consumers readxa_load() == NULLas "not probedyet" and get -EPROBE_DEFER forever:
ufs_qcom_ice_init()then defers permanently,ufs_qcom_init()never completes, UFSnever probes and the rootfs never appears — a boot that stops mid-UFS-probe with no
getty, easily misread as a console failure. This is the failure d922113 describes
("devm_of_qcom_ice_get() loops with -EPROBE_DEFER, leaving consumers non-functional even
when ICE should be gracefully disabled"), and it is Tested-by: Sumit Garg "# OP-TEE as
TZ". Completing the series makes the probe store the error, so consumers get -EOPNOTSUPP
and UFS logs
Disabling inline encryption supportand continues. Both consumer cleanups(ufs-qcom, sdhci-msm) are taken so no NULL-checking caller is left, and 462a85f
because it
Fixes:b9ab721. This is not PAS- or board-specific: any platform herewhose ICE probe fails currently loses UFS or eMMC.
Deliberately not taken
71a3346 ("tee: Add probe, remove and shutdown bus callbacks to tee_client_driver"):
it sets
tee_bus_type.probewhile the legacy shim is installed only inside__tee_client_driver_register(), so the six tee client drivers here that calldriver_register()directly would bind but never probe — taking it means taking the15-patch conversion of all of them, so the PAS TEE driver is adapted instead.
Also left out: late attach (16472c9) and needs_tzmem (c220006), features not
enablement; 9db31ed and 34b8b2d, the latter fixing late-attach code absent
here; Kconfig cosmetics (8fecd31) and SCM tracepoints (41329e7);
a5464fa / c06c5ab, already present as FROMLIST 038ee40; c709c76
(ICE IP version > v3); and the platform additions, QSEECOM allow-lists and mdt_loader
renames in the same range.
Known gaps
qcom_scm_mem_protect_video_var, but now reportsfailed to suspend. Upstream'slemans-el2.dtsodisables&irisoutright, while thisbranch's keeps it enabled, so there is no upstream behaviour to compare against.
a6xx_irq ... gpu fault/a6xx_recover. Pre-existing and not PAS-related — v7.3-rc3 does the same here.qcom_ice_probe()keeps a now-unreachableif (!engine) return -EOPNOTSUPP;behindthis branch's downstream OPP hunk. Left alone so the upstream picks stay faithful;
worth a separate cleanup.
CONFIG_QCOMTEE=yhere (upstream=m), so the QTEE smcinvoke driver probes and OP-TEErejects its calls (
Unknown SMC 0x72000602). Harmless but noisy.SHM Bridge not supported,download mode: -22,qseecom ... -5,osm-l3 ... hardware not enabled, and theqcom/sa8775p/qupv3fw.elfload. Those need TF-A/OP-TEE work.lands.