lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHv-k_86z3MTYePPQcs5fWSqFeoGxt7UYG_b-SyZGQ7zVW-hSw@mail.gmail.com>
Date:   Tue, 25 Oct 2016 20:38:21 +0530
From:   Binoy Jayan <binoy.jayan@...aro.org>
To:     Jack Wang <xjtuwjp@...il.com>
Cc:     Doug Ledford <dledford@...hat.com>,
        Sean Hefty <sean.hefty@...el.com>,
        Hal Rosenstock <hal.rosenstock@...il.com>,
        Arnd Bergmann <arnd@...db.de>,
        "linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
        Linux kernel mailing list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 2/8] IB/core: Replace semaphore sm_sem with completion

On 25 October 2016 at 18:13, Jack Wang <xjtuwjp@...il.com> wrote:
> Hi Binoy,
>
> snip
>>
>>         port->ib_dev   = device;
>>         port->port_num = port_num;
>> -       sema_init(&port->sm_sem, 1);
>> +       init_completion(&port->sm_comp);
>> +       complete(&port->sm_comp);
>
> Why complete here?
>
>>         mutex_init(&port->file_mutex);
>>         INIT_LIST_HEAD(&port->file_list);
>>
>> --
> KR,
> Jinpu


Hi Jack,

ib_umad_sm_open() calls wait_for_completion_interruptible() which comes before
ib_umad_sm_close() that calls complete(). In the initial open() there
will not be
anybody to signal the completion, so the complete is called to mark
the initial state.
I am not sure if this is the right way to do it, though.

-Binoy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