From: Eldad Zinger Date: Thu, 8 Jul 2010 13:27:20 +0000 (+0300) Subject: sdp: tx_ring timer should not be scheduled if the qp is not active anymore. X-Git-Tag: v4.1.12-92~264^2~5^2~146 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ba7dd6daae49ac51c34685bc5226bcf4ef5c9632;p=users%2Fjedix%2Flinux-maple.git sdp: tx_ring timer should not be scheduled if the qp is not active anymore. Signed-off-by: Eldad Zinger --- diff --git a/drivers/infiniband/ulp/sdp/sdp_tx.c b/drivers/infiniband/ulp/sdp/sdp_tx.c index e52f0382addb3..5c6207bf95e08 100644 --- a/drivers/infiniband/ulp/sdp/sdp_tx.c +++ b/drivers/infiniband/ulp/sdp/sdp_tx.c @@ -50,7 +50,7 @@ int sdp_xmit_poll(struct sdp_sock *ssk, int force) /* If we don't have a pending timer, set one up to catch our recent post in case the interface becomes idle */ - if (!timer_pending(&ssk->tx_ring.timer)) + if (likely(ssk->qp_active) && !timer_pending(&ssk->tx_ring.timer)) mod_timer(&ssk->tx_ring.timer, jiffies + SDP_TX_POLL_TIMEOUT); ssk->tx_compl_pending = 0; @@ -421,7 +421,10 @@ static void sdp_tx_irq(struct ib_cq *cq, void *cq_context) if (sdp_tx_handler_select(ssk)) { sdp_prf1(sk, NULL, "poll and post from tasklet"); - mod_timer(&ssk->tx_ring.timer, jiffies + SDP_TX_POLL_TIMEOUT); + if (likely(ssk->qp_active)) { + mod_timer(&ssk->tx_ring.timer, + jiffies + SDP_TX_POLL_TIMEOUT); + } tasklet_schedule(&ssk->tx_ring.tasklet); } }