[PATCH v4 09/13] iommu/arm-smmu-v3: Implement set_dev_pasid
Michael Shavit
mshavit at google.com
Thu Jul 13 01:44:45 PDT 2023
On Wed, Jun 21, 2023 at 2:44 PM Michael Shavit <mshavit at google.com> wrote:
> + mutex_lock(&arm_smmu_asid_lock);
> + ret = arm_smmu_write_ctx_desc(master->smmu, master->s1_cfg, master,
> + pasid, &smmu_domain->cd);
> + if (ret) {
> + mutex_unlock(&arm_smmu_asid_lock);
> + kfree(attached_domain);
> + }
> +
> + spin_lock_irqsave(&smmu_domain->attached_domains_lock, flags);
> + list_add(&attached_domain->domain_head, &smmu_domain->attached_domains);
> + spin_unlock_irqrestore(&smmu_domain->attached_domains_lock, flags);
> + mutex_unlock(&arm_smmu_asid_lock);
> +
> + return 0;
A small bug in this patch as well: we return 0 when
arm_smmu_write_ctx_desc() fails instead of the error. Will upload fix
in v5.
More information about the linux-arm-kernel
mailing list