diff options
author | Jiri Pirko <jiri@nvidia.com> | 2022-07-16 14:02:40 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-07-19 06:10:48 +0300 |
commit | 012ec02ae4410207f796a9b280a60b80b6cc790a (patch) | |
tree | 1eef5b367c809deb578a70577225e226adde3b56 /net | |
parent | eb0e9fa2c6355e744d3ea7d07d34d89a4735320e (diff) | |
download | linux-012ec02ae4410207f796a9b280a60b80b6cc790a.tar.xz |
netdevsim: convert driver to use unlocked devlink API during init/fini
Prepare for devlink reload being called with devlink->lock held and
convert the netdevsim driver to use unlocked devlink API during init and
fini flows. Take devl_lock() in reload_down() and reload_up() ops in the
meantime before reload cmd is converted to take the lock itself.
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/devlink.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/core/devlink.c b/net/core/devlink.c index fe9657d6162f..1c75de6f6388 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c @@ -266,6 +266,12 @@ void devl_lock(struct devlink *devlink) } EXPORT_SYMBOL_GPL(devl_lock); +int devl_trylock(struct devlink *devlink) +{ + return mutex_trylock(&devlink->lock); +} +EXPORT_SYMBOL_GPL(devl_trylock); + void devl_unlock(struct devlink *devlink) { mutex_unlock(&devlink->lock); |