[PATCH ath-next] wifi: ath12k: add support to load shared firmware on multiPD

Jeff Johnson jeff.johnson at oss.qualcomm.com
Fri Aug 14 11:24:44 PDT 2026


On 8/10/2026 10:43 PM, Aaradhana Sahu wrote:
> +static int ath12k_ahb_load_auth_shared_fw(struct ath12k_base *ab,
> +					  struct ath12k_ahb_rproc_info *rproc_info,
> +					  const char *fw_name, u32 pasid)
> +{
> +	int ret;
> +
> +	const struct firmware *fw __free(firmware) = NULL;
> +	ret = request_firmware(&fw, fw_name, ab->dev);
> +	if (ret) {
> +		ath12k_err(ab, "failed to request shared firmware %s: %d\n",
> +			   fw_name, ret);
> +		return ret;
> +	}
> +
> +	if (!fw->size) {
> +		ath12k_err(ab, "Invalid firmware size\n");
> +		return -EINVAL;
> +	}
> +
> +	ath12k_dbg(ab, ATH12K_DBG_AHB, "loading firmware %s, size %zd\n", fw_name,
> +		   fw->size);
> +
> +	ret = qcom_mdt_load(ab->dev, fw, fw_name, pasid, rproc_info->mem_region,
> +			    rproc_info->mem_phys, rproc_info->mem_size, NULL);
> +	if (ret) {
> +		ath12k_err(ab, "failed to load RO firmware %s: %d\n", fw_name, ret);
> +		return ret;
> +	}
> +
> +	ret = qcom_pas_auth_and_reset(pasid);
> +	if (ret)
> +		ath12k_err(ab, "failed to authenticate and boot shared firmware: %d\n",
> +			   ret);

my review agent says:
qcom_mdt_load() calls qcom_scm_pas_init_image() and qcom_scm_pas_mem_setup()
internally, which register the PASID with TrustZone. If that succeeds but the
subsequent qcom_pas_auth_and_reset() fails, the PASID remains registered in
SCM with no corresponding shutdown. The caller
(ath12k_ahb_load_shared_firmware()) calls ath12k_ahb_put_fw_load_region() on
this error path, but does not call qcom_pas_shutdown(). On the next probe or
reset cycle, qcom_mdt_load() calls qcom_scm_pas_init_image() again on an
already-registered PASID; SCM returns an error and firmware loading is
permanently broken until a full platform reset.

and it suggest calling qcom_pas_shutdown(pasid)

        ret = qcom_pas_auth_and_reset(pasid);
        if (ret) {
                ath12k_err(...);
                qcom_pas_shutdown(pasid);
        }
        return ret;


> +	return ret;
> +}
> +



More information about the ath12k mailing list