Skip to content

Commit 7d9c3f9

Browse files
committed
dmaengine: idxd: Check for driver name match before sva user feature
jira LE-1907 Rebuild_History Non-Buildable kernel-5.14.0-427.40.1.el9_4 commit-author Jerry Snitselaar <jsnitsel@redhat.com> commit c863062 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> (cherry picked from commit c863062) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 155de79 commit 7d9c3f9

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
@@ -594,6 +594,14 @@ static int idxd_user_drv_probe(struct idxd_dev *idxd_dev)
594594
if (idxd->state != IDXD_DEV_ENABLED)
595595
return -ENXIO;
596596

597+
mutex_lock(&wq->wq_lock);
598+
599+
if (!idxd_wq_driver_name_match(wq, dev)) {
600+
idxd->cmd_status = IDXD_SCMD_WQ_NO_DRV_NAME;
601+
rc = -ENODEV;
602+
goto wq_err;
603+
}
604+
597605
/*
598606
* User type WQ is enabled only when SVA is enabled for two reasons:
599607
* - If no IOMMU or IOMMU Passthrough without SVA, userspace
@@ -609,14 +617,7 @@ static int idxd_user_drv_probe(struct idxd_dev *idxd_dev)
609617
dev_dbg(&idxd->pdev->dev,
610618
"User type WQ cannot be enabled without SVA.\n");
611619

612-
return -EOPNOTSUPP;
613-
}
614-
615-
mutex_lock(&wq->wq_lock);
616-
617-
if (!idxd_wq_driver_name_match(wq, dev)) {
618-
idxd->cmd_status = IDXD_SCMD_WQ_NO_DRV_NAME;
619-
rc = -ENODEV;
620+
rc = -EOPNOTSUPP;
620621
goto wq_err;
621622
}
622623

0 commit comments

Comments
 (0)