From patchwork Mon Feb 8 19:44:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 12076411 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D22AC433DB for ; Mon, 8 Feb 2021 19:45:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3503A64E27 for ; Mon, 8 Feb 2021 19:45:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236229AbhBHTpA (ORCPT ); Mon, 8 Feb 2021 14:45:00 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:38728 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236288AbhBHToo (ORCPT ); Mon, 8 Feb 2021 14:44:44 -0500 From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1612813442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=i+MjUAuHKQNzcecJvz4vROoSLoJ9O38FaHd9JIBla1E=; b=a3dTYr6I5T2l0UCXYY555u02vDEDj3Ed5n+xMBvsbohAzgjaM8/TuYjf5PpBEw8fGvdnk1 HOjdfAjqNWzIlpkKk+c8JDpXLk1g35F9bHXVvfk4ciBxFPfTnfx/6MCreY8VwCDmKur33X haPgOPrAbibIP7dRSZ2M2LD4gHOHQa6TiYx0mQM51rkjPid+/57NJiwKEEOxjpVqo3TKaj 84cT3L63p+u6WZmMcOjFfLx1uENTOuKtLr3RIc8L4r7ghYtbs/blhuyaadp4aZg68ot0kb eEkrcCQpynwFh/c1vw6lzZ+AD7vifPH5aT40IuHlVZGsI1H9uyP0bw57Hf4LJw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1612813442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=i+MjUAuHKQNzcecJvz4vROoSLoJ9O38FaHd9JIBla1E=; b=UJKlPItL8E62jUr88RA6L4Zu+LNLrm8/lGiBxllj8i3xsLevUzeLxqp0UQRNRPazecxcIF 0AN8C0OfI+sa0ZCw== To: linux-pci@vger.kernel.org Cc: Bjorn Helgaas , Thomas Gleixner , Sebastian Andrzej Siewior Subject: [PATCH] PCI: Remove WARN_ON(in_interrupt()). Date: Mon, 8 Feb 2021 20:44:00 +0100 Message-Id: <20210208194400.384003-1-bigeasy@linutronix.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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 --- 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) {