All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Dakshaja Uppalapati <dakshaja@chelsio.com>
Cc: dledford@redhat.com, linux-rdma@vger.kernel.org, bharat@chelsio.com
Subject: Re: [PATCH v1 for-rc] iw_cxgb4: Fix refcount underflow while destroying cqs.
Date: Thu, 5 Aug 2021 22:34:12 -0300	[thread overview]
Message-ID: <20210806013412.GA3319081@nvidia.com> (raw)
In-Reply-To: <1628167412-12114-1-git-send-email-dakshaja@chelsio.com>

On Thu, Aug 05, 2021 at 06:13:32PM +0530, Dakshaja Uppalapati wrote:
> Previous atomic increment decrement logic expects the atomic count
> to be '0' after the final decrement. Replacing atomic count with
> refcount does not allow that, as refcount_dec() considers count of 1
> as underflow. Therefore fix the current refcount logic by decrementing
> the refcount and test if it is '0' on the final deref in
> c4iw_destroy_cq(). Use wait_for_completion() instead of wait_event().
> 
> Fixes: 7183451f846d (RDMA/cxgb4: Use refcount_t instead of atomic_t for reference counting")
> Signed-off-by: Dakshaja Uppalapati <dakshaja@chelsio.com>
> Reviewed-by: Potnuri Bharat Teja <bharat@chelsio.com>
> ---
> changelog:
> v0->v1: used wait for completion instead of wait_event.
> ---
>  drivers/infiniband/hw/cxgb4/cq.c       | 12 +++++++++---
>  drivers/infiniband/hw/cxgb4/ev.c       |  6 ++----
>  drivers/infiniband/hw/cxgb4/iw_cxgb4.h |  3 ++-
>  3 files changed, 13 insertions(+), 8 deletions(-)

There were several errors in the patch, damaged white space, bad fixes
line. Please be more careful in future. I corrected them and applied
to for-rc, thanks
 
Jason

      reply	other threads:[~2021-08-06  1:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-05 12:43 [PATCH v1 for-rc] iw_cxgb4: Fix refcount underflow while destroying cqs Dakshaja Uppalapati
2021-08-06  1:34 ` 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=20210806013412.GA3319081@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=bharat@chelsio.com \
    --cc=dakshaja@chelsio.com \
    --cc=dledford@redhat.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 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.