linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Doug Ledford <dledford@redhat.com>
Cc: Jason Gunthorpe <jgg@mellanox.com>,
	RDMA mailing list <linux-rdma@vger.kernel.org>
Subject: Re: [PATCH rdma-next] RDMA/mlx5: Annotate lock dependency in unbinding slave port
Date: Tue, 13 Aug 2019 13:26:03 +0300	[thread overview]
Message-ID: <20190813102603.GG29138@mtr-leonro.mtl.com> (raw)
In-Reply-To: <5008d1458ccbbf368ce8c2235c200798fee480cd.camel@redhat.com>

On Mon, Aug 12, 2019 at 10:31:19AM -0400, Doug Ledford wrote:
> On Thu, 2019-08-08 at 11:39 +0300, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@mellanox.com>
> >
> > 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.
> >
> > Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> > ---
> > Based on -rc commit: 23eaf3b5c1a7 ("RDMA/mlx5: Release locks during
> > notifier unregister")
> > ---
> >  drivers/infiniband/hw/mlx5/main.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/infiniband/hw/mlx5/main.c
> > b/drivers/infiniband/hw/mlx5/main.c
> > index 7933534be931..63969484421c 100644
> > --- a/drivers/infiniband/hw/mlx5/main.c
> > +++ b/drivers/infiniband/hw/mlx5/main.c
> > @@ -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
> >
>
> 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?

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

>
> --
> Doug Ledford <dledford@redhat.com>
>     GPG KeyID: B826A3330E572FDD
>     Fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD



      reply	other threads:[~2019-08-13 10:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-08  8:39 [PATCH rdma-next] RDMA/mlx5: Annotate lock dependency in unbinding slave port Leon Romanovsky
2019-08-12 14:31 ` Doug Ledford
2019-08-13 10:26   ` Leon Romanovsky [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190813102603.GG29138@mtr-leonro.mtl.com \
    --to=leon@kernel.org \
    --cc=dledford@redhat.com \
    --cc=jgg@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).