From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: firmware: qcom_scm: Migrate to generic PAS service Date: Fri, 13 Mar 2026 14:26:31 +1000 Message-ID: In-Reply-To: <20260312062756.694390-4-sumit.garg@kernel.org> References: <20260312062756.694390-1-sumit.garg@kernel.org> <20260312062756.694390-4-sumit.garg@kernel.org> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review This patch wraps existing SCM functions as `qcom_pas_ops` callbacks and registers them from `qcom_scm_probe()`. Key concerns: **Unsafe type punning.** Throughout this patch, `qcom_scm_pas_context` is cast to/from `qcom_pas_context` via C casts like `(struct qcom_pas_context *)ctx` (e.g., line 1102, 1216, 1458). These two structs happen to have identical layouts, but there's no compile-time enforcement. In `devm_qcom_scm_pas_context_alloc()`, a `qcom_pas_context` is allocated but returned as `qcom_scm_pas_context *`: ```c return (struct qcom_scm_pas_context *)ctx; ``` This is fragile and technically violates strict aliasing. Since the old wrappers are removed in patch 14, this is transitional, but it would be cleaner to just typedef one to the other or use a union. **Registration ordering.** The ops are registered in `qcom_scm_probe()` after `__get_convention()` but before download mode setup. If any PAS client probes very early (deferred probe retry), there could be a brief window. However, the `qcom_pas_is_available()` check should gate this adequately. **`qcom_scm_is_pas_available()` only checks `PAS_AUTH_AND_RESET`.** This is a reasonable heuristic but could miss platforms that support some PAS calls but not others. --- Generated by Claude Code Patch Reviewer