Skip to content

Commit 75aa74d

Browse files
committed
Merge tag 'iommu-fixes-v6.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux
Pull iommu fixes from Joerg Roedel: "ARM-SMMU fixes from Will Deacon: - Clarify warning message when failing to disable the MMU-500 prefetcher - Fix undefined behaviour in calculation of L1 stream-table index when 32-bit StreamIDs are implemented - Replace a rogue comma with a semicolon Intel VT-d fix from Lu Baolu: - Fix incorrect pci_for_each_dma_alias() for non-PCI devices" * tag 'iommu-fixes-v6.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux: iommu/vt-d: Fix incorrect pci_for_each_dma_alias() for non-PCI devices iommu/arm-smmu-v3: Convert comma to semicolon iommu/arm-smmu-v3: Fix last_sid_idx calculation for sid_bits==32 iommu/arm-smmu: Clarify MMU-500 CPRE workaround
2 parents ef444a0 + 6e02a27 commit 75aa74d

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,7 +1420,7 @@ static int arm_smmu_alloc_cd_tables(struct arm_smmu_master *master)
14201420
cd_table->s1fmt = STRTAB_STE_0_S1FMT_LINEAR;
14211421
cd_table->linear.num_ents = max_contexts;
14221422

1423-
l1size = max_contexts * sizeof(struct arm_smmu_cd),
1423+
l1size = max_contexts * sizeof(struct arm_smmu_cd);
14241424
cd_table->linear.table = dma_alloc_coherent(smmu->dev, l1size,
14251425
&cd_table->cdtab_dma,
14261426
GFP_KERNEL);
@@ -3625,7 +3625,7 @@ static int arm_smmu_init_strtab_2lvl(struct arm_smmu_device *smmu)
36253625
u32 l1size;
36263626
struct arm_smmu_strtab_cfg *cfg = &smmu->strtab_cfg;
36273627
unsigned int last_sid_idx =
3628-
arm_smmu_strtab_l1_idx((1 << smmu->sid_bits) - 1);
3628+
arm_smmu_strtab_l1_idx((1ULL << smmu->sid_bits) - 1);
36293629

36303630
/* Calculate the L1 size, capped to the SIDSIZE. */
36313631
cfg->l2.num_l1_ents = min(last_sid_idx + 1, STRTAB_MAX_L1_ENTRIES);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,15 @@ int arm_mmu500_reset(struct arm_smmu_device *smmu)
130130

131131
/*
132132
* Disable MMU-500's not-particularly-beneficial next-page
133-
* prefetcher for the sake of errata #841119 and #826419.
133+
* prefetcher for the sake of at least 5 known errata.
134134
*/
135135
for (i = 0; i < smmu->num_context_banks; ++i) {
136136
reg = arm_smmu_cb_read(smmu, i, ARM_SMMU_CB_ACTLR);
137137
reg &= ~ARM_MMU500_ACTLR_CPRE;
138138
arm_smmu_cb_write(smmu, i, ARM_SMMU_CB_ACTLR, reg);
139139
reg = arm_smmu_cb_read(smmu, i, ARM_SMMU_CB_ACTLR);
140140
if (reg & ARM_MMU500_ACTLR_CPRE)
141-
dev_warn_once(smmu->dev, "Failed to disable prefetcher [errata #841119 and #826419], check ACR.CACHE_LOCK\n");
141+
dev_warn_once(smmu->dev, "Failed to disable prefetcher for errata workarounds, check SACR.CACHE_LOCK\n");
142142
}
143143

144144
return 0;

drivers/iommu/intel/iommu.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3340,8 +3340,10 @@ static int domain_context_clear_one_cb(struct pci_dev *pdev, u16 alias, void *op
33403340
*/
33413341
static void domain_context_clear(struct device_domain_info *info)
33423342
{
3343-
if (!dev_is_pci(info->dev))
3343+
if (!dev_is_pci(info->dev)) {
33443344
domain_context_clear_one(info, info->bus, info->devfn);
3345+
return;
3346+
}
33453347

33463348
pci_for_each_dma_alias(to_pci_dev(info->dev),
33473349
&domain_context_clear_one_cb, info);

0 commit comments

Comments
 (0)