]> git.baikalelectronics.ru Git - kernel.git/commit
IB/hfi1: Race condition between user notification and driver state
authorMichael J. Ruhl <michael.j.ruhl@intel.com>
Mon, 23 Oct 2017 13:05:45 +0000 (06:05 -0700)
committerDoug Ledford <dledford@redhat.com>
Mon, 30 Oct 2017 18:51:36 +0000 (14:51 -0400)
commitf4e9d130318067d5b24a5ea51b94aa5a58d04e56
tree08394267eb7dc05cc03535d6bcdc8dfbe65720d8
parente5c2b6e530514a802962674104d6afe102e8943d
IB/hfi1: Race condition between user notification and driver state

The handler for link init state (HLS_UP_INIT) notifies userspace
(update_statusp()) before enabling the device
(RCV_CTRL_RCV_PORT_ENABLE_SMASK) or setting the device state
(ppd->host_link_state).  This causes a race condition where the
userspace thinks the interface is in the INIT state before the driver
has set that state.

Rework the code path to eliminate the race.

Delay setting the init state until after a HW settling period.

Reviewed-by: Sebastian Sanchez <sebastian.sanchez@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hfi1/chip.c
drivers/infiniband/hw/hfi1/intr.c