Re: [PATCH for-next 2/3] IB/core: Change per-entry lock in RoCE GID table to one lock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/30/2015 07:01 AM, Or Gerlitz wrote:
On 10/28/2015 4:52 PM, Matan Barak wrote:
@@ -134,16 +138,14 @@ static int write_gid(struct ib_device *ib_dev,
u8 port,
  {
      int ret = 0;
      struct net_device *old_net_dev;
-    unsigned long flags;
      /* in rdma_cap_roce_gid_table, this funciton should be protected
by a
       * sleep-able lock.
       */
-    write_lock_irqsave(&table->data_vec[ix].lock, flags);
      if (rdma_cap_roce_gid_table(ib_dev, port)) {
          table->data_vec[ix].props |= GID_TABLE_ENTRY_INVALID;
-        write_unlock_irqrestore(&table->data_vec[ix].lock, flags);
+        write_unlock_irq(&table->rwlock);
          /* GID_TABLE_WRITE_ACTION_MODIFY currently isn't supported by
           * RoCE providers and thus only updates the cache.
           */
@@ -153,7 +155,7 @@ static int write_gid(struct ib_device *ib_dev, u8
port,
          else if (action == GID_TABLE_WRITE_ACTION_DEL)
              ret = ib_dev->del_gid(ib_dev, port, ix,
                            &table->data_vec[ix].context);
-        write_lock_irqsave(&table->data_vec[ix].lock, flags);
+        write_lock_irq(&table->rwlock);
      }

sparse complains on

drivers/infiniband/core/cache.c:186:17: warning: context imbalance in
'write_gid' - unexpected unlock

is this false positive?

Hello Or,

sparse expects __release() and __acquire() annotations for functions that unlock a lock object that has been locked by its caller. See e.g. http://lists.kernelnewbies.org/pipermail/kernelnewbies/2011-October/003541.html.

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux