public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Easwar Hariharan
	<easwar.hariharan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Dean Luick <dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: [PATCH 01/15] IB/hfi1: Ignore non-temperature warnings on a downed link
Date: Thu, 12 May 2016 10:22:33 -0700	[thread overview]
Message-ID: <20160512172231.9741.19366.stgit@scvm10.sc.intel.com> (raw)
In-Reply-To: <20160512172050.9741.84190.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>

From: Easwar Hariharan <easwar.hariharan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

QSFP modules can raise an interrupt to inform us of expected conditions
while the link is down, such as RX power low. Actively ignore these
conditions when the link is down as they only add reporting noise.
Continue reporting conditions that are valid at all times, such as
temperature alarms and warnings.

Reviewed-by: Dean Luick <dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Easwar Hariharan <easwar.hariharan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/staging/rdma/hfi1/chip.c |   17 +++++++++++------
 drivers/staging/rdma/hfi1/diag.c |    2 +-
 drivers/staging/rdma/hfi1/hfi.h  |    1 +
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rdma/hfi1/chip.c b/drivers/staging/rdma/hfi1/chip.c
index dcae8e7..f6ae0ba 100644
--- a/drivers/staging/rdma/hfi1/chip.c
+++ b/drivers/staging/rdma/hfi1/chip.c
@@ -6105,7 +6105,7 @@ int acquire_lcb_access(struct hfi1_devdata *dd, int sleep_ok)
 	}
 
 	/* this access is valid only when the link is up */
