Skip to content

Commit 07f34a1

Browse files
committed
Merge tag 'arm-smmu-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux into arm/smmu
Arm SMMU updates for 5.16 - Minor optimisations to SMMUv3 command creation and submission - Numerous new compatible string for Qualcomm SMMUv2 implementations
2 parents 5816b3e + e37f1fe commit 07f34a1

3 files changed

Lines changed: 19 additions & 7 deletions

File tree

Documentation/devicetree/bindings/iommu/arm,smmu.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ properties:
3333
- description: Qcom SoCs implementing "arm,mmu-500"
3434
items:
3535
- enum:
36+
- qcom,qcm2290-smmu-500
3637
- qcom,sc7180-smmu-500
3738
- qcom,sc7280-smmu-500
3839
- qcom,sc8180x-smmu-500
3940
- qcom,sdm845-smmu-500
41+
- qcom,sm6350-smmu-500
4042
- qcom,sm8150-smmu-500
4143
- qcom,sm8250-smmu-500
4244
- qcom,sm8350-smmu-500

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

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -409,10 +409,7 @@ static void __arm_smmu_cmdq_skip_err(struct arm_smmu_device *smmu,
409409
dev_err(smmu->dev, "\t0x%016llx\n", (unsigned long long)cmd[i]);
410410

411411
/* Convert the erroneous command into a CMD_SYNC */
412-
if (arm_smmu_cmdq_build_cmd(cmd, &cmd_sync)) {
413-
dev_err(smmu->dev, "failed to convert to CMD_SYNC\n");
414-
return;
415-
}
412+
arm_smmu_cmdq_build_cmd(cmd, &cmd_sync);
416413

417414
queue_write(Q_ENT(q, cons), cmd, q->ent_dwords);
418415
}
@@ -860,7 +857,7 @@ static int __arm_smmu_cmdq_issue_cmd(struct arm_smmu_device *smmu,
860857
{
861858
u64 cmd[CMDQ_ENT_DWORDS];
862859

863-
if (arm_smmu_cmdq_build_cmd(cmd, ent)) {
860+
if (unlikely(arm_smmu_cmdq_build_cmd(cmd, ent))) {
864861
dev_warn(smmu->dev, "ignoring unknown CMDQ opcode 0x%x\n",
865862
ent->opcode);
866863
return -EINVAL;
@@ -885,11 +882,20 @@ static void arm_smmu_cmdq_batch_add(struct arm_smmu_device *smmu,
885882
struct arm_smmu_cmdq_batch *cmds,
886883
struct arm_smmu_cmdq_ent *cmd)
887884
{
885+
int index;
886+
888887
if (cmds->num == CMDQ_BATCH_ENTRIES) {
889888
arm_smmu_cmdq_issue_cmdlist(smmu, cmds->cmds, cmds->num, false);
890889
cmds->num = 0;
891890
}
892-
arm_smmu_cmdq_build_cmd(&cmds->cmds[cmds->num * CMDQ_ENT_DWORDS], cmd);
891+
892+
index = cmds->num * CMDQ_ENT_DWORDS;
893+
if (unlikely(arm_smmu_cmdq_build_cmd(&cmds->cmds[index], cmd))) {
894+
dev_warn(smmu->dev, "ignoring unknown CMDQ opcode 0x%x\n",
895+
cmd->opcode);
896+
return;
897+
}
898+
893899
cmds->num++;
894900
}
895901

@@ -1764,10 +1770,11 @@ static int arm_smmu_atc_inv_master(struct arm_smmu_master *master)
17641770
{
17651771
int i;
17661772
struct arm_smmu_cmdq_ent cmd;
1767-
struct arm_smmu_cmdq_batch cmds = {};
1773+
struct arm_smmu_cmdq_batch cmds;
17681774

17691775
arm_smmu_atc_inv_to_cmd(0, 0, 0, &cmd);
17701776

1777+
cmds.num = 0;
17711778
for (i = 0; i < master->num_streams; i++) {
17721779
cmd.atc.sid = master->streams[i].id;
17731780
arm_smmu_cmdq_batch_add(master->smmu, &cmds, &cmd);

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ static const struct of_device_id qcom_smmu_client_of_match[] __maybe_unused = {
231231
{ .compatible = "qcom,sc7180-mdss" },
232232
{ .compatible = "qcom,sc7180-mss-pil" },
233233
{ .compatible = "qcom,sc7280-mdss" },
234+
{ .compatible = "qcom,sc7280-mss-pil" },
234235
{ .compatible = "qcom,sc8180x-mdss" },
235236
{ .compatible = "qcom,sdm845-mdss" },
236237
{ .compatible = "qcom,sdm845-mss-pil" },
@@ -403,12 +404,14 @@ static struct arm_smmu_device *qcom_smmu_create(struct arm_smmu_device *smmu,
403404

404405
static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = {
405406
{ .compatible = "qcom,msm8998-smmu-v2" },
407+
{ .compatible = "qcom,qcm2290-smmu-500" },
406408
{ .compatible = "qcom,sc7180-smmu-500" },
407409
{ .compatible = "qcom,sc7280-smmu-500" },
408410
{ .compatible = "qcom,sc8180x-smmu-500" },
409411
{ .compatible = "qcom,sdm630-smmu-v2" },
410412
{ .compatible = "qcom,sdm845-smmu-500" },
411413
{ .compatible = "qcom,sm6125-smmu-500" },
414+
{ .compatible = "qcom,sm6350-smmu-500" },
412415
{ .compatible = "qcom,sm8150-smmu-500" },
413416
{ .compatible = "qcom,sm8250-smmu-500" },
414417
{ .compatible = "qcom,sm8350-smmu-500" },

0 commit comments

Comments
 (0)