@@ -351,6 +351,15 @@ static struct arm_smmu_cmdq *arm_smmu_get_cmdq(struct arm_smmu_device *smmu)
351351 return & smmu -> cmdq ;
352352}
353353
354+ static bool arm_smmu_cmdq_needs_busy_polling (struct arm_smmu_device * smmu ,
355+ struct arm_smmu_cmdq * cmdq )
356+ {
357+ if (cmdq == & smmu -> cmdq )
358+ return false;
359+
360+ return smmu -> options & ARM_SMMU_OPT_TEGRA241_CMDQV ;
361+ }
362+
354363static void arm_smmu_cmdq_build_sync_cmd (u64 * cmd , struct arm_smmu_device * smmu ,
355364 struct arm_smmu_cmdq * cmdq , u32 prod )
356365{
@@ -369,6 +378,8 @@ static void arm_smmu_cmdq_build_sync_cmd(u64 *cmd, struct arm_smmu_device *smmu,
369378 }
370379
371380 arm_smmu_cmdq_build_cmd (cmd , & ent );
381+ if (arm_smmu_cmdq_needs_busy_polling (smmu , cmdq ))
382+ u64p_replace_bits (cmd , CMDQ_SYNC_0_CS_NONE , CMDQ_SYNC_0_CS );
372383}
373384
374385void __arm_smmu_cmdq_skip_err (struct arm_smmu_device * smmu ,
@@ -423,6 +434,8 @@ void __arm_smmu_cmdq_skip_err(struct arm_smmu_device *smmu,
423434
424435 /* Convert the erroneous command into a CMD_SYNC */
425436 arm_smmu_cmdq_build_cmd (cmd , & cmd_sync );
437+ if (arm_smmu_cmdq_needs_busy_polling (smmu , cmdq ))
438+ u64p_replace_bits (cmd , CMDQ_SYNC_0_CS_NONE , CMDQ_SYNC_0_CS );
426439
427440 queue_write (Q_ENT (q , cons ), cmd , q -> ent_dwords );
428441}
@@ -706,7 +719,8 @@ static int arm_smmu_cmdq_poll_until_sync(struct arm_smmu_device *smmu,
706719 struct arm_smmu_cmdq * cmdq ,
707720 struct arm_smmu_ll_queue * llq )
708721{
709- if (smmu -> options & ARM_SMMU_OPT_MSIPOLL )
722+ if (smmu -> options & ARM_SMMU_OPT_MSIPOLL &&
723+ !arm_smmu_cmdq_needs_busy_polling (smmu , cmdq ))
710724 return __arm_smmu_cmdq_poll_until_msi (smmu , cmdq , llq );
711725
712726 return __arm_smmu_cmdq_poll_until_consumed (smmu , cmdq , llq );
0 commit comments