Skip to content

Commit 91d6988

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.17 - Revert evtq and priq back to their former sizes - Return early on short-descriptor page-table allocation failure - Fix page fault reporting for Adreno GPU on SMMUv2 - Make SMMUv3 MMU notifier ops 'const' - Numerous new compatible strings for Qualcomm SMMUv2 implementations
2 parents 0fcfb00 + 4774366 commit 91d6988

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ properties:
3838
- qcom,sc7280-smmu-500
3939
- qcom,sc8180x-smmu-500
4040
- qcom,sdm845-smmu-500
41+
- qcom,sdx55-smmu-500
4142
- qcom,sm6350-smmu-500
4243
- qcom,sm8150-smmu-500
4344
- qcom,sm8250-smmu-500
4445
- qcom,sm8350-smmu-500
46+
- qcom,sm8450-smmu-500
4547
- const: arm,mmu-500
4648
- description: Qcom Adreno GPUs implementing "arm,smmu-v2"
4749
items:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ static void arm_smmu_mmu_notifier_free(struct mmu_notifier *mn)
220220
kfree(mn_to_smmu(mn));
221221
}
222222

223-
static struct mmu_notifier_ops arm_smmu_mmu_notifier_ops = {
223+
static const struct mmu_notifier_ops arm_smmu_mmu_notifier_ops = {
224224
.invalidate_range = arm_smmu_mm_invalidate_range,
225225
.release = arm_smmu_mm_release,
226226
.free_notifier = arm_smmu_mmu_notifier_free,

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@
184184
#else
185185
#define Q_MAX_SZ_SHIFT (PAGE_SHIFT + MAX_ORDER - 1)
186186
#endif
187-
#define Q_MIN_SZ_SHIFT (PAGE_SHIFT)
188187

189188
/*
190189
* Stream table.
@@ -374,7 +373,7 @@
374373
/* Event queue */
375374
#define EVTQ_ENT_SZ_SHIFT 5
376375
#define EVTQ_ENT_DWORDS ((1 << EVTQ_ENT_SZ_SHIFT) >> 3)
377-
#define EVTQ_MAX_SZ_SHIFT (Q_MIN_SZ_SHIFT - EVTQ_ENT_SZ_SHIFT)
376+
#define EVTQ_MAX_SZ_SHIFT (Q_MAX_SZ_SHIFT - EVTQ_ENT_SZ_SHIFT)
378377

379378
#define EVTQ_0_ID GENMASK_ULL(7, 0)
380379

@@ -400,7 +399,7 @@
400399
/* PRI queue */
401400
#define PRIQ_ENT_SZ_SHIFT 4
402401
#define PRIQ_ENT_DWORDS ((1 << PRIQ_ENT_SZ_SHIFT) >> 3)
403-
#define PRIQ_MAX_SZ_SHIFT (Q_MIN_SZ_SHIFT - PRIQ_ENT_SZ_SHIFT)
402+
#define PRIQ_MAX_SZ_SHIFT (Q_MAX_SZ_SHIFT - PRIQ_ENT_SZ_SHIFT)
404403

405404
#define PRIQ_0_SID GENMASK_ULL(31, 0)
406405
#define PRIQ_0_SSID GENMASK_ULL(51, 32)

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static void qcom_adreno_smmu_get_fault_info(const void *cookie,
5151
info->fsynr1 = arm_smmu_cb_read(smmu, cfg->cbndx, ARM_SMMU_CB_FSYNR1);
5252
info->far = arm_smmu_cb_readq(smmu, cfg->cbndx, ARM_SMMU_CB_FAR);
5353
info->cbfrsynra = arm_smmu_gr1_read(smmu, ARM_SMMU_GR1_CBFRSYNRA(cfg->cbndx));
54-
info->ttbr0 = arm_smmu_cb_read(smmu, cfg->cbndx, ARM_SMMU_CB_TTBR0);
54+
info->ttbr0 = arm_smmu_cb_readq(smmu, cfg->cbndx, ARM_SMMU_CB_TTBR0);
5555
info->contextidr = arm_smmu_cb_read(smmu, cfg->cbndx, ARM_SMMU_CB_CONTEXTIDR);
5656
}
5757

@@ -415,6 +415,7 @@ static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = {
415415
{ .compatible = "qcom,sm8150-smmu-500" },
416416
{ .compatible = "qcom,sm8250-smmu-500" },
417417
{ .compatible = "qcom,sm8350-smmu-500" },
418+
{ .compatible = "qcom,sm8450-smmu-500" },
418419
{ }
419420
};
420421

drivers/iommu/io-pgtable-arm-v7s.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,17 @@ static void *__arm_v7s_alloc_table(int lvl, gfp_t gfp,
246246
__GFP_ZERO | ARM_V7S_TABLE_GFP_DMA, get_order(size));
247247
else if (lvl == 2)
248248
table = kmem_cache_zalloc(data->l2_tables, gfp);
249+
250+
if (!table)
251+
return NULL;
252+
249253
phys = virt_to_phys(table);
250254
if (phys != (arm_v7s_iopte)phys) {
251255
/* Doesn't fit in PTE */
252256
dev_err(dev, "Page table does not fit in PTE: %pa", &phys);
253257
goto out_free;
254258
}
255-
if (table && !cfg->coherent_walk) {
259+
if (!cfg->coherent_walk) {
256260
dma = dma_map_single(dev, table, size, DMA_TO_DEVICE);
257261
if (dma_mapping_error(dev, dma))
258262
goto out_free;

0 commit comments

Comments
 (0)