From: Joachim Fenkes <fenkes@de.ibm.com>
To: LinuxPPC-Dev <linuxppc-dev@ozlabs.org>,
LKML <linux-kernel@vger.kernel.org>,
OF-General <general@lists.openfabrics.org>,
Roland Dreier <rolandd@cisco.com>,
OF-EWG <ewg@lists.openfabrics.org>
Cc: Stefan Roscher <stefan.roscher@de.ibm.com>,
Christoph Raisch <raisch@de.ibm.com>,
"Hoang-Nam Nguyen" <hnguyen@de.ibm.com>,
Alexander Schmidt <alexschm@de.ibm.com>
Subject: [PATCH] IB/ehca: Fix suppression of port activation events
Date: Fri, 7 Nov 2008 17:42:51 +0100 [thread overview]
Message-ID: <200811071742.51867.fenkes@de.ibm.com> (raw)
In-Reply-To: <48499C11.7030504@gmail.com>
A previous fix introduced a regression where port activation events were
dropped unconditionally if port autodetection was not enabled. Fixed.
Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
---
Roland -- this patch is made against your for-linus branch. Please review
and apply if you think it's okay. Hope it's not too late for the next kernel.
Joachim
drivers/infiniband/hw/ehca/ehca_irq.c | 45 +++++++++++++++++++-------------
1 files changed, 27 insertions(+), 18 deletions(-)
diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c
index 9e43459..757035e 100644
--- a/drivers/infiniband/hw/ehca/ehca_irq.c
+++ b/drivers/infiniband/hw/ehca/ehca_irq.c
@@ -359,34 +359,43 @@ static void notify_port_conf_change(struct ehca_shca *shca, int port_num)
*old_attr = new_attr;
}
+/* replay modify_qp for sqps -- return 0 if all is well, 1 if AQP1 destroyed */
+static int replay_modify_qp(struct ehca_sport *sport)
+{
+ int aqp1_destroyed;
+ unsigned long flags;
+
+ spin_lock_irqsave(&sport->mod_sqp_lock, flags);
+
+ aqp1_destroyed = !sport->ibqp_sqp[IB_QPT_GSI];
+
+ if (sport->ibqp_sqp[IB_QPT_SMI])
+ ehca_recover_sqp(sport->ibqp_sqp[IB_QPT_SMI]);
+ if (!aqp1_destroyed)
+ ehca_recover_sqp(sport->ibqp_sqp[IB_QPT_GSI]);
+
+ spin_unlock_irqrestore(&sport->mod_sqp_lock, flags);
+
+ return aqp1_destroyed;
+}
+
static void parse_ec(struct ehca_shca *shca, u64 eqe)
{
u8 ec = EHCA_BMASK_GET(NEQE_EVENT_CODE, eqe);
u8 port = EHCA_BMASK_GET(NEQE_PORT_NUMBER, eqe);
u8 spec_event;
struct ehca_sport *sport = &shca->sport[port - 1];
- unsigned long flags;
switch (ec) {
case 0x30: /* port availability change */
if (EHCA_BMASK_GET(NEQE_PORT_AVAILABILITY, eqe)) {
- /* only for autodetect mode important */
- if (ehca_nr_ports >= 0)
- break;
-
- int suppress_event;
- /* replay modify_qp for sqps */
- spin_lock_irqsave(&sport->mod_sqp_lock, flags);
- suppress_event = !sport->ibqp_sqp[IB_QPT_GSI];
- if (sport->ibqp_sqp[IB_QPT_SMI])
- ehca_recover_sqp(sport->ibqp_sqp[IB_QPT_SMI]);
- if (!suppress_event)
- ehca_recover_sqp(sport->ibqp_sqp[IB_QPT_GSI]);
- spin_unlock_irqrestore(&sport->mod_sqp_lock, flags);
-
- /* AQP1 was destroyed, ignore this event */
- if (suppress_event)
- break;
+ /* only replay modify_qp calls in autodetect mode;
+ * if AQP1 was destroyed, the port is already down
+ * again and we can drop the event.
+ */
+ if (ehca_nr_ports < 0)
+ if (replay_modify_qp(sport))
+ break;
sport->port_state = IB_PORT_ACTIVE;
dispatch_port_event(shca, port, IB_EVENT_PORT_ACTIVE,
--
1.5.5
next prev parent reply other threads:[~2008-11-07 16:43 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-06 16:35 IB/ehca: Reject send WRs only for RESET, INIT and RTR state Joachim Fenkes
2008-06-06 18:22 ` Roland Dreier
2008-06-06 20:20 ` [ofa-general] " Dotan Barak
2008-06-09 11:24 ` [PATCH] IB/ehca: Reject recv WRs if QP is in RESET state Joachim Fenkes
2008-06-20 17:26 ` Roland Dreier
2008-07-01 14:14 ` [PATCH] IB/ehca: Make device table externally visible Joachim Fenkes
2008-07-01 17:55 ` Roland Dreier
2008-11-07 16:42 ` Joachim Fenkes [this message]
2008-11-10 20:36 ` [PATCH] IB/ehca: Fix suppression of port activation events Roland Dreier
2008-11-11 9:04 ` Joachim Fenkes
2008-11-21 15:37 ` [PATCH] IB/ehca: Fix lockdep failures for shca_list_lock Joachim Fenkes
2008-11-21 16:02 ` Johannes Berg
2008-11-21 16:18 ` [PATCH] IB/ehca: Fix locking " Joachim Fenkes
2008-11-21 18:28 ` Roland Dreier
2008-11-22 3:41 ` [PATCH] IB/ehca: Fix lockdep failures " Michael Ellerman
2008-11-25 12:58 ` [PATCH] IB/ehca: Change misleading error message Joachim Fenkes
2008-11-25 23:13 ` Roland Dreier
2008-11-26 13:44 ` Joachim Fenkes
2009-06-03 14:28 ` [PATCH] IB/ehca: Remove superfluous bitmasks from QP control block Joachim Fenkes
2009-06-03 20:26 ` Roland Dreier
2009-09-01 11:55 ` [PATCH] IB/ehca: Fix CQE flags reporting Joachim Fenkes
2009-09-01 19:55 ` Roland Dreier
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=200811071742.51867.fenkes@de.ibm.com \
--to=fenkes@de.ibm.com \
--cc=alexschm@de.ibm.com \
--cc=ewg@lists.openfabrics.org \
--cc=general@lists.openfabrics.org \
--cc=hnguyen@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=raisch@de.ibm.com \
--cc=rolandd@cisco.com \
--cc=stefan.roscher@de.ibm.com \
/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
all inboxes | Powered by JetHome®