-	if ((ppd->host_link_state & HLS_UP) == 0) {
+	if (ppd->host_link_state & HLS_DOWN) {
 		dd_dev_info(dd, "%s: link state %s not up\n",
 			    __func__, link_state_name(ppd->host_link_state));
 		ret = -EBUSY;
@@ -7429,7 +7429,7 @@ void apply_link_downgrade_policy(struct hfi1_pportdata *ppd, int refresh_widths)
 retry:
 	mutex_lock(&ppd->hls_lock);
 	/* only apply if the link is up */
-	if (!(ppd->host_link_state & HLS_UP)) {
+	if (ppd->host_link_state & HLS_DOWN) {
 		/* still going up..wait and retry */
 		if (ppd->host_link_state & HLS_GOING_UP) {
 			if (++tries < 1000) {
@@ -9252,6 +9252,12 @@ static int handle_qsfp_error_conditions(struct hfi1_pportdata *ppd,
 		dd_dev_info(dd, "%s: QSFP cable temperature too low\n",
 			    __func__);
 
+	/*
+	 * The remaining alarms/warnings don't matter if the link is down.
+	 */
+	if (ppd->host_link_state & HLS_DOWN)
+		return 0;
+
 	if ((qsfp_interrupt_status[1] & QSFP_HIGH_VCC_ALARM) ||
 	    (qsfp_interrupt_status[1] & QSFP_HIGH_VCC_WARNING))
 		dd_dev_info(dd, "%s: QSFP supply voltage too high\n",
@@ -9346,9 +9352,8 @@ void qsfp_event(struct work_struct *work)
 		return;
 
 	/*
-	 * Turn DC back on after cables has been
-	 * re-inserted. Up until now, the DC has been in
-	 * reset to save power.
+	 * Turn DC back on after cable has been re-inserted. Up until
+	 * now, the DC has been in reset to save power.
 	 */
 	dc_start(dd);
 
@@ -10074,7 +10079,7 @@ u32 driver_physical_state(struct hfi1_pportdata *ppd)
  */
 u32 driver_logical_state(struct hfi1_pportdata *ppd)
 {
-	if (ppd->host_link_state && !(ppd->host_link_state & HLS_UP))
+	if (ppd->host_link_state && (ppd->host_link_state & HLS_DOWN))
 		return IB_PORT_DOWN;
 
 	switch (ppd->host_link_state & HLS_UP) {
diff --git a/drivers/staging/rdma/hfi1/diag.c b/drivers/staging/rdma/hfi1/diag.c
index 4cf6e8d..d262918 100644
--- a/drivers/staging/rdma/hfi1/diag.c
+++ b/drivers/staging/rdma/hfi1/diag.c
@@ -996,7 +996,7 @@ static long hfi1_assign_snoop_link_credits(struct hfi1_pportdata *ppd,
 	u16  per_vl_credits;
 	__be16 be_per_vl_credits;
 
-	if (!(ppd->host_link_state & HLS_UP))
+	if (ppd->host_link_state & HLS_DOWN)
 		goto err_exit;
 	if (total_credits  <  vl15_credits)
 		goto err_exit;
diff --git a/drivers/staging/rdma/hfi1/hfi.h b/drivers/staging/rdma/hfi1/hfi.h
index 7351898..6485a1d 100644
--- a/drivers/staging/rdma/hfi1/hfi.h
+++ b/drivers/staging/rdma/hfi1/hfi.h
@@ -453,6 +453,7 @@ struct rvt_sge_state;
 #define HLS_LINK_COOLDOWN BIT(__HLS_LINK_COOLDOWN_BP)
 
 #define HLS_UP (HLS_UP_INIT | HLS_UP_ARMED | HLS_UP_ACTIVE)
+#define HLS_DOWN ~(HLS_UP)
 
 /* use this MTU size if none other is given */
 #define HFI1_DEFAULT_ACTIVE_MTU 10240

--
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:[~2016-05-12 17:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-12 17:22 [PATCH 00/15] IB/hfi1, rdmavt, core: Misc fixes and improvements for 4.7 Dennis Dalessandro
     [not found] ` <20160512172050.9741.84190.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org>
2016-05-12 17:22   ` Dennis Dalessandro [this message]
2016-05-12 17:22   ` [PATCH 02/15] IB/hfi1: Wait for QSFP modules to initialize Dennis Dalessandro
2016-05-12 17:22   ` [PATCH 03/15] IB/hfi1: Correct external device configuration shift Dennis Dalessandro
2016-05-12 17:22   ` [PATCH 04/15] IB/hfi1: Remove no-op QSFP reset code Dennis Dalessandro
2016-05-12 17:22   ` [PATCH 05/15] IB/hfi1: Fix pio wait counter double increment Dennis Dalessandro
2016-05-12 17:23   ` [PATCH 06/15] IB/hfi1: Fix potential panic with sdma drained mechanism Dennis Dalessandro
2016-05-12 17:23   ` [PATCH 07/15] IB/hfi1: Improve performance of interval RB trees Dennis Dalessandro
2016-05-12 17:23   ` [PATCH 08/15] IB/hfi1: Remove unnecessary header Dennis Dalessandro
2016-05-12 17:23   ` [PATCH 09/15] IB/hfi1: Fix hfi_rcvhdr tracepoint Dennis Dalessandro
2016-05-12 17:23   ` [PATCH 10/15] IB/rdmavt: Increase CQ callback thread priority Dennis Dalessandro
2016-05-12 17:23   ` [PATCH 11/15] IB/hfi1: Correct log message strings Dennis Dalessandro
2016-05-12 17:23   ` [PATCH 12/15] IB/hfi1: Immediately apply congestion setting MAD Dennis Dalessandro
2016-05-12 17:23   ` [PATCH 13/15] IB/hfi1: Keep SC_USER as the last send context type Dennis Dalessandro
2016-05-12 17:23   ` [PATCH 14/15] ib_pack.h: Add opcode definition for send with invalidate Dennis Dalessandro
2016-05-12 17:24   ` [PATCH 15/15] IB/hfi1: Change hfi1_init loop to preserve error returns Dennis Dalessandro
2016-05-12 18:53   ` [PATCH 00/15] IB/hfi1, rdmavt, core: Misc fixes and improvements for 4.7 Doug Ledford

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=20160512172231.9741.19366.stgit@scvm10.sc.intel.com \
    --to=dennis.dalessandro-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=dean.luick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=easwar.hariharan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox