Commit 49896bd5 authored by Tatyana Nikolova's avatar Tatyana Nikolova Committed by Ben Hutchings

RDMA/nes: Fix for terminate timer crash

commit 7bfcfa51 upstream.

The terminate timer needs to be initialized just once.
Signed-off-by: default avatarTatyana Nikolova <Tatyana.E.Nikolova@intel.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 25721173
...@@ -524,6 +524,7 @@ void nes_iwarp_ce_handler(struct nes_device *, struct nes_hw_cq *); ...@@ -524,6 +524,7 @@ void nes_iwarp_ce_handler(struct nes_device *, struct nes_hw_cq *);
int nes_destroy_cqp(struct nes_device *); int nes_destroy_cqp(struct nes_device *);
int nes_nic_cm_xmit(struct sk_buff *, struct net_device *); int nes_nic_cm_xmit(struct sk_buff *, struct net_device *);
void nes_recheck_link_status(struct work_struct *work); void nes_recheck_link_status(struct work_struct *work);
void nes_terminate_timeout(unsigned long context);
/* nes_nic.c */ /* nes_nic.c */
struct net_device *nes_netdev_init(struct nes_device *, void __iomem *); struct net_device *nes_netdev_init(struct nes_device *, void __iomem *);
......
...@@ -75,7 +75,6 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev, ...@@ -75,7 +75,6 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev,
static void process_critical_error(struct nes_device *nesdev); static void process_critical_error(struct nes_device *nesdev);
static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number); static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number);
static unsigned int nes_reset_adapter_ne020(struct nes_device *nesdev, u8 *OneG_Mode); static unsigned int nes_reset_adapter_ne020(struct nes_device *nesdev, u8 *OneG_Mode);
static void nes_terminate_timeout(unsigned long context);
static void nes_terminate_start_timer(struct nes_qp *nesqp); static void nes_terminate_start_timer(struct nes_qp *nesqp);
#ifdef CONFIG_INFINIBAND_NES_DEBUG #ifdef CONFIG_INFINIBAND_NES_DEBUG
...@@ -3522,7 +3521,7 @@ static void nes_terminate_received(struct nes_device *nesdev, ...@@ -3522,7 +3521,7 @@ static void nes_terminate_received(struct nes_device *nesdev,
} }
/* Timeout routine in case terminate fails to complete */ /* Timeout routine in case terminate fails to complete */
static void nes_terminate_timeout(unsigned long context) void nes_terminate_timeout(unsigned long context)
{ {
struct nes_qp *nesqp = (struct nes_qp *)(unsigned long)context; struct nes_qp *nesqp = (struct nes_qp *)(unsigned long)context;
...@@ -3532,11 +3531,7 @@ static void nes_terminate_timeout(unsigned long context) ...@@ -3532,11 +3531,7 @@ static void nes_terminate_timeout(unsigned long context)
/* Set a timer in case hw cannot complete the terminate sequence */ /* Set a timer in case hw cannot complete the terminate sequence */
static void nes_terminate_start_timer(struct nes_qp *nesqp) static void nes_terminate_start_timer(struct nes_qp *nesqp)
{ {
init_timer(&nesqp->terminate_timer); mod_timer(&nesqp->terminate_timer, (jiffies + HZ));
nesqp->terminate_timer.function = nes_terminate_timeout;
nesqp->terminate_timer.expires = jiffies + HZ;
nesqp->terminate_timer.data = (unsigned long)nesqp;
add_timer(&nesqp->terminate_timer);
} }
/** /**
......
...@@ -1404,6 +1404,9 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd, ...@@ -1404,6 +1404,9 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd,
} }
nesqp->sig_all = (init_attr->sq_sig_type == IB_SIGNAL_ALL_WR); nesqp->sig_all = (init_attr->sq_sig_type == IB_SIGNAL_ALL_WR);
init_timer(&nesqp->terminate_timer);
nesqp->terminate_timer.function = nes_terminate_timeout;
nesqp->terminate_timer.data = (unsigned long)nesqp;
/* update the QP table */ /* update the QP table */
nesdev->nesadapter->qp_table[nesqp->hwqp.qp_id-NES_FIRST_QPN] = nesqp; nesdev->nesadapter->qp_table[nesqp->hwqp.qp_id-NES_FIRST_QPN] = nesqp;
...@@ -1413,7 +1416,6 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd, ...@@ -1413,7 +1416,6 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd,
return &nesqp->ibqp; return &nesqp->ibqp;
} }
/** /**
* nes_clean_cq * nes_clean_cq
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment