From eb5a328174ba3987d99ab74fdbf181e9f1632b03 Mon Sep 17 00:00:00 2001 From: Mikael Olsson Date: Wed, 21 Jun 2023 14:46:01 +0200 Subject: Change NPU kernel driver to use async probing If the rpmsg channel to communicate with the subsystem is not available until after the NPU kernel driver has been registered, the driver's probe function will be called from the rpmsg message receive callback and block handling of any other messages until the probing is done. To avoid blocking the callback while performing the probing and to allow the probe to communicate with the subsystem, the kernel driver will now request that its probe function is called asynchronously. Change-Id: Iaeaa4a2322f6a76c0acd202e69b91a8beeb6114b Signed-off-by: Mikael Olsson --- kernel/ethosu_driver.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/kernel/ethosu_driver.c b/kernel/ethosu_driver.c index 342f501..f35c5e5 100644 --- a/kernel/ethosu_driver.c +++ b/kernel/ethosu_driver.c @@ -93,14 +93,15 @@ static struct rpmsg_device_id ethosu_rpmsg_driver_id_table[] = { MODULE_DEVICE_TABLE(rpmsg, ethosu_rpmsg_driver_id_table); static struct rpmsg_driver ethosu_rpmsg_driver = { - .drv = { - .name = ETHOSU_DRIVER_NAME, - .owner = THIS_MODULE, + .drv = { + .name = ETHOSU_DRIVER_NAME, + .owner = THIS_MODULE, + .probe_type = PROBE_PREFER_ASYNCHRONOUS, }, - .id_table = ethosu_rpmsg_driver_id_table, - .probe = ethosu_rpmsg_probe, - .callback = ethosu_rpmsg_cb, - .remove = ethosu_rpmsg_remove, + .id_table = ethosu_rpmsg_driver_id_table, + .probe = ethosu_rpmsg_probe, + .callback = ethosu_rpmsg_cb, + .remove = ethosu_rpmsg_remove, }; /**************************************************************************** -- cgit v1.2.1