public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: re: IB/qib, staging/rdma/hfi1: add s_hlock for use in post send
Date: Tue, 22 Mar 2016 23:03:23 +0300	[thread overview]
Message-ID: <20160322200322.GA27995@mwanda> (raw)

Hello Mike Marciniszyn,

The patch 46a80d62e6e0: "IB/qib, staging/rdma/hfi1: add s_hlock for
use in post send" from Feb 14, 2016, leads to the following static
checker warning:

	drivers/infiniband/hw/qib/qib_ud.c:395 qib_make_ud_req()
	warn: 'irqsave:flags' is sometimes locked here and sometimes unlocked.

drivers/infiniband/hw/qib/qib_ud.c
   293          } else {
   294                  this_cpu_inc(ibp->pmastats->n_unicast_xmit);
   295                  lid = ah_attr->dlid & ~((1 << ppd->lmc) - 1);
   296                  if (unlikely(lid == ppd->lid)) {
   297                          unsigned long flags;
                                              ^^^^^
   298                          /*
   299                           * If DMAs are in progress, we can't generate
   300                           * a completion for the loopback packet since
   301                           * it would be out of order.
   302                           * XXX Instead of waiting, we could queue a
   303                           * zero length descriptor so we get a callback.
   304                           */
   305                          if (atomic_read(&priv->s_dma_busy)) {
   306                                  qp->s_flags |= RVT_S_WAIT_DMA;
   307                                  goto bail;
   308                          }
   309                          qp->s_cur = next_cur;
   310                          local_irq_save(flags);
                                ^^^^^^^^^^^^^^^^^^^^^
   311                          spin_unlock_irqrestore(&qp->s_lock, flags);
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Complicated no-op with the IRQ flags.

   312                          qib_ud_loopback(qp, wqe);
   313                          spin_lock_irqsave(&qp->s_lock, flags);
                                                               ^^^^^
We save the flags but then we leave the scope without using them.

   314                          qib_send_complete(qp, wqe, IB_WC_SUCCESS);
   315                          goto done;
   316                  }
   317          }

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2016-03-22 20:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-22 20:03 Dan Carpenter [this message]
2016-03-23 20:51 ` IB/qib, staging/rdma/hfi1: add s_hlock for use in post send Marciniszyn, Mike

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=20160322200322.GA27995@mwanda \
    --to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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