From: Bjorn Helgaas <helgaas@kernel.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-pci@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] PCI: Remove WARN_ON(in_interrupt()).
Date: Wed, 10 Feb 2021 17:01:56 -0600 [thread overview]
Message-ID: <20210210230156.GA617538@bjorn-Precision-5520> (raw)
In-Reply-To: <20210208194400.384003-1-bigeasy@linutronix.de>
On Mon, Feb 08, 2021 at 08:44:00PM +0100, Sebastian Andrzej Siewior wrote:
> WARN_ON(in_interrupt()) is used for historic reasons to ensure proper
> usage of down_read() and predates might_sleep() and lockdep.
>
> down_read() has might_sleep() which also catches users from preemption
> disabled regions while in_interrupt() does not.
>
> Remove WARN_ON(in_interrupt()) because there is better debugging
> facility.
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Applied to pci/misc for v5.12, thanks!
> ---
> drivers/pci/search.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/pci/search.c b/drivers/pci/search.c
> index 2061672954ee3..b4c138a6ec025 100644
> --- a/drivers/pci/search.c
> +++ b/drivers/pci/search.c
> @@ -168,7 +168,6 @@ struct pci_bus *pci_find_next_bus(const struct pci_bus *from)
> struct list_head *n;
> struct pci_bus *b = NULL;
>
> - WARN_ON(in_interrupt());
> down_read(&pci_bus_sem);
> n = from ? from->node.next : pci_root_buses.next;
> if (n != &pci_root_buses)
> @@ -196,7 +195,6 @@ struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn)
> {
> struct pci_dev *dev;
>
> - WARN_ON(in_interrupt());
> down_read(&pci_bus_sem);
>
> list_for_each_entry(dev, &bus->devices, bus_list) {
> @@ -274,7 +272,6 @@ static struct pci_dev *pci_get_dev_by_id(const struct pci_device_id *id,
> struct device *dev_start = NULL;
> struct pci_dev *pdev = NULL;
>
> - WARN_ON(in_interrupt());
> if (from)
> dev_start = &from->dev;
> dev = bus_find_device(&pci_bus_type, dev_start, (void *)id,
> @@ -381,7 +378,6 @@ int pci_dev_present(const struct pci_device_id *ids)
> {
> struct pci_dev *found = NULL;
>
> - WARN_ON(in_interrupt());
> while (ids->vendor || ids->subvendor || ids->class_mask) {
> found = pci_get_dev_by_id(ids, NULL);
> if (found) {
> --
> 2.30.0
>
prev parent reply other threads:[~2021-02-10 23:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-08 19:44 [PATCH] PCI: Remove WARN_ON(in_interrupt()) Sebastian Andrzej Siewior
2021-02-10 23:01 ` Bjorn Helgaas [this message]
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=20210210230156.GA617538@bjorn-Precision-5520 \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=bigeasy@linutronix.de \
--cc=linux-pci@vger.kernel.org \
--cc=tglx@linutronix.de \
/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 NNTP newsgroup(s).