Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: wbsd: initialize tasklets before requesting interrupt

With CONFIG_DEBUG_SHIRQ set we will get an interrupt as soon as we
allocate one. Tasklets may be scheduled in the interrupt handler but they
will be initialized after the handler returns, causing a BUG() in
kernel/softirq.c when they run.

Should fix this Fedora bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=449817

Signed-off-by: Chuck Ebbert <cebbert@redhat.com>
Acked-by: Pierre Ossman <drzeus@drzeus.cx>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Chuck Ebbert and committed by
Linus Torvalds
cef33400 30ec261e

+10 -11
+10 -11
drivers/mmc/host/wbsd.c
··· 1457 1457 int ret; 1458 1458 1459 1459 /* 1460 - * Allocate interrupt. 1461 - */ 1462 - 1463 - ret = request_irq(irq, wbsd_irq, IRQF_SHARED, DRIVER_NAME, host); 1464 - if (ret) 1465 - return ret; 1466 - 1467 - host->irq = irq; 1468 - 1469 - /* 1470 - * Set up tasklets. 1460 + * Set up tasklets. Must be done before requesting interrupt. 1471 1461 */ 1472 1462 tasklet_init(&host->card_tasklet, wbsd_tasklet_card, 1473 1463 (unsigned long)host); ··· 1469 1479 (unsigned long)host); 1470 1480 tasklet_init(&host->finish_tasklet, wbsd_tasklet_finish, 1471 1481 (unsigned long)host); 1482 + 1483 + /* 1484 + * Allocate interrupt. 1485 + */ 1486 + ret = request_irq(irq, wbsd_irq, IRQF_SHARED, DRIVER_NAME, host); 1487 + if (ret) 1488 + return ret; 1489 + 1490 + host->irq = irq; 1472 1491 1473 1492 return 0; 1474 1493 }