staging/rdma/hfi1: Fix downgrade race
authorDean Luick <dean.luick@intel.com>
Tue, 17 Nov 2015 02:59:24 +0000 (21:59 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Dec 2015 21:45:29 +0000 (13:45 -0800)
commit323fd785e396f4252b014665df8a831d91c2f117
tree8df60db3ada9a414ec21b3315679332438195cc8
parent699f685569434510d944e419f4048c4e3ba8d631
staging/rdma/hfi1: Fix downgrade race

A link downgrade can race with link up. Avoid the race
in two ways. First, by having the downgrade application logic
take the link state mutex for all of its checking. Second, by
waiting for the link to move out of the going up state.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rdma/hfi1/chip.c