[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230807203726.1682123-3-tom.zanussi@linux.intel.com>
Date: Mon, 7 Aug 2023 15:37:14 -0500
From: Tom Zanussi <tom.zanussi@...ux.intel.com>
To: herbert@...dor.apana.org.au, davem@...emloft.net,
fenghua.yu@...el.com, vkoul@...nel.org
Cc: dave.jiang@...el.com, tony.luck@...el.com,
wajdi.k.feghali@...el.com, james.guilford@...el.com,
kanchana.p.sridhar@...el.com, vinodh.gopal@...el.com,
giovanni.cabiddu@...el.com, linux-kernel@...r.kernel.org,
linux-crypto@...r.kernel.org, dmaengine@...r.kernel.org
Subject: [PATCH v9 02/14] dmaengine: idxd: add external module driver support for dsa_bus_type
From: Dave Jiang <dave.jiang@...el.com>
Add support to allow an external driver to be registered to the
dsa_bus_type and also auto-loaded.
Signed-off-by: Dave Jiang <dave.jiang@...el.com>
Signed-off-by: Tom Zanussi <tom.zanussi@...ux.intel.com>
Reviewed-by: Fenghua Yu <fenghua.yu@...el.com>
Acked-by: Vinod Koul <vkoul@...nel.org>
---
drivers/dma/idxd/bus.c | 6 ++++++
drivers/dma/idxd/idxd.h | 3 +++
2 files changed, 9 insertions(+)
diff --git a/drivers/dma/idxd/bus.c b/drivers/dma/idxd/bus.c
index 6f84621053c6..0c9e689a2e77 100644
--- a/drivers/dma/idxd/bus.c
+++ b/drivers/dma/idxd/bus.c
@@ -67,11 +67,17 @@ static void idxd_config_bus_remove(struct device *dev)
idxd_drv->remove(idxd_dev);
}
+static int idxd_bus_uevent(const struct device *dev, struct kobj_uevent_env *env)
+{
+ return add_uevent_var(env, "MODALIAS=" IDXD_DEVICES_MODALIAS_FMT, 0);
+}
+
struct bus_type dsa_bus_type = {
.name = "dsa",
.match = idxd_config_bus_match,
.probe = idxd_config_bus_probe,
.remove = idxd_config_bus_remove,
+ .uevent = idxd_bus_uevent,
};
EXPORT_SYMBOL_GPL(dsa_bus_type);
diff --git a/drivers/dma/idxd/idxd.h b/drivers/dma/idxd/idxd.h
index c62c78e1c9fa..276b5f9cf967 100644
--- a/drivers/dma/idxd/idxd.h
+++ b/drivers/dma/idxd/idxd.h
@@ -646,6 +646,9 @@ static inline int idxd_wq_driver_name_match(struct idxd_wq *wq, struct device *d
return (strncmp(wq->driver_name, dev->driver->name, strlen(dev->driver->name)) == 0);
}
+#define MODULE_ALIAS_IDXD_DEVICE(type) MODULE_ALIAS("idxd:t" __stringify(type) "*")
+#define IDXD_DEVICES_MODALIAS_FMT "idxd:t%d"
+
int __must_check __idxd_driver_register(struct idxd_device_driver *idxd_drv,
struct module *module, const char *mod_name);
#define idxd_driver_register(driver) \
--
2.34.1
Powered by blists - more mailing lists