RDMA/mlx5: Annotate lock dependency in unbinding slave port
Subsystems (2)
PATCH 1/1 RDMA/mlx5: Annotate lock dependency in unbinding slave port
From: Leon Romanovsky <[email protected]>
NULL-ing notifier_call is performed under protection of mlx5_ib_multiport_mutex lock. Such protection is not easily spotted and better to be guarded by lockdep annotation.
---
Based on -rc commit: 23eaf3b5c1a7 ("RDMA/mlx5: Release locks during notifier unregister")
--- drivers/infiniband/hw/mlx5/main.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/infiniband/hw/mlx5/main.c +2 -0
@@ -5835,6 +5835,8 @@ static void mlx5_ib_unbind_slave_port(struct mlx5_ib_dev *ibdev,int err;int i; +lockdep_assert_held (&mlx5_ib_multiport_mutex); +mlx5_ib_cleanup_cong_debugfs (ibdev, port_num);spin_lock (&port->mp.mpi_lock);
--
2.20.1
Quoted 29 lines · Leon Romanovsky
From: Leon Romanovsky <[email protected]>
NULL-ing
notifier_callis performed under protection ofmlx5_ib_multiport_mutexlock. Such protection is not easily spotted and better to be guarded by lockdep annotation.Signed-off-by Leon Romanovsky <[email protected]>---
Based on -rc commit:23eaf3b5c1a7("RDMA/mlx5: Release locks during notifier unregister")--- drivers/infiniband/hw/mlx5/main.c | 2 ++ 1 file changed, 2 insertions(+)drivers/infiniband/hw/mlx5/main.c +2
-0@@ -5835,6 +5835,8 @@ static void mlx5_ib_unbind_slave_port(structmlx5_ib_dev *ibdev, int err;int i; +lockdep_assert_held (&mlx5_ib_multiport_mutex); +mlx5_ib_cleanup_cong_debugfs (ibdev, port_num);
Quoted 4 lines
spin_lock(&port->mp.mpi_lock);
--
2.20.1
Hi Leon,
This patch needed to catch both the unbind and the bind/init routine as they both require the multiport mutex be held. Can you respin please?
Signature · 3 lines
Doug Ledford <[email protected]> GPG KeyID: B826A3330E572FDD Fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
Quoted 37 lines · Doug Ledford
Quoted 29 lines · Leon Romanovsky
From: Leon Romanovsky <[email protected]>
NULL-ing
notifier_callis performed under protection ofmlx5_ib_multiport_mutexlock. Such protection is not easily spotted and better to be guarded by lockdep annotation.Signed-off-by Leon Romanovsky <[email protected]>---
Based on -rc commit:23eaf3b5c1a7("RDMA/mlx5: Release locks during notifier unregister")--- drivers/infiniband/hw/mlx5/main.c | 2 ++ 1 file changed, 2 insertions(+)drivers/infiniband/hw/mlx5/main.c +2
-0@@ -5835,6 +5835,8 @@ static void mlx5_ib_unbind_slave_port(structmlx5_ib_dev *ibdev, int err;int i; +lockdep_assert_held (&mlx5_ib_multiport_mutex); +mlx5_ib_cleanup_cong_debugfs (ibdev, port_num);Quoted 4 lines
spin_lock(&port->mp.mpi_lock);
--
2.20.1Hi Leon,
Quoted 2 lines
This patch needed to catch both the unbind and the bind/init routine as they both require the multiport mutex be held. Can you respin please?
It has comment "5889 /* The mlx5_ib_multiport_mutex should be held when calling this function */", why do we need lockdep?
Just kidding, sending fixed patch now.
Thanks
Quoted 5 lines
--
Doug Ledford <[email protected]>GPG KeyID: B826A3330E572FDD Fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD