linux-stable/drivers/infiniband
Mike Marciniszyn ad244fd0c5 IB/hfi1: Handle port down properly in pio
[ Upstream commit 942a899335 ]

The call to sc_buffer_alloc currently returns NULL (no buffer) or
a buffer descriptor.

There is a third case when the port is down.  Currently that
returns NULL and this prevents the caller from properly handling the
sc_buffer_alloc() failure.  A verbs code link test after the call is
racy so the indication needs to come from the state check inside the allocation
routine to be valid.

Fix by encoding the ECOMM failure like SDMA.   IS_ERR_OR_NULL() tests
are added at all call sites.  For verbs send, this needs to treat any
error by returning a completion without any MMIO copy.

Fixes: 7724105686 ("IB/hfi1: add driver files")
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-27 14:50:56 +01:00
..
core RDMA/uverbs: check for allocation failure in uapi_add_elm() 2020-01-27 14:50:52 +01:00
hw IB/hfi1: Handle port down properly in pio 2020-01-27 14:50:56 +01:00
sw RDMA/rxe: Consider skb reserve space based on netdev of GID 2020-01-27 14:50:44 +01:00
ulp IB/iser: Pass the correct number of entries for dma mapped SGL 2020-01-27 14:50:14 +01:00
Kconfig IB/ucm: fix UCM link error 2018-08-21 16:56:32 -06:00
Makefile