diff options
author | Tatyana Nikolova <Tatyana.E.Nikolova@intel.com> | 2012-12-06 14:56:31 -0500 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2012-12-08 03:31:02 -0500 |
commit | 00ad255d17c2d12a035370836cb93630711d48ca (patch) | |
tree | 38302f0b41dfb5b9701d5428468c0ba0c669ce58 /drivers/infiniband/hw/nes | |
parent | 079abea6a37fd3b4f7e1b7cf9e4d055463988753 (diff) |
RDMA/nes: Fix for BUG_ON due to adding already-pending timer
To avoid nes tcp_timer crash for SMP architectures, add_timer is
replaced with mod_timer.
Signed-off-by: Tatyana Nikolova <Tatyana.E.Nikolova@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/nes')
-rw-r--r-- | drivers/infiniband/hw/nes/nes_cm.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c index feb41e74206b..22ea67eea5dc 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c | |||
@@ -669,7 +669,6 @@ int schedule_nes_timer(struct nes_cm_node *cm_node, struct sk_buff *skb, | |||
669 | struct nes_cm_core *cm_core = cm_node->cm_core; | 669 | struct nes_cm_core *cm_core = cm_node->cm_core; |
670 | struct nes_timer_entry *new_send; | 670 | struct nes_timer_entry *new_send; |
671 | int ret = 0; | 671 | int ret = 0; |
672 | u32 was_timer_set; | ||
673 | 672 | ||
674 | new_send = kzalloc(sizeof(*new_send), GFP_ATOMIC); | 673 | new_send = kzalloc(sizeof(*new_send), GFP_ATOMIC); |
675 | if (!new_send) | 674 | if (!new_send) |
@@ -721,12 +720,8 @@ int schedule_nes_timer(struct nes_cm_node *cm_node, struct sk_buff *skb, | |||
721 | } | 720 | } |
722 | } | 721 | } |
723 | 722 | ||
724 | was_timer_set = timer_pending(&cm_core->tcp_timer); | 723 | if (!timer_pending(&cm_core->tcp_timer)) |
725 | 724 | mod_timer(&cm_core->tcp_timer, new_send->timetosend); | |
726 | if (!was_timer_set) { | ||
727 | cm_core->tcp_timer.expires = new_send->timetosend; | ||
728 | add_timer(&cm_core->tcp_timer); | ||
729 | } | ||
730 | 725 | ||
731 | return ret; | 726 | return ret; |
732 | } | 727 | } |
@@ -944,10 +939,8 @@ static void nes_cm_timer_tick(unsigned long pass) | |||
944 | } | 939 | } |
945 | 940 | ||
946 | if (settimer) { | 941 | if (settimer) { |
947 | if (!timer_pending(&cm_core->tcp_timer)) { | 942 | if (!timer_pending(&cm_core->tcp_timer)) |
948 | cm_core->tcp_timer.expires = nexttimeout; | 943 | mod_timer(&cm_core->tcp_timer, nexttimeout); |
949 | add_timer(&cm_core->tcp_timer); | ||
950 | } | ||
951 | } | 944 | } |
952 | } | 945 | } |
953 | 946 | ||
@@ -1312,8 +1305,6 @@ static int mini_cm_del_listen(struct nes_cm_core *cm_core, | |||
1312 | static inline int mini_cm_accelerated(struct nes_cm_core *cm_core, | 1305 | static inline int mini_cm_accelerated(struct nes_cm_core *cm_core, |
1313 | struct nes_cm_node *cm_node) | 1306 | struct nes_cm_node *cm_node) |
1314 | { | 1307 | { |
1315 | u32 was_timer_set; | ||
1316 | |||
1317 | cm_node->accelerated = 1; | 1308 | cm_node->accelerated = 1; |
1318 | 1309 | ||
1319 | if (cm_node->accept_pend) { | 1310 | if (cm_node->accept_pend) { |
@@ -1323,11 +1314,8 @@ static inline int mini_cm_accelerated(struct nes_cm_core *cm_core, | |||
1323 | BUG_ON(atomic_read(&cm_node->listener->pend_accepts_cnt) < 0); | 1314 | BUG_ON(atomic_read(&cm_node->listener->pend_accepts_cnt) < 0); |
1324 | } | 1315 | } |
1325 | 1316 | ||
1326 | was_timer_set = timer_pending(&cm_core->tcp_timer); | 1317 | if (!timer_pending(&cm_core->tcp_timer)) |
1327 | if (!was_timer_set) { | 1318 | mod_timer(&cm_core->tcp_timer, (jiffies + NES_SHORT_TIME)); |
1328 | cm_core->tcp_timer.expires = jiffies + NES_SHORT_TIME; | ||
1329 | add_timer(&cm_core->tcp_timer); | ||
1330 | } | ||
1331 | 1319 | ||
1332 | return 0; | 1320 | return 0; |
1333 | } | 1321 | } |