Skip to content

Commit 2ea1f01

Browse files
nicolincwilldeacon
authored andcommitted
iommu/arm-smmu-v3: Pass in cmdq pointer to arm_smmu_cmdq_build_sync_cmd
The CMDQV extension on NVIDIA Tegra241 SoC only supports CS_NONE in the CS field of CMD_SYNC, v.s. standard SMMU CMDQ. Pass in the cmdq pointer directly, so the function can identify a different cmdq implementation. Reviewed-by: Jason Gunthorpe <[email protected]> Signed-off-by: Nicolin Chen <[email protected]> Link: https://lore.kernel.org/r/723288287997b6dfbcd2a904d2c11e9b23f82250.1724970714.git.nicolinc@nvidia.com Signed-off-by: Will Deacon <[email protected]>
1 parent 56ae886 commit 2ea1f01

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,9 @@ static struct arm_smmu_cmdq *arm_smmu_get_cmdq(struct arm_smmu_device *smmu)
352352
}
353353

354354
static void arm_smmu_cmdq_build_sync_cmd(u64 *cmd, struct arm_smmu_device *smmu,
355-
struct arm_smmu_queue *q, u32 prod)
355+
struct arm_smmu_cmdq *cmdq, u32 prod)
356356
{
357+
struct arm_smmu_queue *q = &cmdq->q;
357358
struct arm_smmu_cmdq_ent ent = {
358359
.opcode = CMDQ_OP_CMD_SYNC,
359360
};
@@ -371,14 +372,15 @@ static void arm_smmu_cmdq_build_sync_cmd(u64 *cmd, struct arm_smmu_device *smmu,
371372
}
372373

373374
static void __arm_smmu_cmdq_skip_err(struct arm_smmu_device *smmu,
374-
struct arm_smmu_queue *q)
375+
struct arm_smmu_cmdq *cmdq)
375376
{
376377
static const char * const cerror_str[] = {
377378
[CMDQ_ERR_CERROR_NONE_IDX] = "No error",
378379
[CMDQ_ERR_CERROR_ILL_IDX] = "Illegal command",
379380
[CMDQ_ERR_CERROR_ABT_IDX] = "Abort on command fetch",
380381
[CMDQ_ERR_CERROR_ATC_INV_IDX] = "ATC invalidate timeout",
381382
};
383+
struct arm_smmu_queue *q = &cmdq->q;
382384

383385
int i;
384386
u64 cmd[CMDQ_ENT_DWORDS];
@@ -427,7 +429,7 @@ static void __arm_smmu_cmdq_skip_err(struct arm_smmu_device *smmu,
427429

428430
static void arm_smmu_cmdq_skip_err(struct arm_smmu_device *smmu)
429431
{
430-
__arm_smmu_cmdq_skip_err(smmu, &smmu->cmdq.q);
432+
__arm_smmu_cmdq_skip_err(smmu, &smmu->cmdq);
431433
}
432434

433435
/*
@@ -790,7 +792,7 @@ static int arm_smmu_cmdq_issue_cmdlist(struct arm_smmu_device *smmu,
790792
arm_smmu_cmdq_write_entries(cmdq, cmds, llq.prod, n);
791793
if (sync) {
792794
prod = queue_inc_prod_n(&llq, n);
793-
arm_smmu_cmdq_build_sync_cmd(cmd_sync, smmu, &cmdq->q, prod);
795+
arm_smmu_cmdq_build_sync_cmd(cmd_sync, smmu, cmdq, prod);
794796
queue_write(Q_ENT(&cmdq->q, prod), cmd_sync, CMDQ_ENT_DWORDS);
795797

796798
/*

0 commit comments

Comments
 (0)