[PATCH v3 3/7] iommu/arm-smmu-v3: Introduce a per-domain arm_smmu_invs array

Nicolin Chen nicolinc at nvidia.com
Thu Oct 16 14:31:54 PDT 2025


On Wed, Oct 15, 2025 at 12:42:48PM -0700, Nicolin Chen wrote:
> +size_t arm_smmu_invs_unref(struct arm_smmu_invs *invs,
> +			   struct arm_smmu_invs *to_unref,
> +			   void (*flush_fn)(struct arm_smmu_inv *inv))
> +{
> +	unsigned long flags;
> +	size_t num_trashes = 0;
> +	size_t num_invs = 0;
> +	size_t i, j;
> +
> +	for (i = j = 0; i != invs->num_invs || j != to_unref->num_invs;) {
> +		int cmp;
> +
> +		/* Skip any existing trash entry */
> +		if (cmp <= 0 && !refcount_read(&invs->inv[i].users)) {
> +			num_trashes++;
> +			i++;
> +			continue;
> +		}
> +
> +		cmp = arm_smmu_invs_cmp(invs, i, to_unref, j);

This should be moved upwards to "int cmp" before if.

Will fix in v4.

Nicolin



More information about the linux-arm-kernel mailing list