Skip to contentSkip to conversation

iommu/arm-smmu-v3: Fix bugs and typos in arm_smmu_invs series

PATCH Applied Nicolin Chen 4 participants 7 messages Mar 21 – Mar 24

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover iommu/arm-smmu-v3: Fix bugs and typos in arm_smmu_invs series

Hi Will,

Thank you for taking the series!

I found a couple of small issues in those commits. And here are the fixes.

Thanks
Nicolin

Nicolin Chen (2):
iommu/arm-smmu-v3: Do not continue in __arm_smmu_domain_inv_range() iommu/arm-smmu-v3: Fix typos introduced by arm_smmu_invs

 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 10 +++++-----
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/2 iommu/arm-smmu-v3: Do not continue in __arm_smmu_domain_inv_range()

The loop in the __arm_smmu_domain_inv_range() is a while loop, not a for loop. So, using "continue" is wrong that would fail to move the needle.

Meanwhile, though the current command is skipped, the batch still has to go through arm_smmu_invs_end_batch() to be issued accordingly.

Thus, use "break" to fix the issue.

Fixes 587bb3e56a2c ("iommu/arm-smmu-v3: Add arm_smmu_invs based arm_smmu_domain_inv_range()")
---
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +2 -2
index 01030ffd2fe23..c3c6987da9506 100644
@@ -2688,7 +2688,7 @@ static void __arm_smmu_domain_inv_range(struct arm_smmu_invs *invs,
 		case INV_TYPE_S2_VMID_S1_CLEAR:
 			/* CMDQ_OP_TLBI_S12_VMALL already flushed S1 entries */
 			if (arm_smmu_inv_size_too_big(cur->smmu, size, granule))
-				continue;
+				break;
 			cmd.tlbi.vmid = cur->id;
 			arm_smmu_cmdq_batch_add(smmu, &cmds, &cmd);
 			break;
@@ -2704,7 +2704,7 @@ static void __arm_smmu_domain_inv_range(struct arm_smmu_invs *invs,
 			break;
 		default:
 			WARN_ON_ONCE(1);
-			continue;
+			break;
 		}
 
 		/* Skip any trash entry in-between */
Signature · 1 line
2.43.0
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] iommu/arm-smmu-v3: Do not continue in __arm_smmu_domain_inv_range()

Quoted 6 lines · Nicolin Chen

The loop in the __arm_smmu_domain_inv_range() is a while loop, not a for loop. So, using "continue" is wrong that would fail to move the needle.

Meanwhile, though the current command is skipped, the batch still has to go through arm_smmu_invs_end_batch() to be issued accordingly.

Quoted 7 lines

Thus, use "break" to fix the issue.

Fixes 587bb3e56a2c ("iommu/arm-smmu-v3: Add arm_smmu_invs based arm_smmu_domain_inv_range()")
---
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Jason

Reviewed-by on v1 1/2
#3 lore raw

Re: [PATCH 1/2] iommu/arm-smmu-v3: Do not continue in __arm_smmu_domain_inv_range()

In reply to Nicolin Chen
Quoted 6 lines · Nicolin Chen

The loop in the __arm_smmu_domain_inv_range() is a while loop, not a for loop. So, using "continue" is wrong that would fail to move the needle.

Meanwhile, though the current command is skipped, the batch still has to go through arm_smmu_invs_end_batch() to be issued accordingly.

Quoted 8 lines

Thus, use "break" to fix the issue.

Fixes 587bb3e56a2c ("iommu/arm-smmu-v3: Add arm_smmu_invs based arm_smmu_domain_inv_range()")
---
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Thanks,
Praan

#4 lore raw

PATCH 2/2 iommu/arm-smmu-v3: Fix typos introduced by arm_smmu_invs

In reply to Nicolin Chen

These are introduced by separate commits, so not submitting with a "Fixes" line, since they aren't critical.

---
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 6 +++---
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +3 -3
index c3c6987da9506..b841efbcc9e9b 100644
@@ -1128,7 +1128,7 @@ static inline int arm_smmu_invs_iter_next_cmp(struct arm_smmu_invs *invs_l,
  * Both @invs and @to_merge must be sorted, to ensure the returned array will be
  * sorted as well.
  *
- * Caller is resposible for freeing the @invs and the returned new one.
+ * Caller is responsible for freeing the @invs and the returned new one.
  *
  * Entries marked as trash will be purged in the returned array.
  */
@@ -1258,7 +1258,7 @@ EXPORT_SYMBOL_IF_KUNIT(arm_smmu_invs_unref);
  * This function must be locked and serialized with arm_smmu_invs_merge() and
  * arm_smmu_invs_unref(), but do not lockdep on any lock for KUNIT test.
  *
- * Caller is resposible for freeing the @invs and the returned new one.
+ * Caller is responsible for freeing the @invs and the returned new one.
  */
 VISIBLE_IF_KUNIT
 struct arm_smmu_invs *arm_smmu_invs_purge(struct arm_smmu_invs *invs)
@@ -2739,7 +2739,7 @@ void arm_smmu_domain_inv_range(struct arm_smmu_domain *smmu_domain,
 	 * But in a race, these two can be interdependent, making it a special
 	 * case requiring an additional smp_mb() for the write->read ordering.
 	 * Pairing with the dma_wmb() in arm_smmu_install_ste_for_dev(), this
-	 * makes sure that IOPTE update prior to this point is visable to SMMU
+	 * makes sure that IOPTE update prior to this point is visible to SMMU
 	 * hardware before we load the updated invalidation array.
 	 *
 	 *  [CPU0]                        | [CPU1]
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h +1 -1
index 36de2b0b2ebe6..ef42df4753ec4 100644
@@ -687,7 +687,7 @@ static inline bool arm_smmu_inv_is_ats(const struct arm_smmu_inv *inv)
  *            greater than @max_invs
  * @num_trashes: number of trash entries in the array for arm_smmu_invs_purge().
  *               Must not be greater than @num_invs
- * @rwlock: optional rwlock to fench ATS operations
+ * @rwlock: optional rwlock to fence ATS operations
  * @has_ats: flag if the array contains an INV_TYPE_ATS or INV_TYPE_ATS_FULL
  * @rcu: rcu head for kfree_rcu()
  * @inv: flexible invalidation array
Signature · 1 line
2.43.0
Reviewed-by on v1 2/2
#5 lore raw

Re: [PATCH 2/2] iommu/arm-smmu-v3: Fix typos introduced by arm_smmu_invs

Quoted 8 lines · Nicolin Chen

These are introduced by separate commits, so not submitting with a "Fixes" line, since they aren't critical.

---
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 6 +++---
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

Some of those might have come from me

Jason

maintainer Applied
#6 lore raw
In reply to Nicolin Chen
Quoted 8 lines · Nicolin Chen

Thank you for taking the series!

I found a couple of small issues in those commits. And here are the fixes.

Thanks
Nicolin

[...]

Applied to iommu (arm/smmu/updates), thanks!

[1/2] iommu/arm-smmu-v3: Do not continue in __arm_smmu_domain_inv_range()

      https://git.kernel.org/iommu/c/6a01b9f0a5ec
[2/2] iommu/arm-smmu-v3: Fix typos introduced by arm_smmu_invs
      https://git.kernel.org/iommu/c/86bf8580d5b8

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev