When the PCI adapter is going through error recovery, a call to mlx4_ib_post_send() will return success without the command actually arriving to the hardware. Adding a call to pci_channel_offline() to check the state of the PCI slot and returning an error will allow the upper layers to be aware that the command didn't succeed.
Signed-off-by: Kleber Sacilotto de Souza <kleb...@linux.vnet.ibm.com> --- drivers/infiniband/hw/mlx4/qp.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index 35cced2..0fa4f72 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c @@ -2216,6 +2216,9 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, __be32 blh; int i; + if (pci_channel_offline(to_mdev(ibqp->device)->dev->pdev)) + return -EIO; + spin_lock_irqsave(&qp->sq.lock, flags); ind = qp->sq_next_wqe; -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html