From patchwork Wed Jul 6 10:43:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 1652920 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=TZJK5VfY; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4LdGNj6Tb6z9sGq for ; Wed, 6 Jul 2022 20:43:33 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231194AbiGFKnb (ORCPT ); Wed, 6 Jul 2022 06:43:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232429AbiGFKn3 (ORCPT ); Wed, 6 Jul 2022 06:43:29 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6575BC26; Wed, 6 Jul 2022 03:43:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 9AA54CE1EC5; Wed, 6 Jul 2022 10:43:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B45D9C341CB; Wed, 6 Jul 2022 10:43:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657104200; bh=2i4XkrOKAvEY4kt51QJGqvVCb9gTrdzZN17RM/W6jF8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TZJK5VfYPdeR1Bn+XOMd6WXnxO+p3Wr5Bkgn4nhjE12pygsUgOZm9OQPMRFZ89lRz /ANQlCA3A0g0e5heGDCD8RPkJWPGRetnO6riSnQJsZrPrS5d0VcPpv0ajMBul6+uXT NXrs7B/+KIgl2mtB1Q0MQNHiSsoddXThcz21pCrxjUOqzBbXK/ijF5TkASq7HCCjPz 5LRww1QlBmHfiXnoJC8+Q+ij/jH0AVXusYUwQZKOsW/uHC4dcJwKblCnpUUHd88J8e x8XiPQwwj4RpiL/X9meTKljxp0ZjR+/OayZ8BBT6Sb0KRW4lBU06os1I0e2mWKNobu xJJLkaQS+12kQ== Received: by pali.im (Postfix) id 3BFC07F1; Wed, 6 Jul 2022 12:43:18 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Christophe Leroy , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Nick Child , Bjorn Helgaas Cc: linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/5] powerpc/pci: Hide pci_device_from_OF_node() for non-powermac code Date: Wed, 6 Jul 2022 12:43:04 +0200 Message-Id: <20220706104308.5390-2-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220706104308.5390-1-pali@kernel.org> References: <20220706104308.5390-1-pali@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Function pci_device_from_OF_node() is used only in powermac code. So hide it from all other platforms as it is unsed. Signed-off-by: Pali Rohár --- arch/powerpc/include/asm/pci-bridge.h | 2 ++ arch/powerpc/kernel/pci_32.c | 2 ++ arch/powerpc/kernel/pci_64.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h index c85f901227c9..98156932a1f5 100644 --- a/arch/powerpc/include/asm/pci-bridge.h +++ b/arch/powerpc/include/asm/pci-bridge.h @@ -170,8 +170,10 @@ static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus) return bus->sysdata; } +#ifdef CONFIG_PPC_PMAC extern int pci_device_from_OF_node(struct device_node *node, u8 *bus, u8 *devfn); +#endif #ifndef CONFIG_PPC64 extern void pci_create_OF_bus_map(void); diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c index 5a174936c9a0..c3b91fb62a71 100644 --- a/arch/powerpc/kernel/pci_32.c +++ b/arch/powerpc/kernel/pci_32.c @@ -154,6 +154,7 @@ pcibios_make_OF_bus_map(void) } +#ifdef CONFIG_PPC_PMAC /* * Returns the PCI device matching a given OF node */ @@ -193,6 +194,7 @@ int pci_device_from_OF_node(struct device_node *node, u8 *bus, u8 *devfn) return -ENODEV; } EXPORT_SYMBOL(pci_device_from_OF_node); +#endif /* We create the "pci-OF-bus-map" property now so it appears in the * /proc device tree diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 19b03ddf5631..0c7cfb9fab04 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c @@ -286,6 +286,7 @@ int pcibus_to_node(struct pci_bus *bus) EXPORT_SYMBOL(pcibus_to_node); #endif +#ifdef CONFIG_PPC_PMAC int pci_device_from_OF_node(struct device_node *np, u8 *bus, u8 *devfn) { if (!PCI_DN(np)) @@ -294,3 +295,4 @@ int pci_device_from_OF_node(struct device_node *np, u8 *bus, u8 *devfn) *devfn = PCI_DN(np)->devfn; return 0; } +#endif From patchwork Wed Jul 6 10:43:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 1652915 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=K7qadzCU; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4LdGNh3KMTz9sGk for ; Wed, 6 Jul 2022 20:43:32 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232288AbiGFKnZ (ORCPT ); Wed, 6 Jul 2022 06:43:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229599AbiGFKnY (ORCPT ); Wed, 6 Jul 2022 06:43:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C47F92E8; Wed, 6 Jul 2022 03:43:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6642C61E50; Wed, 6 Jul 2022 10:43:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93DD6C341CE; Wed, 6 Jul 2022 10:43:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657104201; bh=00N7ksHtwGEamPjFF10EZROWjybycuFTsa4YgD+Po3E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K7qadzCUEt12Hkk2NuyJRLOe4+/ShN/ZMVSgZBzllDWUxecQFHIEmwvDbtyMrshy5 9aX4FVnp5P0EPDlYA8GBB5IuSDPkWEl4lKC9cunRh8JV2eQrMCSLtH4Yigo/+ocAUg LAncEnYzO34XybOZppHLjVhwp93D8X8cHNIEDzd6ELPTFZDyPt1tCXe6GJvlV+pl2h ytY4G2SlsBvMGDvWbvJo4qqu62Fkq5XaZ/vE8fve4V6FLrmY8SNqTeW6qnBunC/VJo Nq4cPDVDNl+mfvKFW7mx5B9vmwH1cLCgvlHdmP0Kjo0Qvqr5hXBbabFdrB+UYiPW1E i2qbBNJZrEkJA== Received: by pali.im (Postfix) id 34131821; Wed, 6 Jul 2022 12:43:19 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Christophe Leroy , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Nick Child , Bjorn Helgaas Cc: linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/5] powerpc/pci: Make pcibios_make_OF_bus_map() static Date: Wed, 6 Jul 2022 12:43:05 +0200 Message-Id: <20220706104308.5390-3-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220706104308.5390-1-pali@kernel.org> References: <20220706104308.5390-1-pali@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Function pcibios_make_OF_bus_map() is used only in pci_32.c file. So make it static and do not export out of pci_32.o unit. Signed-off-by: Pali Rohár --- arch/powerpc/kernel/pci_32.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c index c3b91fb62a71..df981294df29 100644 --- a/arch/powerpc/kernel/pci_32.c +++ b/arch/powerpc/kernel/pci_32.c @@ -36,8 +36,6 @@ int pcibios_assign_bus_offset = 1; EXPORT_SYMBOL(isa_io_base); EXPORT_SYMBOL(pci_dram_offset); -void __init pcibios_make_OF_bus_map(void); - static void fixup_cpc710_pci64(struct pci_dev* dev); static u8* pci_to_OF_bus_map; @@ -108,7 +106,7 @@ make_one_node_map(struct device_node* node, u8 pci_bus) } } -void __init +static void __init pcibios_make_OF_bus_map(void) { int i; From patchwork Wed Jul 6 10:43:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 1652914 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=tatURPUr; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4LdGNc6zC6z9s07 for ; Wed, 6 Jul 2022 20:43:28 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232240AbiGFKnZ (ORCPT ); Wed, 6 Jul 2022 06:43:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231194AbiGFKnY (ORCPT ); Wed, 6 Jul 2022 06:43:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAC89B49; Wed, 6 Jul 2022 03:43:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5515861E54; Wed, 6 Jul 2022 10:43:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90D47C341D0; Wed, 6 Jul 2022 10:43:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657104202; bh=j5IOHlX255HFSnaMvWUb7Q8STsC+hRHhN52ol+fdQ2A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tatURPUrAkHQIf+OcPOWiC9vJNvtxd9rvTQGIhwklmkCYBo2rzlpzyZCzdzB1Aiy2 AXxFRkxOKMd+vRdIjysrVF2IWc8DWZUOFQ96DwcjKHdGvNG3/auFx91IeORHMSwKCS 1GAk/jB75OIuOWU8Khm/96Hg+qbBpQYP0w4qtUegp7aAGsIfypGvioRP0juTktdTc3 bAbRzpwS/Cs8sP+tFhM9XsJnO/lAjU1MekIWk0ostbGadOJ67BRItfha/TJ/6wVoiY 9EWus6IwgsTmkHRSCebFHqPaX619oDqt5CnD9RwuoOahAlHhszNtYEV10hirpZ3ERk 2XDJjyFrnnWMw== Received: by pali.im (Postfix) id 1CDAD825; Wed, 6 Jul 2022 12:43:20 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Christophe Leroy , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Nick Child , Bjorn Helgaas Cc: linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/5] powerpc/pci: Hide pci_create_OF_bus_map() for non-chrp code Date: Wed, 6 Jul 2022 12:43:06 +0200 Message-Id: <20220706104308.5390-4-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220706104308.5390-1-pali@kernel.org> References: <20220706104308.5390-1-pali@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Function pci_create_OF_bus_map() is used only in chrp code. So hide it from all other platforms as it is unsed. Signed-off-by: Pali Rohár --- arch/powerpc/include/asm/pci-bridge.h | 2 ++ arch/powerpc/kernel/pci_32.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h index 98156932a1f5..e18c95f4e1d4 100644 --- a/arch/powerpc/include/asm/pci-bridge.h +++ b/arch/powerpc/include/asm/pci-bridge.h @@ -176,7 +176,9 @@ extern int pci_device_from_OF_node(struct device_node *node, #endif #ifndef CONFIG_PPC64 +#ifdef CONFIG_PPC_CHRP extern void pci_create_OF_bus_map(void); +#endif #else /* CONFIG_PPC64 */ diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c index df981294df29..3291af89cea4 100644 --- a/arch/powerpc/kernel/pci_32.c +++ b/arch/powerpc/kernel/pci_32.c @@ -194,6 +194,7 @@ int pci_device_from_OF_node(struct device_node *node, u8 *bus, u8 *devfn) EXPORT_SYMBOL(pci_device_from_OF_node); #endif +#ifdef CONFIG_PPC_CHRP /* We create the "pci-OF-bus-map" property now so it appears in the * /proc device tree */ @@ -218,6 +219,7 @@ pci_create_OF_bus_map(void) of_node_put(dn); } } +#endif void pcibios_setup_phb_io_space(struct pci_controller *hose) { From patchwork Wed Jul 6 10:43:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 1652917 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=rN6woxYE; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4LdGNj1P9sz9s07 for ; Wed, 6 Jul 2022 20:43:33 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232095AbiGFKn3 (ORCPT ); Wed, 6 Jul 2022 06:43:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232155AbiGFKnZ (ORCPT ); Wed, 6 Jul 2022 06:43:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F0ADB90; Wed, 6 Jul 2022 03:43:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AC268B80A38; Wed, 6 Jul 2022 10:43:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53876C341C0; Wed, 6 Jul 2022 10:43:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657104201; bh=oSQ5IoQCNafIgt+niU4r6ol75/VtIeDzq3eFDS3Ask0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rN6woxYEGCMe3Bj483Cd0Py2FvFbFyUevtTqSvKf5IG11LZ/+X5W0l64NUiyTnnHX ne5n2bEvUslXSlJHbhAHHNGwBcc1d6Qm9VmJfyLzdoIqVb8o8YRb4yfgdr93F5PDfr 5EvJxAYMmijGgnOBizFz4mJb63qUETpKd7dRqUuYeC3X1WzvsCbDyC3cwczmgbbG3E dg/7kPtcdppdbNwLIxRn4nJjzso167pQ86rSmYhPFMHBmT2OGKmNkTt7Y+ftNLRcTU vAPi+PJdeKyZ9rgYXxO1ka6yM9myqJTJ1AjjLNVBomynZhe5FYfvprXgTaOwiSu9cU DKmpPea6PAxfA== Received: by pali.im (Postfix) id 0D7ED7BA; Wed, 6 Jul 2022 12:43:21 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Christophe Leroy , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Nick Child , Bjorn Helgaas Cc: linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] powerpc/pci: Disable filling pci-OF-bus-map for non-chrp/powermac Date: Wed, 6 Jul 2022 12:43:07 +0200 Message-Id: <20220706104308.5390-5-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220706104308.5390-1-pali@kernel.org> References: <20220706104308.5390-1-pali@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Creating or filling pci-OF-bus-map property in the device-tree is deprecated since May 2006 [1] and was used only in old platforms like PowerMac. Currently kernel code handles it only for chrp and powermac code. So completely disable filling pci-OF-bus-map property for non-chrp and non-powermac platforms. [1] - https://lore.kernel.org/linuxppc-dev/1148016268.13249.14.camel@localhost.localdomain/ Signed-off-by: Pali Rohár --- arch/powerpc/kernel/pci_32.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c index 3291af89cea4..2f7284b68f06 100644 --- a/arch/powerpc/kernel/pci_32.c +++ b/arch/powerpc/kernel/pci_32.c @@ -37,15 +37,12 @@ EXPORT_SYMBOL(isa_io_base); EXPORT_SYMBOL(pci_dram_offset); static void fixup_cpc710_pci64(struct pci_dev* dev); -static u8* pci_to_OF_bus_map; /* By default, we don't re-assign bus numbers. We do this only on * some pmacs */ static int pci_assign_all_buses; -static int pci_bus_count; - /* This will remain NULL for now, until isa-bridge.c is made common * to both 32-bit and 64-bit. */ @@ -65,6 +62,11 @@ fixup_cpc710_pci64(struct pci_dev* dev) } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CPC710_PCI64, fixup_cpc710_pci64); +#if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_CHRP) + +static u8* pci_to_OF_bus_map; +static int pci_bus_count; + /* * Functions below are used on OpenFirmware machines. */ @@ -221,6 +223,8 @@ pci_create_OF_bus_map(void) } #endif +#endif /* defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_CHRP) */ + void pcibios_setup_phb_io_space(struct pci_controller *hose) { unsigned long io_offset; @@ -252,6 +256,8 @@ static int __init pcibios_init(void) if (pci_assign_all_buses || next_busno <= hose->last_busno) next_busno = hose->last_busno + pcibios_assign_bus_offset; } + +#if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_CHRP) pci_bus_count = next_busno; /* OpenFirmware based machines need a map of OF bus @@ -260,6 +266,7 @@ static int __init pcibios_init(void) */ if (pci_assign_all_buses) pcibios_make_OF_bus_map(); +#endif /* Call common code to handle resource allocation */ pcibios_resource_survey(); From patchwork Wed Jul 6 10:43:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 1652916 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=vQVM0JvS; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4LdGNh63dhz9sGg for ; Wed, 6 Jul 2022 20:43:32 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231867AbiGFKn1 (ORCPT ); Wed, 6 Jul 2022 06:43:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230231AbiGFKnY (ORCPT ); Wed, 6 Jul 2022 06:43:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1654390; Wed, 6 Jul 2022 03:43:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3CE9261E52; Wed, 6 Jul 2022 10:43:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44AFFC341CF; Wed, 6 Jul 2022 10:43:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657104202; bh=99roP7FFejJ4tHZj9bNwClVKU/G2TunICeiuDt+0hYc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vQVM0JvSni/qmtb+vV+CpQPqbeOyFsnWG3Osw+0Th+vK0NqSLNKg+N1qsBudC9ccb cCZ2YrwQAYFsrTq9VEN8H2e2K6v0QKaEDScGQrAOaqqnXx57l3ojtapiADZ7q90+Ln T4KMscRZBU8hOiU7q2FeOsJgN3hDSngSltLiaPyKTvOgl1KGnDVV8fe3re8/KjKIav XazxYK7Vw8oYOmPduyKSsQXUnTBK8JhhnfjOWlf8kEm3X5ZSQD8WPpJyX2pjN6e5GN sDVbJeWHQXZaii7lpmvq8RkBt/HAgKKR+XtutdUZLigIiwvNbj03i1my8lGmxsAGvw oHLpDcT7KVP7w== Received: by pali.im (Postfix) id EFA197BA; Wed, 6 Jul 2022 12:43:21 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Christophe Leroy , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Nick Child , Bjorn Helgaas Cc: linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/5] powerpc/pci: Add config option for using all 256 PCI buses Date: Wed, 6 Jul 2022 12:43:08 +0200 Message-Id: <20220706104308.5390-6-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220706104308.5390-1-pali@kernel.org> References: <20220706104308.5390-1-pali@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org By default on PPC32 are PCI bus numbers unique across all PCI domains. So system could have only 256 PCI buses independently of available PCI domains. This is due to filling DT property pci-OF-bus-map which does not reflect multi-domain setup. On all powerpc platforms except chrp and powermac there is no DT property pci-OF-bus-map anymore and therefore it is possible on non-chrp/powermac platforms to avoid this limitation of maximal number of 256 PCI buses in system even on multi-domain setup. But avoiding this limitation would mean that all PCI and PCIe devices would be present on completely different BDF addresses as every PCI domain starts numbering PCI bueses from zero (instead of the last bus number of previous enumerated PCI domain). Such change could break existing software which expects fixed PCI bus numbers. So add a new config option CONFIG_PPC_PCI_BUS_NUM_DOMAIN_DEPENDENT which enables this change. By default it is disabled. It cause that initial value of hose->first_busno is zero. Signed-off-by: Pali Rohár --- arch/powerpc/Kconfig | 11 +++++++++++ arch/powerpc/kernel/pci_32.c | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index be68c1f02b79..f66084bc1dfe 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -370,6 +370,17 @@ config PPC_DCR depends on PPC_DCR_NATIVE || PPC_DCR_MMIO default y +config PPC_PCI_BUS_NUM_DOMAIN_DEPENDENT + depends on PPC32 + depends on !PPC_PMAC && !PPC_CHRP + bool "Assign PCI bus numbers from zero individually for each PCI domain" + help + By default on PPC32 were PCI bus numbers unique across all PCI domains. + So system could have only 256 PCI buses independently of available + PCI domains. When this option is enabled then PCI bus numbers are + PCI domain dependent and each PCI controller on own domain can have + 256 PCI buses, like it is on other Linux architectures. + config PPC_OF_PLATFORM_PCI bool depends on PCI diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c index 2f7284b68f06..433965bf37b4 100644 --- a/arch/powerpc/kernel/pci_32.c +++ b/arch/powerpc/kernel/pci_32.c @@ -239,7 +239,9 @@ void pcibios_setup_phb_io_space(struct pci_controller *hose) static int __init pcibios_init(void) { struct pci_controller *hose, *tmp; +#ifndef CONFIG_PPC_PCI_BUS_NUM_DOMAIN_DEPENDENT int next_busno = 0; +#endif printk(KERN_INFO "PCI: Probing PCI hardware\n"); @@ -248,13 +250,17 @@ static int __init pcibios_init(void) /* Scan all of the recorded PCI controllers. */ list_for_each_entry_safe(hose, tmp, &hose_list, list_node) { +#ifndef CONFIG_PPC_PCI_BUS_NUM_DOMAIN_DEPENDENT if (pci_assign_all_buses) hose->first_busno = next_busno; +#endif hose->last_busno = 0xff; pcibios_scan_phb(hose); pci_bus_add_devices(hose->bus); +#ifndef CONFIG_PPC_PCI_BUS_NUM_DOMAIN_DEPENDENT if (pci_assign_all_buses || next_busno <= hose->last_busno) next_busno = hose->last_busno + pcibios_assign_bus_offset; +#endif } #if defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_CHRP)