linux_dsm_epyc7002/drivers/infiniband/hw/hfi1
Mike Marciniszyn 72f53af265 IB/hfi1: Fix defered ack race with qp destroy
There is a a bug in defered ack stuff that causes a race with the
destroy of a QP.

A packet causes a defered ack to be pended by putting the QP
into an rcd queue.

A return from the driver interrupt processing will process that rcd
queue of QPs and attempt to do a direct send of the ack.   At this
point no locks are held and the above QP could now be put in the reset
state in the qp destroy logic.   A refcount protects the QP while it
is in the rcd queue so it isn't going anywhere yet.

If the direct send fails to allocate a pio buffer,
hfi1_schedule_send() is called to trigger sending an ack from the
send engine. There is no state test in that code path.

The refcount is then dropped from the driver.c caller
potentially allowing the qp destroy to continue from its
refcount wait in parallel with the workqueue scheduling of the qp.

Cc: stable@vger.kernel.org
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-10-02 08:42:14 -04:00
..
affinity.c IB/hfi1: Fix locking scheme for affinity settings 2016-10-02 08:42:08 -04:00
affinity.h IB/hfi1: Fix locking scheme for affinity settings 2016-10-02 08:42:08 -04:00
aspm.h
chip_registers.h IB/hfi1: Read all firmware versions 2016-08-02 16:00:58 -04:00
chip.c IB/hfi1: Fix user-space buffers mapping with IOMMU enabled 2016-10-02 08:42:07 -04:00
chip.h IB/qib,IB/hfi: Use core common header file 2016-10-02 08:42:06 -04:00
common.h IB/qib,IB/hfi: Use core common header file 2016-10-02 08:42:06 -04:00
debugfs.c IB/hfi1: Rework debugfs to use SRCU 2016-09-02 14:26:55 -04:00
debugfs.h
device.c
device.h
dma.c
driver.c IB/qib,IB/hfi: Use core common header file 2016-10-02 08:42:06 -04:00
efivar.c
efivar.h
eprom.c
eprom.h
file_ops.c IB/hfi1: Fix user-space buffers mapping with IOMMU enabled 2016-10-02 08:42:07 -04:00
firmware.c IB/hfi1: Read all firmware versions 2016-08-02 16:00:58 -04:00
hfi.h IB/hfi1: Fix user-space buffers mapping with IOMMU enabled 2016-10-02 08:42:07 -04:00
init.c IB/hfi1: Fix user-space buffers mapping with IOMMU enabled 2016-10-02 08:42:07 -04:00
intr.c
iowait.h
Kconfig Second round of merge items for 4.8 2016-08-04 20:26:31 -04:00
mad.c IB/hfi1: Remove filtering of Set(PkeyTable) in HFI SMA 2016-10-02 08:42:12 -04:00
mad.h IB/hfi1: Clean up port state structure definition 2016-08-02 12:00:54 -04:00
Makefile IB/hfi1: Remove TWSI references 2016-08-02 15:47:42 -04:00
mmu_rb.c IB/hfi1: Add cache evict LRU list 2016-08-02 22:46:21 -04:00
mmu_rb.h IB/hfi1: Remove unneeded mm argument in remove function 2016-08-02 22:46:21 -04:00
opa_compat.h
pcie.c IB/hfi1: Add static PCIe Gen3 CTLE tuning 2016-08-02 16:00:58 -04:00
pio_copy.c IB/hfi1: Combine shift copy and byte copy for SGE reads 2016-10-02 08:42:14 -04:00
pio.c IB/hfi1: Fix user-space buffers mapping with IOMMU enabled 2016-10-02 08:42:07 -04:00
pio.h IB/hfi1: Fix user-space buffers mapping with IOMMU enabled 2016-10-02 08:42:07 -04:00
platform.c IB/hfi1: Reset QSFP on every run through channel tuning 2016-08-02 16:00:58 -04:00
platform.h
qp.c IB/rdmavt, IB/hfi1: Add lockdep asserts for lock debug 2016-10-02 08:42:10 -04:00
qp.h IB/hfi1: Rename struct ahg_ib_header to struct hfi1_ahg_info 2016-08-02 16:00:58 -04:00
qsfp.c IB/hfi1: Extend i2c timeout 2016-10-02 08:42:13 -04:00
qsfp.h IB/hfi1: Fetch monitor values on-demand for CableInfo query 2016-08-22 14:31:41 -04:00
rc.c IB/hfi1: Fix defered ack race with qp destroy 2016-10-02 08:42:14 -04:00
ruc.c IB/qib,IB/hfi: Use core common header file 2016-10-02 08:42:06 -04:00
sdma_txreq.h
sdma.c IB/hfi1: Fix the count of user packets submitted to an SDMA engine 2016-10-02 08:42:07 -04:00
sdma.h IB/hfi1: Fix the count of user packets submitted to an SDMA engine 2016-10-02 08:42:07 -04:00
sysfs.c IB/hfi1: Add sysfs entry to override SDMA interrupt affinity 2016-08-02 16:00:58 -04:00
trace_ctxts.h IB/hfi1: Fix user-space buffers mapping with IOMMU enabled 2016-10-02 08:42:07 -04:00
trace_dbg.h IB/hfi1: Separate tracepoints into specific headers 2016-08-02 12:00:54 -04:00
trace_ibhdrs.h IB/qib,IB/hfi: Use core common header file 2016-10-02 08:42:06 -04:00
trace_misc.h IB/hfi1: Separate tracepoints into specific headers 2016-08-02 12:00:54 -04:00
trace_rc.h IB/hfi1: Separate tracepoints into specific headers 2016-08-02 12:00:54 -04:00
trace_rx.h IB/qib,IB/hfi: Use core common header file 2016-10-02 08:42:06 -04:00
trace_tx.h IB/hfi1: Fix trace sparse errors 2016-08-02 12:00:54 -04:00
trace.c IB/qib,IB/hfi: Use core common header file 2016-10-02 08:42:06 -04:00
trace.h IB/hfi1: Separate tracepoints into specific headers 2016-08-02 12:00:54 -04:00
uc.c IB/hfi1: Consolidate pio control masks into single definition 2016-10-02 08:42:11 -04:00
ud.c IB/qib,IB/hfi: Use core common header file 2016-10-02 08:42:06 -04:00
user_exp_rcv.c IB/hfi1: Fix memory leak during unexpected shutdown 2016-08-02 22:46:21 -04:00
user_exp_rcv.h
user_pages.c IB/hfi1: Make use of mm consistent 2016-08-02 22:46:21 -04:00
user_sdma.c IB/hfi1: Fix the count of user packets submitted to an SDMA engine 2016-10-02 08:42:07 -04:00
user_sdma.h IB/hfi1: Use evict mmu rb operation 2016-08-02 22:46:21 -04:00
verbs_txreq.c IB/rdmavt, IB/qib, IB/hfi1: Use new QP put get routines 2016-09-16 14:35:27 -04:00
verbs_txreq.h IB/hfi1: Rename hfi1_pio_header to hfi1_sdma_header. 2016-08-02 16:00:58 -04:00
verbs.c IB/hfi1: Increase default settings of max_cqes and max_qps 2016-10-02 08:42:12 -04:00
verbs.h IB/hfi1: Consolidate pio control masks into single definition 2016-10-02 08:42:11 -04:00