LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] IB/ehca: remove reference to the QP in case of port activation failure
@ 2008-11-04 14:54 Stefan Roscher
2008-11-04 21:37 ` Roland Dreier
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Roscher @ 2008-11-04 14:54 UTC (permalink / raw)
To: LinuxPPC-Dev, Roland Dreier, LKML, OF-EWG
Cc: raisch, hnguyen, fenkes, stefan.roscher, alexschm
If the initialization of a special QP (e.g. AQP1) fails due to a software timeout,
we have to remove the reference to that special QP struct from the port struct
preventing the driver to access the QP, since it will be/has been destroyed
by the caller, ie in this case ib_mad.
This patch will apply cleanly on top of 2.6.28 git tree.
Signed-off-by: Stefan Roscher <stefan.roscher@de.ibm.com>
---
drivers/infiniband/hw/ehca/ehca_irq.c | 7 +++++--
drivers/infiniband/hw/ehca/ehca_qp.c | 5 +++++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c
index cb55be0..9e43459 100644
--- a/drivers/infiniband/hw/ehca/ehca_irq.c
+++ b/drivers/infiniband/hw/ehca/ehca_irq.c
@@ -370,6 +370,10 @@ static void parse_ec(struct ehca_shca *shca, u64 eqe)
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);
@@ -387,8 +391,7 @@ static void parse_ec(struct ehca_shca *shca, u64 eqe)
sport->port_state = IB_PORT_ACTIVE;
dispatch_port_event(shca, port, IB_EVENT_PORT_ACTIVE,
"is active");
- ehca_query_sma_attr(shca, port,
- &sport->saved_attr);
+ ehca_query_sma_attr(shca, port, &sport->saved_attr);
} else {
sport->port_state = IB_PORT_DOWN;
dispatch_port_event(shca, port, IB_EVENT_PORT_ERR,
diff --git a/drivers/infiniband/hw/ehca/ehca_qp.c b/drivers/infiniband/hw/ehca/ehca_qp.c
index 4d54b9f..9e05ee2 100644
--- a/drivers/infiniband/hw/ehca/ehca_qp.c
+++ b/drivers/infiniband/hw/ehca/ehca_qp.c
@@ -860,6 +860,11 @@ static struct ehca_qp *internal_create_qp(
if (qp_type == IB_QPT_GSI) {
h_ret = ehca_define_sqp(shca, my_qp, init_attr);
if (h_ret != H_SUCCESS) {
+ kfree(my_qp->mod_qp_parm);
+ my_qp->mod_qp_parm = NULL;
+ /* the QP pointer is no longer valid */
+ shca->sport[init_attr->port_num - 1].ibqp_sqp[qp_type] =
+ NULL;
ret = ehca2ib_return_code(h_ret);
goto create_qp_exit6;
}
--
1.5.5
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] IB/ehca: remove reference to the QP in case of port activation failure
2008-11-04 14:54 [PATCH] IB/ehca: remove reference to the QP in case of port activation failure Stefan Roscher
@ 2008-11-04 21:37 ` Roland Dreier
0 siblings, 0 replies; 2+ messages in thread
From: Roland Dreier @ 2008-11-04 21:37 UTC (permalink / raw)
To: Stefan Roscher
Cc: LinuxPPC-Dev, Roland Dreier, LKML, OF-EWG, raisch, hnguyen,
fenkes, stefan.roscher, alexschm
thanks, applied
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-04 21:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-04 14:54 [PATCH] IB/ehca: remove reference to the QP in case of port activation failure Stefan Roscher
2008-11-04 21:37 ` Roland Dreier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).