Skip to content

Commit fccd5ba

Browse files
grygoriySdavem330
authored andcommitted
net: ethernet: ti: cpdma: fix lockup in cpdma_ctlr_destroy()
Fix deadlock in cpdma_ctlr_destroy() which is triggered now on cpsw module removal: cpsw_remove() - cpdma_ctlr_destroy() - spin_lock_irqsave(&ctlr->lock, flags) - cpdma_ctlr_stop() - spin_lock_irqsave(&ctlr->lock, flags); - cpdma_chan_destroy() - spin_lock_irqsave(&ctlr->lock, flags); The issue has not been observed before because CPDMA channels have been destroyed manually by CPSW until commit d941ebe ("net: ethernet: ti: cpsw: use destroy ctlr to destroy channels") was merged. Signed-off-by: Grygorii Strashko <[email protected]> Reviewed-by: Mugunthan V N <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c882219 commit fccd5ba

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

drivers/net/ethernet/ti/davinci_cpdma.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,21 +357,18 @@ EXPORT_SYMBOL_GPL(cpdma_ctlr_stop);
357357

358358
int cpdma_ctlr_destroy(struct cpdma_ctlr *ctlr)
359359
{
360-
unsigned long flags;
361360
int ret = 0, i;
362361

363362
if (!ctlr)
364363
return -EINVAL;
365364

366-
spin_lock_irqsave(&ctlr->lock, flags);
367365
if (ctlr->state != CPDMA_STATE_IDLE)
368366
cpdma_ctlr_stop(ctlr);
369367

370368
for (i = 0; i < ARRAY_SIZE(ctlr->channels); i++)
371369
cpdma_chan_destroy(ctlr->channels[i]);
372370

373371
cpdma_desc_pool_destroy(ctlr->pool);
374-
spin_unlock_irqrestore(&ctlr->lock, flags);
375372
return ret;
376373
}
377374
EXPORT_SYMBOL_GPL(cpdma_ctlr_destroy);

0 commit comments

Comments
 (0)