aboutsummaryrefslogtreecommitdiff
path: root/drivers/dma/idxd/init.c
diff options
context:
space:
mode:
authorDave Jiang2021-07-15 11:44:35 -0700
committerVinod Koul2021-07-21 10:09:16 +0530
commit448c3de8ac8353fc4447738ae3c56c4eb6c2131d (patch)
tree1e22d8ca26055024fc5204a85e85875c49136eed /drivers/dma/idxd/init.c
parent0cda4f6986a3824cac500f66326ff267bf37110f (diff)
dmaengine: idxd: create user driver for wq 'device'
The original architecture of /sys/bus/dsa invented a scheme whereby a single entry in the list of bus drivers, /sys/bus/drivers/dsa, handled all device types and internally routed them to different drivers. Those internal drivers were invisible to userspace. Now, as /sys/bus/dsa wants to grow support for alternate drivers for a given device, for example vfio-mdev instead of kernel-internal-dmaengine, a proper bus device-driver model is needed. The first step in that process is separating the existing omnibus/implicit "dsa" driver into proper individual drivers registered on /sys/bus/dsa. Establish the idxd_user_drv driver that controls the enabling and disabling of the wq and also register and unregister a char device to allow user space to mmap the descriptor submission portal. The cdev related bits are moved to the cdev driver probe/remove and out of the drv_enabe/disable_wq() calls. These bits are exclusive to the cdev operation and not part of the generic enable/disable of the wq device. Reviewed-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Dave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162637467578.744545.10203997610072341376.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/idxd/init.c')
-rw-r--r--drivers/dma/idxd/init.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
index 6f38128ce400..33a80f700ff8 100644
--- a/drivers/dma/idxd/init.c
+++ b/drivers/dma/idxd/init.c
@@ -848,6 +848,10 @@ static int __init idxd_init_module(void)
if (err < 0)
goto err_idxd_dmaengine_driver_register;
+ err = idxd_driver_register(&idxd_user_drv);
+ if (err < 0)
+ goto err_idxd_user_driver_register;
+
err = idxd_driver_register(&dsa_drv);
if (err < 0)
goto err_dsa_driver_register;
@@ -867,6 +871,8 @@ err_pci_register:
err_cdev_register:
idxd_driver_unregister(&dsa_drv);
err_dsa_driver_register:
+ idxd_driver_unregister(&idxd_user_drv);
+err_idxd_user_driver_register:
idxd_driver_unregister(&idxd_dmaengine_drv);
err_idxd_dmaengine_driver_register:
idxd_driver_unregister(&idxd_drv);
@@ -878,6 +884,7 @@ module_init(idxd_init_module);
static void __exit idxd_exit_module(void)
{
+ idxd_driver_unregister(&idxd_user_drv);
idxd_driver_unregister(&idxd_dmaengine_drv);
idxd_driver_unregister(&idxd_drv);
idxd_driver_unregister(&dsa_drv);