summaryrefslogtreecommitdiff
path: root/drivers/dma/idxd/sysfs.c
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2021-07-15 11:44:47 -0700
committerVinod Koul <vkoul@kernel.org>2021-07-21 10:09:16 +0530
commit6e7f3ee97bbe2c7d7a53b7dbd7a08a579e03c8c9 (patch)
treec9e9476cf28d5b54ee9ab97a7dbd1e2a40fd1fbf /drivers/dma/idxd/sysfs.c
parentd9e5481fca74f870cf2fc2f90a0e77e85c0b5b86 (diff)
downloadlinux-6e7f3ee97bbe2c7d7a53b7dbd7a08a579e03c8c9.tar.gz
linux-6e7f3ee97bbe2c7d7a53b7dbd7a08a579e03c8c9.tar.bz2
linux-6e7f3ee97bbe2c7d7a53b7dbd7a08a579e03c8c9.zip
dmaengine: idxd: move dsa_drv support to compatible mode
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 different drivers. Those internal drivers were invisible to userspace. With the idxd driver transitioned to a proper bus device-driver model, the legacy behavior needs to be preserved due to it being exposed to user space via sysfs. Create a compat driver to provide the legacy behavior for /sys/bus/dsa/drivers/dsa. This should satisfy user tool accel-config v3.2 or ealier where this behavior is expected. If the distro has a newer accel-config then the legacy mode does not need to be enabled. When the compat driver binds the device (i.e. dsa0) to the dsa driver, it will be bound to the new idxd_drv. The wq device (i.e. wq0.0) will be bound to either the dmaengine_drv or the user_drv. The dsa_drv becomes a routing mechansim for the new drivers. It will not support additional external drivers that are implemented later. Reviewed-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Dave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162637468705.744545.4399080971745974435.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/idxd/sysfs.c')
-rw-r--r--drivers/dma/idxd/sysfs.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/drivers/dma/idxd/sysfs.c b/drivers/dma/idxd/sysfs.c
index 633f4947ed32..b883e9f16e7f 100644
--- a/drivers/dma/idxd/sysfs.c
+++ b/drivers/dma/idxd/sysfs.c
@@ -16,46 +16,6 @@ static char *idxd_wq_type_names[] = {
[IDXD_WQT_USER] = "user",
};
-static int idxd_dsa_drv_probe(struct idxd_dev *idxd_dev)
-{
- if (is_idxd_dev(idxd_dev))
- return idxd_device_drv_probe(idxd_dev);
-
- if (is_idxd_wq_dev(idxd_dev)) {
- struct idxd_wq *wq = idxd_dev_to_wq(idxd_dev);
-
- return drv_enable_wq(wq);
- }
-
- return -ENODEV;
-}
-
-static void idxd_dsa_drv_remove(struct idxd_dev *idxd_dev)
-{
- if (is_idxd_dev(idxd_dev)) {
- idxd_device_drv_remove(idxd_dev);
- return;
- }
-
- if (is_idxd_wq_dev(idxd_dev)) {
- struct idxd_wq *wq = idxd_dev_to_wq(idxd_dev);
-
- drv_disable_wq(wq);
- return;
- }
-}
-
-static enum idxd_dev_type dev_types[] = {
- IDXD_DEV_NONE,
-};
-
-struct idxd_device_driver dsa_drv = {
- .name = "dsa",
- .probe = idxd_dsa_drv_probe,
- .remove = idxd_dsa_drv_remove,
- .type = dev_types,
-};
-
/* IDXD engine attributes */
static ssize_t engine_group_id_show(struct device *dev,
struct device_attribute *attr, char *buf)