Skip to content

Commit 2cbeaf3

Browse files
Zhen Leiwilldeacon
authored andcommitted
iommu/arm-smmu-v3: Extract reusable function __arm_smmu_cmdq_skip_err()
When SMMU_GERROR.CMDQP_ERR is different to SMMU_GERRORN.CMDQP_ERR, it indicates that one or more errors have been encountered on a command queue control page interface. We need to traverse all ECMDQs in that control page to find all errors. For each ECMDQ error handling, it is much the same as the CMDQ error handling. This common processing part is extracted as a new function __arm_smmu_cmdq_skip_err(). Signed-off-by: Zhen Lei <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 8639cc8 commit 2cbeaf3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,8 @@ static void arm_smmu_cmdq_build_sync_cmd(u64 *cmd, struct arm_smmu_device *smmu,
359359
arm_smmu_cmdq_build_cmd(cmd, &ent);
360360
}
361361

362-
static void arm_smmu_cmdq_skip_err(struct arm_smmu_device *smmu)
362+
static void __arm_smmu_cmdq_skip_err(struct arm_smmu_device *smmu,
363+
struct arm_smmu_queue *q)
363364
{
364365
static const char * const cerror_str[] = {
365366
[CMDQ_ERR_CERROR_NONE_IDX] = "No error",
@@ -370,7 +371,6 @@ static void arm_smmu_cmdq_skip_err(struct arm_smmu_device *smmu)
370371

371372
int i;
372373
u64 cmd[CMDQ_ENT_DWORDS];
373-
struct arm_smmu_queue *q = &smmu->cmdq.q;
374374
u32 cons = readl_relaxed(q->cons_reg);
375375
u32 idx = FIELD_GET(CMDQ_CONS_ERR, cons);
376376
struct arm_smmu_cmdq_ent cmd_sync = {
@@ -417,6 +417,11 @@ static void arm_smmu_cmdq_skip_err(struct arm_smmu_device *smmu)
417417
queue_write(Q_ENT(q, cons), cmd, q->ent_dwords);
418418
}
419419

420+
static void arm_smmu_cmdq_skip_err(struct arm_smmu_device *smmu)
421+
{
422+
__arm_smmu_cmdq_skip_err(smmu, &smmu->cmdq.q);
423+
}
424+
420425
/*
421426
* Command queue locking.
422427
* This is a form of bastardised rwlock with the following major changes:

0 commit comments

Comments
 (0)