[bug report] genirq: Add might_sleep() to disable_irq()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Manfred Spraul,

The patch 17549b0f184d: "genirq: Add might_sleep() to disable_irq()"
from Dec 16, 2022 (linux-next), leads to the following Smatch static
checker warning:

	drivers/mmc/host/omap.c:647 mmc_omap_cmd_timer()
	warn: sleeping in atomic context

drivers/mmc/host/omap.c
    638 static void
    639 mmc_omap_cmd_timer(struct timer_list *t)
    640 {
    641         struct mmc_omap_host *host = from_timer(host, t, cmd_abort_timer);
    642         unsigned long flags;
    643 
    644         spin_lock_irqsave(&host->slot_lock, flags);
                ^^^^^^^^^^^^^^^^^
Holding a spinlock.

    645         if (host->cmd != NULL && !host->abort) {
    646                 OMAP_MMC_WRITE(host, IE, 0);
--> 647                 disable_irq(host->irq);

Manfred's patch just exposes the bug, and doesn't cause it.  However,
disable_irq() is a might_sleep() function now.

    648                 host->abort = 1;
    649                 queue_work(host->mmc_omap_wq, &host->cmd_abort_work);
    650         }
    651         spin_unlock_irqrestore(&host->slot_lock, flags);
    652 }

regards,
dan carpenter




[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux