Skip to content

Commit d28c1b1

Browse files
groeckgregkh
authored andcommitted
dmaengine: Add missing cleanup on module unload
Upstream commit b7cb9a0 ("dmaengine: idxd: Fix refcount underflow on module unload") fixes a refcount underflow by replacing the call to idxd_cleanup() in the remove function with direct cleanup calls. That works fine upstream. However, upstream removed support for IOMMU_DEV_FEAT_IOPF, which is still supported in v6.12.y. The backport of commit b7cb9a0 into v6.12.y misses the call to disable it. This results in a warning backtrace when unloading and reloading the module. WARNING: CPU: 0 PID: 665849 at drivers/pci/ats.c:337 pci_reset_pri+0x4c/0x60 ... RIP: 0010:pci_reset_pri+0xa7/0x130 Add the missing cleanup call to fix the problem. Fixes: ce81905 ("dmaengine: idxd: Fix refcount underflow on module unload") Cc: Yi Sun <yi.sun@intel.com> Cc: Shuai Xue <xueshuai@linux.alibaba.com> Cc: Dave Jiang <dave.jiang@intel.com> Cc: Vinicius Costa Gomes <vinicius.gomes@intel.com> Cc: Vinod Koul <vkoul@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f3ccb49 commit d28c1b1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/dma/idxd/init.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,8 @@ static void idxd_remove(struct pci_dev *pdev)
923923
idxd_cleanup_interrupts(idxd);
924924
if (device_pasid_enabled(idxd))
925925
idxd_disable_system_pasid(idxd);
926+
if (device_user_pasid_enabled(idxd))
927+
idxd_disable_sva(idxd->pdev);
926928
pci_iounmap(pdev, idxd->reg_base);
927929
put_device(idxd_confdev(idxd));
928930
pci_disable_device(pdev);

0 commit comments

Comments
 (0)