----- Original Message -----
> From: "CAI Qian" <[email protected]>
> To: "Roland Dreier" <[email protected]>, "Sean Hefty" <[email protected]>, 
> "Hal Rosenstock"
> <[email protected]>
> Cc: [email protected], "Tatyana Nikolova" <[email protected]>
> Sent: Friday, December 14, 2012 5:49:19 PM
> Subject: [PATCH] RDMA/nes: Fix for terminate timer crash
> 
> Roland, Sean, Hal, please help ACK this patch if you agree this
> is applicable to the stable trees, so that Greg could commit it
> there.
Hi, any ACK/NAK here?
> 
> From: Tatyana Nikolova <[email protected]>
> Commit: 7bfcfa51c35cdd2d37e0d70fc11790642dd11fb3
> Stable-trees: 3.7.x, 3.6.x, 3.4.x, 3.0.x
> 
> The terminate timer needs to be initialized just once.
> 
> Signed-off-by: Tatyana Nikolova <[email protected]>
> Signed-off-by: Roland Dreier <[email protected]>
> Signed-off-by: CAI Qian <[email protected]>
> 
> diff --git a/drivers/infiniband/hw/nes/nes.h
> b/drivers/infiniband/hw/nes/nes.h
> index 5cac29e..33cc589 100644
> --- a/drivers/infiniband/hw/nes/nes.h
> +++ b/drivers/infiniband/hw/nes/nes.h
> @@ -532,6 +532,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
>  *);
> diff --git a/drivers/infiniband/hw/nes/nes_hw.c
> b/drivers/infiniband/hw/nes/nes_hw.c
> index fe7965e..67647e2 100644
> --- a/drivers/infiniband/hw/nes/nes_hw.c
> +++ b/drivers/infiniband/hw/nes/nes_hw.c
> @@ -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
> @@ -3520,7 +3519,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;
>  
> @@ -3530,11 +3529,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));
>  }
>  
>  /**
> diff --git a/drivers/infiniband/hw/nes/nes_verbs.c
> b/drivers/infiniband/hw/nes/nes_verbs.c
> index cd0ecb2..c47ec25 100644
> --- a/drivers/infiniband/hw/nes/nes_verbs.c
> +++ b/drivers/infiniband/hw/nes/nes_verbs.c
> @@ -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);
> +     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;
> @@ -1413,7 +1416,6 @@ static struct ib_qp *nes_create_qp(struct ib_pd
> *ibpd,
>       return &nesqp->ibqp;
>  }
>  
> -
>  /**
>   * nes_clean_cq
>   */
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to