Skip to content

Commit a7bd00f

Browse files
axiqiagregkh
authored andcommitted
dmaengine: idxd: Refactor remove call with idxd_cleanup() helper
commit a409e91 upstream. The idxd_cleanup() helper cleans up perfmon, interrupts, internals and so on. Refactor remove call with the idxd_cleanup() helper to avoid code duplication. Note, this also fixes the missing put_device() for idxd groups, enginces and wqs. Fixes: bfe1d56 ("dmaengine: idxd: Init and probe for Intel data accelerators") Cc: stable@vger.kernel.org Suggested-by: Vinicius Costa Gomes <vinicius.gomes@intel.com> Signed-off-by: Shuai Xue <xueshuai@linux.alibaba.com> Reviewed-by: Fenghua Yu <fenghuay@nvidia.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/20250404120217.48772-10-xueshuai@linux.alibaba.com Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 7a6c43d commit a7bd00f

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

drivers/dma/idxd/init.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,7 +1309,6 @@ static void idxd_shutdown(struct pci_dev *pdev)
13091309
static void idxd_remove(struct pci_dev *pdev)
13101310
{
13111311
struct idxd_device *idxd = pci_get_drvdata(pdev);
1312-
struct idxd_irq_entry *irq_entry;
13131312

13141313
idxd_unregister_devices(idxd);
13151314
/*
@@ -1322,21 +1321,12 @@ static void idxd_remove(struct pci_dev *pdev)
13221321
get_device(idxd_confdev(idxd));
13231322
device_unregister(idxd_confdev(idxd));
13241323
idxd_shutdown(pdev);
1325-
if (device_pasid_enabled(idxd))
1326-
idxd_disable_system_pasid(idxd);
13271324
idxd_device_remove_debugfs(idxd);
1328-
1329-
irq_entry = idxd_get_ie(idxd, 0);
1330-
free_irq(irq_entry->vector, irq_entry);
1331-
pci_free_irq_vectors(pdev);
1325+
idxd_cleanup(idxd);
13321326
pci_iounmap(pdev, idxd->reg_base);
1333-
if (device_user_pasid_enabled(idxd))
1334-
idxd_disable_sva(pdev);
1335-
pci_disable_device(pdev);
1336-
destroy_workqueue(idxd->wq);
1337-
perfmon_pmu_remove(idxd);
13381327
put_device(idxd_confdev(idxd));
13391328
idxd_free(idxd);
1329+
pci_disable_device(pdev);
13401330
}
13411331

13421332
static struct pci_driver idxd_pci_driver = {

0 commit comments

Comments
 (0)