Skip to content

Commit 93bd481

Browse files
committed
Merge tag 'iommu-fixes-v6.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux
Pull iommu fixes from Joerg Roedel: - core: fix potential memory leak in iopf_queue_remove_device() - Intel VT-d: handle faults correctly in intel_iommu_drain_pasid_prq() - AMD-Vi: fix faults happening in resume path - typo and spelling fixes * tag 'iommu-fixes-v6.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux: iommu/vt-d: Make intel_iommu_drain_pasid_prq() cover faults for RID iommu/exynos: Fix typos iommu: Fix a spelling error iommu/amd: Expicitly enable CNTRL.EPHEn bit in resume path iommu: Fix potential memory leak in iopf_queue_remove_device()
2 parents fd31a1b + add43c4 commit 93bd481

File tree

6 files changed

+13
-5
lines changed

6 files changed

+13
-5
lines changed

drivers/iommu/amd/amd_iommu_types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@
175175
#define CONTROL_GAM_EN 25
176176
#define CONTROL_GALOG_EN 28
177177
#define CONTROL_GAINT_EN 29
178+
#define CONTROL_EPH_EN 45
178179
#define CONTROL_XT_EN 50
179180
#define CONTROL_INTCAPXT_EN 51
180181
#define CONTROL_IRTCACHEDIS 59

drivers/iommu/amd/init.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2653,6 +2653,10 @@ static void iommu_init_flags(struct amd_iommu *iommu)
26532653

26542654
/* Set IOTLB invalidation timeout to 1s */
26552655
iommu_set_inv_tlb_timeout(iommu, CTRL_INV_TO_1S);
2656+
2657+
/* Enable Enhanced Peripheral Page Request Handling */
2658+
if (check_feature(FEATURE_EPHSUP))
2659+
iommu_feature_enable(iommu, CONTROL_EPH_EN);
26562660
}
26572661

26582662
static void iommu_apply_resume_quirks(struct amd_iommu *iommu)

drivers/iommu/exynos-iommu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ struct exynos_iommu_domain {
249249
struct list_head clients; /* list of sysmmu_drvdata.domain_node */
250250
sysmmu_pte_t *pgtable; /* lv1 page table, 16KB */
251251
short *lv2entcnt; /* free lv2 entry counter for each section */
252-
spinlock_t lock; /* lock for modyfying list of clients */
252+
spinlock_t lock; /* lock for modifying list of clients */
253253
spinlock_t pgtablelock; /* lock for modifying page table @ pgtable */
254254
struct iommu_domain domain; /* generic domain data structure */
255255
};
@@ -292,7 +292,7 @@ struct sysmmu_drvdata {
292292
struct clk *aclk; /* SYSMMU's aclk clock */
293293
struct clk *pclk; /* SYSMMU's pclk clock */
294294
struct clk *clk_master; /* master's device clock */
295-
spinlock_t lock; /* lock for modyfying state */
295+
spinlock_t lock; /* lock for modifying state */
296296
bool active; /* current status */
297297
struct exynos_iommu_domain *domain; /* domain we belong to */
298298
struct list_head domain_node; /* node for domain clients list */
@@ -746,7 +746,7 @@ static int exynos_sysmmu_probe(struct platform_device *pdev)
746746
ret = devm_request_irq(dev, irq, exynos_sysmmu_irq, 0,
747747
dev_name(dev), data);
748748
if (ret) {
749-
dev_err(dev, "Unabled to register handler of irq %d\n", irq);
749+
dev_err(dev, "Unable to register handler of irq %d\n", irq);
750750
return ret;
751751
}
752752

drivers/iommu/intel/prq.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ void intel_iommu_drain_pasid_prq(struct device *dev, u32 pasid)
8787
struct page_req_dsc *req;
8888

8989
req = &iommu->prq[head / sizeof(*req)];
90-
if (!req->pasid_present || req->pasid != pasid) {
90+
if (req->rid != sid ||
91+
(req->pasid_present && pasid != req->pasid) ||
92+
(!req->pasid_present && pasid != IOMMU_NO_PASID)) {
9193
head = (head + sizeof(*req)) & PRQ_RING_MASK;
9294
continue;
9395
}

drivers/iommu/io-pgfault.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@ void iopf_queue_remove_device(struct iopf_queue *queue, struct device *dev)
478478

479479
ops->page_response(dev, iopf, &resp);
480480
list_del_init(&group->pending_node);
481+
iopf_free_group(group);
481482
}
482483
mutex_unlock(&fault_param->lock);
483484

drivers/iommu/iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1756,7 +1756,7 @@ static int iommu_get_def_domain_type(struct iommu_group *group,
17561756
group->id);
17571757

17581758
/*
1759-
* Try to recover, drivers are allowed to force IDENITY or DMA, IDENTITY
1759+
* Try to recover, drivers are allowed to force IDENTITY or DMA, IDENTITY
17601760
* takes precedence.
17611761
*/
17621762
if (type == IOMMU_DOMAIN_IDENTITY)

0 commit comments

Comments
 (0)