From patchwork Thu Mar 28 18:45:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kleber Sacilotto de Souza X-Patchwork-Id: 2359211 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 95796E0143 for ; Thu, 28 Mar 2013 18:49:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752963Ab3C1Ste (ORCPT ); Thu, 28 Mar 2013 14:49:34 -0400 Received: from e24smtp04.br.ibm.com ([32.104.18.25]:34145 "EHLO e24smtp04.br.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752392Ab3C1Stc (ORCPT ); Thu, 28 Mar 2013 14:49:32 -0400 Received: from /spool/local by e24smtp04.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 28 Mar 2013 15:49:27 -0300 Received: from d24dlp01.br.ibm.com (9.18.248.204) by e24smtp04.br.ibm.com (10.172.0.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 28 Mar 2013 15:49:25 -0300 Received: from d24relay03.br.ibm.com (d24relay03.br.ibm.com [9.13.184.25]) by d24dlp01.br.ibm.com (Postfix) with ESMTP id 952383520065 for ; Thu, 28 Mar 2013 14:49:23 -0400 (EDT) Received: from d24av03.br.ibm.com (d24av03.br.ibm.com [9.8.31.95]) by d24relay03.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r2SImboW22085722 for ; Thu, 28 Mar 2013 15:48:37 -0300 Received: from d24av03.br.ibm.com (loopback [127.0.0.1]) by d24av03.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r2SGnjrf003477 for ; Thu, 28 Mar 2013 13:49:45 -0300 Received: from oc3234564620.ibm.com (dhcp-9-18-235-149.br.ibm.com [9.18.235.149]) by d24av03.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r2SGniNh003473; Thu, 28 Mar 2013 13:49:44 -0300 From: Kleber Sacilotto de Souza To: linux-rdma@vger.kernel.org Cc: Roland Dreier , Sean Hefty , Hal Rosenstock , Or Gerlitz , Jack Morgenstein , Kleber Sacilotto de Souza Subject: [PATCH] IB/mlx4: Fail post send command on error recovery Date: Thu, 28 Mar 2013 15:45:15 -0300 Message-Id: <1364496315-7588-1-git-send-email-klebers@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13032818-8936-0000-0000-000009B9DAA8 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org 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 --- 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;