All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
To: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Eran Ben Elisha <eranbe-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH for-next 2/3] IB/core: Change per-entry lock in RoCE GID table to one lock
Date: Wed, 30 Dec 2015 08:36:28 +0100	[thread overview]
Message-ID: <5683897C.8000604@sandisk.com> (raw)
In-Reply-To: <56837328.8000902-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-12-30  7:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-28 14:52 [PATCH for-next 0/3] Change per-entry locks in GID cache to table lock Matan Barak
     [not found] ` <1446043961-17667-1-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-10-28 14:52   ` [PATCH for-next 1/3] IB/core: Refactor GID cache's ib_dispatch_event Matan Barak
2015-10-28 14:52   ` [PATCH for-next 2/3] IB/core: Change per-entry lock in RoCE GID table to one lock Matan Barak
     [not found]     ` <1446043961-17667-3-git-send-email-matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-30  6:01       ` Or Gerlitz
     [not found]         ` <56837328.8000902-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-30  7:36           ` Bart Van Assche [this message]
     [not found]             ` <5683897C.8000604-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2015-12-30 10:59               ` Matan Barak
2015-10-28 14:52   ` [PATCH for-next 3/3] IB/core: Find gid searches for empty slot while traversing the GID table Matan Barak

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=5683897C.8000604@sandisk.com \
    --to=bart.vanassche-xdaiopvojttbdgjk7y7tuq@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=eranbe-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=ogerlitz-VPRAkNaXOzVWk0Htik3J/w@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 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.