From: Dan Carpenter <dan.carpenter@linaro.org>
To: manfred@colorfullife.com
Cc: linux-omap@vger.kernel.org, linux-mmc@vger.kernel.org
Subject: [bug report] genirq: Add might_sleep() to disable_irq()
Date: Thu, 8 Feb 2024 13:15:53 +0300 [thread overview]
Message-ID: <be6e9b02-0fe6-4731-bf0e-4691e2cd99ad@moroto.mountain> (raw)
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
reply other threads:[~2024-02-08 10:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=be6e9b02-0fe6-4731-bf0e-4691e2cd99ad@moroto.mountain \
--to=dan.carpenter@linaro.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=manfred@colorfullife.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).