summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2015-06-14 10:48:44 -0400
committerMarcel Holtmann <marcel@holtmann.org>2015-06-14 19:25:06 -0400
commit789a99ecb9cb700eb8f07b9d106b99e705e99471 (patch)
tree63f00885c30260aa5761039915972c3240319fa1 /drivers/net
parente6f7ed9dc1164c2f20bd984e251cf4dd5ff61d2c (diff)
fakelb: add xmit_async after stop testcase
This patch adds a suspended testcase into the xmit_async functionality. In the hope that we can found race conditions when xmit_async is called after an ieee802154_ops stop. This should never happen. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ieee802154/fakelb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ieee802154/fakelb.c b/drivers/net/ieee802154/fakelb.c
index 9d0da4ec3e8c..860d4aed8274 100644
--- a/drivers/net/ieee802154/fakelb.c
+++ b/drivers/net/ieee802154/fakelb.c
@@ -41,6 +41,8 @@ struct fakelb_phy {
41 u8 page; 41 u8 page;
42 u8 channel; 42 u8 channel;
43 43
44 bool suspended;
45
44 struct list_head list; 46 struct list_head list;
45 struct list_head list_ifup; 47 struct list_head list_ifup;
46}; 48};
@@ -69,6 +71,7 @@ static int fakelb_hw_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
69 struct fakelb_phy *current_phy = hw->priv, *phy; 71 struct fakelb_phy *current_phy = hw->priv, *phy;
70 72
71 read_lock_bh(&fakelb_ifup_phys_lock); 73 read_lock_bh(&fakelb_ifup_phys_lock);
74 WARN_ON(current_phy->suspended);
72 list_for_each_entry(phy, &fakelb_ifup_phys, list_ifup) { 75 list_for_each_entry(phy, &fakelb_ifup_phys, list_ifup) {
73 if (current_phy == phy) 76 if (current_phy == phy)
74 continue; 77 continue;
@@ -92,6 +95,7 @@ static int fakelb_hw_start(struct ieee802154_hw *hw)
92 struct fakelb_phy *phy = hw->priv; 95 struct fakelb_phy *phy = hw->priv;
93 96
94 write_lock_bh(&fakelb_ifup_phys_lock); 97 write_lock_bh(&fakelb_ifup_phys_lock);
98 phy->suspended = false;
95 list_add(&phy->list_ifup, &fakelb_ifup_phys); 99 list_add(&phy->list_ifup, &fakelb_ifup_phys);
96 write_unlock_bh(&fakelb_ifup_phys_lock); 100 write_unlock_bh(&fakelb_ifup_phys_lock);
97 101
@@ -103,6 +107,7 @@ static void fakelb_hw_stop(struct ieee802154_hw *hw)
103 struct fakelb_phy *phy = hw->priv; 107 struct fakelb_phy *phy = hw->priv;
104 108
105 write_lock_bh(&fakelb_ifup_phys_lock); 109 write_lock_bh(&fakelb_ifup_phys_lock);
110 phy->suspended = true;
106 list_del(&phy->list_ifup); 111 list_del(&phy->list_ifup);
107 write_unlock_bh(&fakelb_ifup_phys_lock); 112 write_unlock_bh(&fakelb_ifup_phys_lock);
108} 113}