Re: [PATCH 2/2] dmaengine: qcom: bam_dma: SCM-assign descriptor FIFOs to a remote VMID

Konrad Dybcio <[email protected]>
Newsgroups org.kernel.vger.dmaengine,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On 7/14/26 7:00 AM, Vishnu Santhosh wrote:
> On Qualcomm SoCs where the BAM is powered by a remote processor that
> enforces XPU access control (e.g. the mDSP on Shikra, VMID 43 / NAV),
> the BAM reads the descriptor FIFO as an AXI master under the remote
> execution environment. Without an SCM grant for the remote VMID, the
> first descriptor enqueue faults with an XPU violation.

[...]

> +	ret = of_property_read_u32_array(dev->of_node, "qcom,vmid",
> +					 bdev->vmids, n);
> +	if (ret)
> +		return ret;
> +
> +	for (i = 0; i < n; i++) {
> +		if (bdev->vmids[i] == QCOM_SCM_VMID_HLOS) {
> +			dev_err(dev, "qcom,vmid must not include HLOS (%u)\n",
> +				QCOM_SCM_VMID_HLOS);
> +			return -EINVAL;
> +		}
> +	}

Please switch to device_property_ instead

[...]

> +static int bam_assign_fifo(struct bam_device *bdev, struct bam_chan *bchan)
> +{
> +	struct qcom_scm_vmperm *dst __free(kfree) = NULL;
> +	u64 src = BIT_ULL(QCOM_SCM_VMID_HLOS);
> +	int i, ret;
> +
> +	if (!bdev->num_vmids)
> +		return 0;
> +
> +	dst = kcalloc(bdev->num_vmids + 1, sizeof(*dst), GFP_KERNEL);
> +	if (!dst)
> +		return -ENOMEM;

Please reshuffle this to follow

7c4c14ad3d8c ("tee: qcomtee: mem: Fix confusing cleanup.h syntax")

Konrad
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.