All of lore.kernel.org
 help / color / mirror / Atom feed
From: Selvin Xavier <selvin.xavier-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	Mitesh Ahuja
	<mitesh.ahuja-HfQkIhtri/DQT0dZR+AlfA@public.gmane.org>,
	Selvin Xavier
	<selvin.xavier-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
Subject: [PATCH for-next 10/15] RDMA/ocrdma: Do proper cleanup evenif FW is
Date: Wed, 4 Jun 2014 14:22:41 +0530	[thread overview]
Message-ID: <a1df2ff2-10b1-4a54-8682-e8dbd5271028@CMEXHTCAS1.ad.emulex.com> (raw)
In-Reply-To: <1401871966-20408-10-git-send-email-selvin.xavier-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>

From: Mitesh Ahuja <mitesh.ahuja-HfQkIhtri/DQT0dZR+AlfA@public.gmane.org>

Signed-off-by: Mitesh Ahuja <mitesh.ahuja-HfQkIhtri/DQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Selvin Xavier <selvin.xavier-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
---
 drivers/infiniband/hw/ocrdma/ocrdma.h       |  1 +
 drivers/infiniband/hw/ocrdma/ocrdma_hw.c    |  8 +++++++-
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 12 +++++++++++-
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/ocrdma/ocrdma.h b/drivers/infiniband/hw/ocrdma/ocrdma.h
index 5cd65c2..fc27378 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma.h
+++ b/drivers/infiniband/hw/ocrdma/ocrdma.h
@@ -137,6 +137,7 @@ struct mqe_ctx {
 	u16 cqe_status;
 	u16 ext_status;
 	bool cmd_done;
+	bool fw_error_state;
 };
 
 struct ocrdma_hw_mr {
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
index 55308b6..5b6e9d9 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
@@ -966,8 +966,12 @@ static int ocrdma_wait_mqe_cmpl(struct ocrdma_dev *dev)
 				    msecs_to_jiffies(30000));
 	if (status)
 		return 0;
-	else
+	else {
+		dev->mqe_ctx.fw_error_state = true;
+		pr_err("%s(%d) mailbox timeout: fw not responding\n",
+		       __func__, dev->id);
 		return -1;
+	}
 }
 
 /* issue a mailbox command on the MQ */
@@ -979,6 +983,8 @@ static int ocrdma_mbx_cmd(struct ocrdma_dev *dev, struct ocrdma_mqe *mqe)
 	struct ocrdma_mbx_rsp *rsp = NULL;
 
 	mutex_lock(&dev->mqe_ctx.lock);
+	if (dev->mqe_ctx.fw_error_state)
+		goto mbx_err;
 	ocrdma_post_mqe(dev, mqe);
 	status = ocrdma_wait_mqe_cmpl(dev);
 	if (status)
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
index 7f54d24..8cd16a1 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
@@ -329,7 +329,10 @@ static int ocrdma_dealloc_ucontext_pd(struct ocrdma_ucontext *uctx)
 	struct ocrdma_pd *pd = uctx->cntxt_pd;
 	struct ocrdma_dev *dev = get_ocrdma_dev(pd->ibpd.device);
 
-	BUG_ON(uctx->pd_in_use);
+	if (uctx->pd_in_use) {
+		pr_err("%s(%d) Freeing in use pdid=0x%x.\n",
+		       __func__, dev->id, pd->id);
+	}
 	uctx->cntxt_pd = NULL;
 	status = _ocrdma_dealloc_pd(dev, pd);
 	return status;
@@ -844,6 +847,13 @@ int ocrdma_dereg_mr(struct ib_mr *ib_mr)
 	if (mr->umem)
 		ib_umem_release(mr->umem);
 	kfree(mr);
+
+	/* Don't stop cleanup, in case FW is unresponsive */
+	if (dev->mqe_ctx.fw_error_state) {
+		status = 0;
+		pr_err("%s(%d) fw not responding.\n",
+		       __func__, dev->id);
+	}
 	return status;
 }
 
-- 
1.7.12.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-06-04  8:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1401871966-20408-1-git-send-email-selvin.xavier@emulex.com>
     [not found] ` <1401871966-20408-1-git-send-email-selvin.xavier-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
2014-06-04  8:52   ` [PATCH for-next 01/15] RDMA/ocrdma: Avoid posting DPP requests for Selvin Xavier
     [not found] ` <1401871966-20408-2-git-send-email-selvin.xavier@emulex.com>
     [not found]   ` <1401871966-20408-2-git-send-email-selvin.xavier-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
2014-06-04  8:52     ` [PATCH for-next 02/15] RDMA/ocrdma: Query and initalize the PFC SL Selvin Xavier
     [not found]       ` <17b84e4b-a78f-40a0-bfa7-cdc3afb53fc1-3RiH6ntJJkP8BX6JNMqfyFjyZtpTMMwT@public.gmane.org>
