From patchwork Tue Sep 18 23:56:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 10605061 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-2.web.codeaurora.org (Postfix) with ESMTP id AE2A8112B for ; Tue, 18 Sep 2018 23:55:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9CFCF2BD27 for ; Tue, 18 Sep 2018 23:55:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 919452BD6D; Tue, 18 Sep 2018 23:55:30 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 3B1F62BD69 for ; Tue, 18 Sep 2018 23:55:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727818AbeISFaa (ORCPT ); Wed, 19 Sep 2018 01:30:30 -0400 Received: from mga02.intel.com ([134.134.136.20]:47633 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730633AbeISFaa (ORCPT ); Wed, 19 Sep 2018 01:30:30 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Sep 2018 16:55:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,391,1531810800"; d="scan'208";a="74357509" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.44]) by orsmga008.jf.intel.com with ESMTP; 18 Sep 2018 16:55:28 -0700 From: Keith Busch To: Linux PCI , Bjorn Helgaas Cc: Benjamin Herrenschmidt , Sinan Kaya , Thomas Tai , poza@codeaurora.org, Lukas Wunner , Christoph Hellwig , Mika Westerberg , Keith Busch Subject: [PATCHv3 01/10] PCI/portdrv: Use subsys_init for service drivers Date: Tue, 18 Sep 2018 17:56:53 -0600 Message-Id: <20180918235702.26573-2-keith.busch@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180918235702.26573-1-keith.busch@intel.com> References: <20180918235702.26573-1-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 The PCI port driver saves the PCI state after initializing all the service devices. This was, however, before the service drivers were even registered. The config space state that the service drivers were setting up were not being saved. This patch fixes this by changing the service drivers use the subsys_init, which gets the service drivers registered after the pci bus system is initialized, but before the pci devices are probed. This gets the state saved as expected. Note, 70626d88385 ("PCI: pciehp: Make explicitly non-modular") already mentioned this exact change should be done, but declined to at the time until there was a real need for it. Signed-off-by: Keith Busch --- drivers/pci/hotplug/pciehp_core.c | 2 +- drivers/pci/pcie/aer.c | 2 +- drivers/pci/pcie/dpc.c | 2 +- drivers/pci/pcie/pme.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c index ccaf01e6eced..334044814dbe 100644 --- a/drivers/pci/hotplug/pciehp_core.c +++ b/drivers/pci/hotplug/pciehp_core.c @@ -322,4 +322,4 @@ static int __init pcied_init(void) return retval; } -device_initcall(pcied_init); +subsys_initcall(pcied_init); diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index 83180edd6ed4..1d2159409b01 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -1575,4 +1575,4 @@ static int __init aer_service_init(void) return -ENXIO; return pcie_port_service_register(&aerdriver); } -device_initcall(aer_service_init); +subsys_initcall(aer_service_init); diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c index f03279fc87cd..aacfb50eccfc 100644 --- a/drivers/pci/pcie/dpc.c +++ b/drivers/pci/pcie/dpc.c @@ -286,4 +286,4 @@ static int __init dpc_service_init(void) { return pcie_port_service_register(&dpcdriver); } -device_initcall(dpc_service_init); +subsys_initcall(dpc_service_init); diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c index 3ed67676ea2a..cd8c1adb9b0a 100644 --- a/drivers/pci/pcie/pme.c +++ b/drivers/pci/pcie/pme.c @@ -450,4 +450,4 @@ static int __init pcie_pme_service_init(void) { return pcie_port_service_register(&pcie_pme_driver); } -device_initcall(pcie_pme_service_init); +subsys_initcall(pcie_pme_service_init);