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: 5875161 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@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 1D6B4BF440 for ; Tue, 24 Feb 2015 20:13:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 49E2020263 for ; Tue, 24 Feb 2015 20:13:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 661DD20259 for ; Tue, 24 Feb 2015 20:13:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752758AbbBXUMs (ORCPT ); Tue, 24 Feb 2015 15:12:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56058 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752679AbbBXUMq (ORCPT ); Tue, 24 Feb 2015 15:12:46 -0500 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 Cc: alex.williamson@redhat.com, linux-kernel@vger.kernel.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 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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(+) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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) {