2014-06-09 21:05         ` Or Gerlitz
     [not found]   ` <1401871966-20408-3-git-send-email-selvin.xavier@emulex.com>
     [not found]     ` <1401871966-20408-3-git-send-email-selvin.xavier-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
2014-06-04  8:52       ` [PATCH for-next 03/15] RDMA/ocrdma: Adding hca_type and fixing Selvin Xavier
     [not found]     ` <1401871966-20408-4-git-send-email-selvin.xavier@emulex.com>
     [not found]       ` <1401871966-20408-4-git-send-email-selvin.xavier-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
2014-06-04  8:52         ` [PATCH for-next 04/15] be2net: issue shutdown event to ocrdma driver Selvin Xavier
     [not found]       ` <1401871966-20408-5-git-send-email-selvin.xavier@emulex.com>
     [not found]         ` <1401871966-20408-5-git-send-email-selvin.xavier-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
2014-06-04  8:52           ` [PATCH for-next 05/15] RDMA/ocrdma: Handle shutdown event from Selvin Xavier
     [not found]         ` <1401871966-20408-6-git-send-email-selvin.xavier@emulex.com>
     [not found]           ` <1401871966-20408-6-git-send-email-selvin.xavier-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
2014-06-04  8:52             ` [PATCH for-next 06/15] RDMA/ocrdma: Remove hardcoding of the max DPP Selvin Xavier
     [not found]           ` <1401871966-20408-7-git-send-email-selvin.xavier@emulex.com>
     [not found]             ` <1401871966-20408-7-git-send-email-selvin.xavier-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
2014-06-04  8:52               ` [PATCH for-next 07/15] RDMA/ocrdma: Delete AH table if Selvin Xavier
     [not found]             ` <1401871966-20408-8-git-send-email-selvin.xavier@emulex.com>
     [not found]               ` <1401871966-20408-8-git-send-email-selvin.xavier-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
2014-06-04  8:52                 ` [PATCH for-next 08/15] RDMA/ocrdma: Avoid reporting wrong Selvin Xavier
     [not found]               ` <1401871966-20408-9-git-send-email-selvin.xavier@emulex.com>
     [not found]                 ` <1401871966-20408-9-git-send-email-selvin.xavier-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
2014-06-04  8:52                   ` [PATCH for-next 09/15] RDMA/ocrdma: Allow only SEND opcode in case Selvin Xavier
     [not found]                 ` <1401871966-20408-10-git-send-email-selvin.xavier@emulex.com>
     [not found]                   ` <1401871966-20408-10-git-send-email-selvin.xavier-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
2014-06-04  8:52                     ` Selvin Xavier [this message]
     [not found]                   ` <1401871966-20408-11-git-send-email-selvin.xavier@emulex.com>
     [not found]                     ` <1401871966-20408-11-git-send-email-selvin.xavier-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
2014-06-04  8:52                       ` [PATCH for-next 11/15] RDMA/ocrdma: Return proper value for Selvin Xavier
     [not found]                     ` <1401871966-20408-12-git-send-email-selvin.xavier@emulex.com>
     [not found]                       ` <1401871966-20408-12-git-send-email-selvin.xavier-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
2014-06-04  8:52                         ` [PATCH for-next 12/15] RDMA/ocrdma : Add missing adapter mailbox Selvin Xavier
     [not found]                       ` <1401871966-20408-13-git-send-email-selvin.xavier@emulex.com>
     [not found]                         ` <1401871966-20408-13-git-send-email-selvin.xavier-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
2014-06-04  8:52                           ` [PATCH for-next 13/15] RDMA/ocrdma: Increase the size of STAG array Selvin Xavier
     [not found]                         ` <1401871966-20408-14-git-send-email-selvin.xavier@emulex.com>
     [not found]                           ` <1401871966-20408-14-git-send-email-selvin.xavier-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
2014-06-04  8:52                             ` [PATCH for-next 14/15] RDMA/ocrdma: Initialize the GID table while Selvin Xavier
     [not found]                           ` <1401871966-20408-15-git-send-email-selvin.xavier@emulex.com>
     [not found]                             ` <1401871966-20408-15-git-send-email-selvin.xavier-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
2014-06-04  8:52                               ` [PATCH for-next 15/15] RDMA/ocrdma: Fixing a sparse warning Selvin Xavier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a1df2ff2-10b1-4a54-8682-e8dbd5271028@CMEXHTCAS1.ad.emulex.com \
    --to=selvin.xavier-lakksmnt4hbqt0dzr+alfa@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mitesh.ahuja-HfQkIhtri/DQT0dZR+AlfA@public.gmane.org \
    --cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.