Skip to contentSkip to conversation

rapidio/tsi721: use tasklet_kill in device remove/release process

PATCH In review Xiaotian Feng 2 participants 2 messages Oct 31, 2012 – Nov 5, 2012 Rapidio

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rapidio/tsi721: use tasklet_kill in device remove/release process

Some driver uses tasklet_disable in device remove/release process, tasklet_disable will inc tasklet->count and return. If the tasklet is not handled yet under some softirq pressure, the tasklet will be placed on the tasklet_vec, never have a chance to be excuted. This might lead to a heavy loaded ksoftirqd, wakeup with pending_softirq, but tasklet is disabled. tasklet_kill should be used in this case.

Cc Matt Porter <[email protected]>
Cc Alexandre Bounine <[email protected]>
Cc Andrew Morton <[email protected]>
---
 drivers/rapidio/devices/tsi721_dma.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rapidio/devices/tsi721_dma.c +1 -1
index 92e06a5..a098fbc 100644
@@ -589,7 +589,7 @@ static void tsi721_free_chan_resources(struct dma_chan *dchan)
 	BUG_ON(!list_empty(&bdma_chan->active_list));
 	BUG_ON(!list_empty(&bdma_chan->queue));
 
-	tasklet_disable(&bdma_chan->tasklet);
+	tasklet_kill(&bdma_chan->tasklet);
 
 	spin_lock_bh(&bdma_chan->lock);
 	list_splice_init(&bdma_chan->free_list, &list);
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 31 lines · Xiaotian Feng

Some driver uses tasklet_disable in device remove/release process, tasklet_disable will inc tasklet->count and return. If the tasklet is not handled yet under some softirq pressure, the tasklet will be placed on the tasklet_vec, never have a chance to be excuted. This might
lead to a heavy loaded ksoftirqd, wakeup with pending_softirq, but tasklet is disabled. tasklet_kill should be used in this case.

Cc Matt Porter <[email protected]>
Cc Alexandre Bounine <[email protected]>
Cc Andrew Morton <[email protected]>
---
 drivers/rapidio/devices/tsi721_dma.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rapidio/devices/tsi721_dma.c +1 -1
index 92e06a5..a098fbc 100644
@@ -589,7 +589,7 @@ static void tsi721_free_chan_resources(struct
 dma_chan *dchan)
 	BUG_ON(!list_empty(&bdma_chan->active_list));
 	BUG_ON(!list_empty(&bdma_chan->queue));
 
-	tasklet_disable(&bdma_chan->tasklet);
+	tasklet_kill(&bdma_chan->tasklet);
 
 	spin_lock_bh(&bdma_chan->lock);
Quoted 3 lines

list_splice_init(&bdma_chan->free_list, &list);
--
1.7.9.5

I agree with reported issue.
Switching to tasklet_kill() also requires to disable interrupts first. I will update that part and post a new patch.