aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@mbnet.fi>2011-04-01 12:34:16 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-04 15:22:12 -0400
commit023535732f4db01af4921f20f058bc4561d9add7 (patch)
treefc4cf7aa28a7ba81a115f41052f71e08fee7b5cd /drivers
parent2fc713b20469b2779fa89f582d2a9696b10031e7 (diff)
zd1211rw: reset rx idle timer from tasklet
2.6.38 added WARN_ON(in_irq) in del_timer_sync that triggers on zd1211rw when reseting rx idle timer in urb completion handler. Move timer reseting to tasklet. Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/zd1211rw/zd_usb.c14
-rw-r--r--drivers/net/wireless/zd1211rw/zd_usb.h1
2 files changed, 14 insertions, 1 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c
index 9b1a26a4435b..ab607bbd6291 100644
--- a/drivers/net/wireless/zd1211rw/zd_usb.c
+++ b/drivers/net/wireless/zd1211rw/zd_usb.c
@@ -643,7 +643,7 @@ static void rx_urb_complete(struct urb *urb)
643 usb = urb->context; 643 usb = urb->context;
644 rx = &usb->rx; 644 rx = &usb->rx;
645 645
646 zd_usb_reset_rx_idle_timer(usb); 646 tasklet_schedule(&rx->reset_timer_tasklet);
647 647
648 if (length%rx->usb_packet_size > rx->usb_packet_size-4) { 648 if (length%rx->usb_packet_size > rx->usb_packet_size-4) {
649 /* If there is an old first fragment, we don't care. */ 649 /* If there is an old first fragment, we don't care. */
@@ -812,6 +812,7 @@ void zd_usb_disable_rx(struct zd_usb *usb)
812 __zd_usb_disable_rx(usb); 812 __zd_usb_disable_rx(usb);
813 mutex_unlock(&rx->setup_mutex); 813 mutex_unlock(&rx->setup_mutex);
814 814
815 tasklet_kill(&rx->reset_timer_tasklet);
815 cancel_delayed_work_sync(&rx->idle_work); 816 cancel_delayed_work_sync(&rx->idle_work);
816} 817}
817 818
@@ -1106,6 +1107,13 @@ static void zd_rx_idle_timer_handler(struct work_struct *work)
1106 zd_usb_reset_rx(usb); 1107 zd_usb_reset_rx(usb);
1107} 1108}
1108 1109
1110static void zd_usb_reset_rx_idle_timer_tasklet(unsigned long param)
1111{
1112 struct zd_usb *usb = (struct zd_usb *)param;
1113
1114 zd_usb_reset_rx_idle_timer(usb);
1115}
1116
1109void zd_usb_reset_rx_idle_timer(struct zd_usb *usb) 1117void zd_usb_reset_rx_idle_timer(struct zd_usb *usb)
1110{ 1118{
1111 struct zd_usb_rx *rx = &usb->rx; 1119 struct zd_usb_rx *rx = &usb->rx;
@@ -1127,6 +1135,7 @@ static inline void init_usb_interrupt(struct zd_usb *usb)
1127static inline void init_usb_rx(struct zd_usb *usb) 1135static inline void init_usb_rx(struct zd_usb *usb)
1128{ 1136{
1129 struct zd_usb_rx *rx = &usb->rx; 1137 struct zd_usb_rx *rx = &usb->rx;
1138
1130 spin_lock_init(&rx->lock); 1139 spin_lock_init(&rx->lock);
1131 mutex_init(&rx->setup_mutex); 1140 mutex_init(&rx->setup_mutex);
1132 if (interface_to_usbdev(usb->intf)->speed == USB_SPEED_HIGH) { 1141 if (interface_to_usbdev(usb->intf)->speed == USB_SPEED_HIGH) {
@@ -1136,11 +1145,14 @@ static inline void init_usb_rx(struct zd_usb *usb)
1136 } 1145 }
1137 ZD_ASSERT(rx->fragment_length == 0); 1146 ZD_ASSERT(rx->fragment_length == 0);
1138 INIT_DELAYED_WORK(&rx->idle_work, zd_rx_idle_timer_handler); 1147 INIT_DELAYED_WORK(&rx->idle_work, zd_rx_idle_timer_handler);
1148 rx->reset_timer_tasklet.func = zd_usb_reset_rx_idle_timer_tasklet;
1149 rx->reset_timer_tasklet.data = (unsigned long)usb;
1139} 1150}
1140 1151
1141static inline void init_usb_tx(struct zd_usb *usb) 1152static inline void init_usb_tx(struct zd_usb *usb)
1142{ 1153{
1143 struct zd_usb_tx *tx = &usb->tx; 1154 struct zd_usb_tx *tx = &usb->tx;
1155
1144 spin_lock_init(&tx->lock); 1156 spin_lock_init(&tx->lock);
1145 atomic_set(&tx->enabled, 0); 1157 atomic_set(&tx->enabled, 0);
1146 tx->stopped = 0; 1158 tx->stopped = 0;
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.h b/drivers/net/wireless/zd1211rw/zd_usb.h
index b3df2c8116cc..325d0f989257 100644
--- a/drivers/net/wireless/zd1211rw/zd_usb.h
+++ b/drivers/net/wireless/zd1211rw/zd_usb.h
@@ -183,6 +183,7 @@ struct zd_usb_rx {
183 spinlock_t lock; 183 spinlock_t lock;
184 struct mutex setup_mutex; 184 struct mutex setup_mutex;
185 struct delayed_work idle_work; 185 struct delayed_work idle_work;
186 struct tasklet_struct reset_timer_tasklet;
186 u8 fragment[2 * USB_MAX_RX_SIZE]; 187 u8 fragment[2 * USB_MAX_RX_SIZE];
187 unsigned int fragment_length; 188 unsigned int fragment_length;
188 unsigned int usb_packet_size; 189 unsigned int usb_packet_size;