From patchwork Tue Feb 24 20:12:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 5875111 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 64E2DBF440 for ; Tue, 24 Feb 2015 20:12:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9BEFC20253 for ; Tue, 24 Feb 2015 20:12:48 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9432C2013D for ; Tue, 24 Feb 2015 20:12:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 07F436E5B4; Tue, 24 Feb 2015 12:12:47 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTP id EB7D66E5C1 for ; Tue, 24 Feb 2015 12:12:45 -0800 (PST) Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1OKCZ0T000721 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 24 Feb 2015 15:12:35 -0500 Received: from gimli.home (ovpn-113-210.phx2.redhat.com [10.3.113.210]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t1OKCYMa008947; Tue, 24 Feb 2015 15:12:34 -0500 Subject: [PATCH 1/2] pci: Add reciprocal function for pci_ignore_hotplug() From: Alex Williamson To: bhelgaas@google.com, linux-pci@vger.kernel.org, airlied@linux.ie, alexander.deucher@amd.com, dri-devel@lists.freedesktop.org Date: Tue, 24 Feb 2015 13:12:34 -0700 Message-ID: <20150224201233.14443.61523.stgit@gimli.home> In-Reply-To: <20150224200603.14443.68971.stgit@gimli.home> References: <20150224200603.14443.68971.stgit@gimli.home> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Cc: alex.williamson@redhat.com, linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We have pci_ignore_hotplug(), but there's no way to undo this without manipulating the device itself. It seems like the original intention of the function is to provide the driver with a way to ignore hotplug over a specific time window, ex. the time while the device is powered off. Once the device is powered on again, the flag should be cleared to avoid leaving driver cruft on the device. Add a trivial helper function to enable this. Signed-off-by: Alex Williamson --- include/linux/pci.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/pci.h b/include/linux/pci.h index 211e9da..26f9779 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1044,6 +1044,11 @@ static inline void pci_ignore_hotplug(struct pci_dev *dev) dev->ignore_hotplug = 1; } +static inline void pci_unignore_hotplug(struct pci_dev *dev) +{ + dev->ignore_hotplug = 0; +} + static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, bool enable) {