All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Wenpeng Liang <liangwenpeng@huawei.com>
Cc: dledford@redhat.com, linux-rdma@vger.kernel.org,
	linuxarm@huawei.com, Yangyang Li <liyangyang20@huawei.com>
Subject: Re: [PATCH for-rc] RDMA/hns: Fix the double unlock problem of poll_sem
Date: Tue, 3 Aug 2021 13:43:33 -0300	[thread overview]
Message-ID: <20210803164333.GA2895122@nvidia.com> (raw)
In-Reply-To: <1627887374-20019-1-git-send-email-liangwenpeng@huawei.com>

On Mon, Aug 02, 2021 at 02:56:14PM +0800, Wenpeng Liang wrote:
> From: Yangyang Li <liyangyang20@huawei.com>
> 
> If hns_roce_cmd_use_events() fails then it means that the poll_sem is not
> obtained, but the poll_sem is released in hns_roce_cmd_use_polling(), this
> will cause an unlock problem.
> 
> This is the static checker warning:
> 	drivers/infiniband/hw/hns/hns_roce_main.c:926 hns_roce_init()
> 	error: double unlocked '&hr_dev->cmd.poll_sem' (orig line 879)
> 
> Event mode and polling mode are mutually exclusive and resources are
> separated, so there is no need to process polling mode resources in
> event mode.
> 
> The initial mode of cmd is polling mode, so even if cmd fails to switch to
> event mode, it is not necessary to switch to polling mode.
> 
> Fixes: a389d016c030 ("RDMA/hns: Enable all CMDQ context")
> Fixes: 3d50503b3b33 ("RDMA/hns: Optimize cmd init and mode selection for hip08")
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Yangyang Li <liyangyang20@huawei.com>
> Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
> Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
> ---
>  drivers/infiniband/hw/hns/hns_roce_cmd.c  | 7 +++----
>  drivers/infiniband/hw/hns/hns_roce_main.c | 4 +---
>  2 files changed, 4 insertions(+), 7 deletions(-)

Applied to for-rc, thanks

Jason

      parent reply	other threads:[~2021-08-03 16:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-02  6:56 [PATCH for-rc] RDMA/hns: Fix the double unlock problem of poll_sem Wenpeng Liang
2021-08-02 10:46 ` Leon Romanovsky
2021-08-03 16:43 ` Jason Gunthorpe [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=20210803164333.GA2895122@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=dledford@redhat.com \
    --cc=liangwenpeng@huawei.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=liyangyang20@huawei.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.