]> git.baikalelectronics.ru Git - kernel.git/commit
IB/core: Add might_sleep() annotation to ib_init_ah_from_wc()
authorRoland Dreier <roland@purestorage.com>
Tue, 29 Aug 2017 17:34:44 +0000 (10:34 -0700)
committerDoug Ledford <dledford@redhat.com>
Thu, 31 Aug 2017 12:35:07 +0000 (08:35 -0400)
commitc6d4135c72373157bf62905dc0ad7546ec89a7a1
tree614e7d1eb902b63a923bd0d0b5add7156b8a99f4
parentd0188b02413543174549c3a75c35c86d7766099c
IB/core: Add might_sleep() annotation to ib_init_ah_from_wc()

For RoCE, ib_init_ah_from_wc() can follow the path

    ib_init_ah_from_wc() ->
      rdma_addr_find_l2_eth_by_grh() ->
        rdma_resolve_ip()

and rdma_resolve_ip() will sleep in kzalloc() and wait_for_completion().

However, developers will not see any warnings if they use ib_init_ah_from_wc()
in an atomic context and test only on IB, because the function doesn't
sleep in that case.

Add a might_sleep() so that lockdep will catch bugs no matter what hardware is
used to test.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/verbs.c