From patchwork Mon Aug 8 19:14:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 9269631 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B62696075A for ; Mon, 8 Aug 2016 19:48:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A81A120009 for ; Mon, 8 Aug 2016 19:48:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9CF1727AB2; Mon, 8 Aug 2016 19:48:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 41E5520009 for ; Mon, 8 Aug 2016 19:48:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753250AbcHHTOj (ORCPT ); Mon, 8 Aug 2016 15:14:39 -0400 Received: from mga01.intel.com ([192.55.52.88]:61254 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752814AbcHHTOg (ORCPT ); Mon, 8 Aug 2016 15:14:36 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 08 Aug 2016 12:14:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,491,1464678000"; d="scan'208";a="1010659419" Received: from dcgshare.lm.intel.com ([10.232.118.254]) by orsmga001.jf.intel.com with ESMTP; 08 Aug 2016 12:14:29 -0700 Received: by dcgshare.lm.intel.com (Postfix, from userid 1017) id 60C9CE0C75; Mon, 8 Aug 2016 13:14:29 -0600 (MDT) From: Keith Busch To: linux-pci@vger.kernel.org, Bjorn Helgaas Cc: Wei Zhang , Jens Axboe , Keith Busch Subject: [PATCH 2/3] pci/msix: Skip disabling removed devices Date: Mon, 8 Aug 2016 13:14:26 -0600 Message-Id: <1470683667-28418-3-git-send-email-keith.busch@intel.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1470683667-28418-1-git-send-email-keith.busch@intel.com> References: <1470683667-28418-1-git-send-email-keith.busch@intel.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is no need to disable MSIx interrupts on a device that doesn't exist. Signed-off-by: Keith Busch --- drivers/pci/msi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index a02981e..b60ee25 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -999,6 +999,11 @@ void pci_msix_shutdown(struct pci_dev *dev) if (!pci_msi_enable || !dev || !dev->msix_enabled) return; + if (!pci_device_is_present(dev)) { + dev->msix_enabled = 0; + return; + } + /* Return the device with MSI-X masked as initial states */ for_each_pci_msi_entry(entry, dev) { /* Keep cached states to be restored */