From patchwork Mon Mar 11 11:52:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Miroshnichenko X-Patchwork-Id: 10847393 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 C2C8B1874 for ; Mon, 11 Mar 2019 11:52:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A9B1F290A1 for ; Mon, 11 Mar 2019 11:52:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9DD5C290A4; Mon, 11 Mar 2019 11:52:48 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 49387290A1 for ; Mon, 11 Mar 2019 11:52:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726691AbfCKLwr (ORCPT ); Mon, 11 Mar 2019 07:52:47 -0400 Received: from mta-01.yadro.com ([89.207.88.251]:46904 "EHLO mta-01.yadro.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726675AbfCKLwr (ORCPT ); Mon, 11 Mar 2019 07:52:47 -0400 Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id B5121419AF; Mon, 11 Mar 2019 11:52:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:content-transfer-encoding:mime-version :references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received:received; s=mta-01; t= 1552305164; x=1554119565; bh=jT1cbkurPuy7aqFjOnySUP0t9JaJnoAV6A3 D1832R8s=; b=pEc1b1rguu9K559N+GjevOZKfcJCR891StvWQRx/YerbS4hIXPG a4LOghDLLNcowVljwz0yb+emJ6C2OiRnDjqOzAIlqVw4kF8z0EDnnmZSACyxXn2G N1b5IQxP5SxWqQDBmfvSHmD6o2Uq0GN1duwZwoDeHlpp8GVOSS+vhHJs= X-Virus-Scanned: amavisd-new at yadro.com Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id y4oDEFtd5Eft; Mon, 11 Mar 2019 14:52:44 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id E39BD41992; Mon, 11 Mar 2019 14:52:41 +0300 (MSK) Received: from NB-148.yadro.com (172.17.15.60) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Mon, 11 Mar 2019 14:52:41 +0300 From: Sergey Miroshnichenko To: , CC: Oliver O'Halloran , Stewart Smith , Alexey Kardashevskiy , Benjamin Herrenschmidt , Russell Currey , , Sergey Miroshnichenko Subject: [PATCH v5 6/8] powerpc/pci: Don't rely on DT is the PCI_REASSIGN_ALL_BUS is set Date: Mon, 11 Mar 2019 14:52:31 +0300 Message-ID: <20190311115233.6514-7-s.miroshnichenko@yadro.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190311115233.6514-1-s.miroshnichenko@yadro.com> References: <20190311115233.6514-1-s.miroshnichenko@yadro.com> MIME-Version: 1.0 X-Originating-IP: [172.17.15.60] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) 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 If supported by the platform, endpoint's pci_dn can be created dynamically, without need to wait for DT updates from the firmware. Signed-off-by: Sergey Miroshnichenko --- arch/powerpc/kernel/pci_dn.c | 6 ++++-- arch/powerpc/platforms/powernv/eeh-powernv.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c index 7fa362f8038d..17362a9b4678 100644 --- a/arch/powerpc/kernel/pci_dn.c +++ b/arch/powerpc/kernel/pci_dn.c @@ -555,8 +555,10 @@ void pci_devs_phb_init_dynamic(struct pci_controller *phb) phb->pci_data = pdn; } - /* Update dn->phb ptrs for new phb and children devices */ - pci_traverse_device_nodes(dn, add_pdn, phb); + if (!pci_has_flag(PCI_REASSIGN_ALL_BUS)) { + /* Update dn->phb ptrs for new phb and children devices */ + pci_traverse_device_nodes(dn, add_pdn, phb); + } } /** diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c index f38078976c5d..40feff2653a0 100644 --- a/arch/powerpc/platforms/powernv/eeh-powernv.c +++ b/arch/powerpc/platforms/powernv/eeh-powernv.c @@ -47,7 +47,7 @@ void pnv_pcibios_bus_add_device(struct pci_dev *pdev) { struct pci_dn *pdn = pci_get_pdn(pdev); - if (!pdev->is_virtfn) + if (!pci_has_flag(PCI_REASSIGN_ALL_BUS) && !pdev->is_virtfn) return; /*