]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
RDMA/nes: Fix for terminate timer crash
authorTatyana Nikolova <Tatyana.E.Nikolova@intel.com>
Thu, 6 Dec 2012 19:58:27 +0000 (19:58 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jan 2013 16:43:55 +0000 (08:43 -0800)
commit 7bfcfa51c35cdd2d37e0d70fc11790642dd11fb3 upstream.

The terminate timer needs to be initialized just once.

Signed-off-by: Tatyana Nikolova <Tatyana.E.Nikolova@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: CAI Qian <caiqian@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/nes/nes.h
drivers/infiniband/hw/nes/nes_hw.c
drivers/infiniband/hw/nes/nes_verbs.c

index 6fe79876009e4e070ee01ea00528594ab65f52d5..6e3027387e2ad25239d1cf60b8003ba6fe825246 100644 (file)
@@ -511,6 +511,7 @@ void nes_iwarp_ce_handler(struct nes_device *, struct nes_hw_cq *);
 int nes_destroy_cqp(struct nes_device *);
 int nes_nic_cm_xmit(struct sk_buff *, struct net_device *);
 void nes_recheck_link_status(struct work_struct *work);
+void nes_terminate_timeout(unsigned long context);
 
 /* nes_nic.c */
 struct net_device *nes_netdev_init(struct nes_device *, void __iomem *);
index 96fa9a4cafdf29eecc39a8b181b9944e4569ad7a..ba4814a21ab248c44c3c32ac0f8e82e77a4322ac 100644 (file)
@@ -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 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 void nes_terminate_timeout(unsigned long context);
 static void nes_terminate_start_timer(struct nes_qp *nesqp);
 
 #ifdef CONFIG_INFINIBAND_NES_DEBUG
@@ -3496,7 +3495,7 @@ static void nes_terminate_received(struct nes_device *nesdev,
 }
 
 /* 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;
 
@@ -3506,11 +3505,7 @@ static void nes_terminate_timeout(unsigned long context)
 /* Set a timer in case hw cannot complete the terminate sequence */
 static void nes_terminate_start_timer(struct nes_qp *nesqp)
 {
-       init_timer(&nesqp->terminate_timer);
-       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);
+       mod_timer(&nesqp->terminate_timer, (jiffies + HZ));
 }
 
 /**
index 6da5224bfda0d90d80c9313bdd61702e14800c94..59db49fbec8770ded79376be44d52d51a06c2e6c 100644 (file)
@@ -1414,6 +1414,9 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd,
        }
 
        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 */
        nesdev->nesadapter->qp_table[nesqp->hwqp.qp_id-NES_FIRST_QPN] = nesqp;
@@ -1423,7 +1426,6 @@ static struct ib_qp *nes_create_qp(struct ib_pd *ibpd,
        return &nesqp->ibqp;
 }
 
-
 /**
  * nes_clean_cq
  */