On 18/10/18 11:55, John Garry wrote:
[...]
@@ -976,18 +1019,19 @@ static int __arm_smmu_cmdq_issue_sync(struct arm_smmu_device *smmu)
 {
     u64 cmd[CMDQ_ENT_DWORDS];
     unsigned long flags;
-    bool wfe = !!(smmu->features & ARM_SMMU_FEAT_SEV);
     struct arm_smmu_cmdq_ent ent = { .opcode = CMDQ_OP_CMD_SYNC };
-    int ret;
+    int sync_idx, sync_gen;

     arm_smmu_cmdq_build_cmd(cmd, &ent);

     spin_lock_irqsave(&smmu->cmdq.lock, flags);
-    arm_smmu_cmdq_insert_cmd(smmu, cmd);
-    ret = queue_poll_cons(&smmu->cmdq.q, true, wfe);
+    if (smmu->prev_cmd_opcode != CMDQ_OP_CMD_SYNC)
+        arm_smmu_cmdq_insert_cmd(smmu, cmd);

Hi Robin,

If we did stop rebuilding the non-MSI command as I suggested, then we would not have the case of building the command and then discarding it, right?

I suppose so. But that build/discard case can also be avoided by applying patch 2/2 of this series ;)

Robin.


Thanks,
John

+    sync_idx = smmu->cmdq.q.prod;
+    sync_gen = READ_ONCE(smmu->cmdq_generation);
     spin_unlock_irqrestore(&smmu->cmdq.lock, flags);

-    return ret;
+    return arm_smmu_sync_poll_cons(smmu, sync_idx, sync_gen);
 }

 static void arm_smmu_cmdq_issue_sync(struct arm_smmu_device *smmu)



_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to