Skip to content

Commit c863062

Browse files
snitsvinodkoul
authored andcommitted
dmaengine: idxd: Check for driver name match before sva user feature
Currently if the user driver is probed on a workqueue configured for another driver with SVA not enabled on the system, it will print out a number of probe failing messages like the following: [ 264.831140] user: probe of wq13.0 failed with error -95 On some systems, such as GNR, the number of messages can reach over 100. Move the SVA feature check to be after the driver name match check. Cc: Vinod Koul <vkoul@kernel.org> Cc: dmaengine@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Fenghua Yu <fenghua.yu@intel.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com> Link: https://lore.kernel.org/r/20240405213941.3629709-1-jsnitsel@redhat.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 8b71498 commit c863062

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

drivers/dma/idxd/cdev.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,14 @@ static int idxd_user_drv_probe(struct idxd_dev *idxd_dev)
517517
if (idxd->state != IDXD_DEV_ENABLED)
518518
return -ENXIO;
519519

520+
mutex_lock(&wq->wq_lock);
521+
522+
if (!idxd_wq_driver_name_match(wq, dev)) {
523+
idxd->cmd_status = IDXD_SCMD_WQ_NO_DRV_NAME;
524+
rc = -ENODEV;
525+
goto wq_err;
526+
}
527+
520528
/*
521529
* User type WQ is enabled only when SVA is enabled for two reasons:
522530
* - If no IOMMU or IOMMU Passthrough without SVA, userspace
@@ -532,14 +540,7 @@ static int idxd_user_drv_probe(struct idxd_dev *idxd_dev)
532540
dev_dbg(&idxd->pdev->dev,
533541
"User type WQ cannot be enabled without SVA.\n");
534542

535-
return -EOPNOTSUPP;
536-
}
537-
538-
mutex_lock(&wq->wq_lock);
539-
540-
if (!idxd_wq_driver_name_match(wq, dev)) {
541-
idxd->cmd_status = IDXD_SCMD_WQ_NO_DRV_NAME;
542-
rc = -ENODEV;
543+
rc = -EOPNOTSUPP;
543544
goto wq_err;
544545
}
545546

0 commit comments

Comments
 (0)