From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FB60C07E9B for ; Tue, 20 Jul 2021 13:59:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 08E1861164 for ; Tue, 20 Jul 2021 13:59:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239422AbhGTNSp (ORCPT ); Tue, 20 Jul 2021 09:18:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239057AbhGTNGg (ORCPT ); Tue, 20 Jul 2021 09:06:36 -0400 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0193CC061767; Tue, 20 Jul 2021 06:46:35 -0700 (PDT) Received: by mail-io1-xd29.google.com with SMTP id l5so24021971iok.7; Tue, 20 Jul 2021 06:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KHaue8/q0L/XgtITbxmFTSs2meF6bSyeVDHAyfwq3qQ=; b=EUs+7cDYQ2twuXBGcgJ3ID54nrlxwVRhd2/fJu+QbiO784ZQobUF+WYU5yGivOZIr5 Fe+Nt9tAF10wZb4Irfro//jmDtlX83g8lUuzbYzvfFQPoHZC2JidrWui4H2Izf9wbwNg S2cN2xTbiFxrq8mwfHLkjowKF2yt0zd6zP+RmmW7aB+IkWEa4gAa7HJdBGnKJS8Uo89U l2A9ooAKaVksbatALCJSaimnH95rgu56IFMfYXxtaYiOjiGNQimbe9fvHMMD+HJNWigK dBvDpkAnStfFNuBemWOJ+EQ/O34aK6kfhcnuV/ocmaa7sCHBNJGwEesG18jZKtSD41H1 i7sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KHaue8/q0L/XgtITbxmFTSs2meF6bSyeVDHAyfwq3qQ=; b=R9xdAELYqy+ToYUTS/O5BNyZF92mhW9JXtgD05/PuUQZu25gl4CSaA7QPWER89sVsc hIll9GY6r7TzraxyVdw/WpXoSB0gCVm2VGsTi909la7/byyPLU8K09lOGz+tdKnCWRBN ZWgQ3oeqjvogGXVpVjP5xiR77gz2L7XHSfyG/DVB40GN1AEFvHBRI8QQaWSLAfepxi7C mAEkE0JmgwfmGQRFp1/YYstfxQ2Ppb5ITqebWi5xEelu7Ft/d/tUC3Obh7SPKfxeS+LN U8bSsOJomZ8jp5HKDA8/SRK8ow1h0EbIK3T2lt/nMqUF268QVNjuinS4gdeN5VwsZewP hhrQ== X-Gm-Message-State: AOAM530fCqb02Sr0wV0Lh7bTZUa+34Nt/TgUHhoVSydN0pbnWSqjzZ+U U14VKpuzHWndQr1rhmU3XP4YEayhuTsm+Q== X-Google-Smtp-Source: ABdhPJw+oXm9AEsLFIoRyHMm+CxOfL8zZA7wUOGTA3d9buaMX1aXsUIyODDeHj9Gnn0IhiyrjH4bpg== X-Received: by 2002:a02:cc19:: with SMTP id n25mr26569885jap.140.1626788795137; Tue, 20 Jul 2021 06:46:35 -0700 (PDT) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id u10sm7576791iop.15.2021.07.20.06.46.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jul 2021 06:46:34 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailauth.nyi.internal (Postfix) with ESMTP id C28C427C005A; Tue, 20 Jul 2021 09:46:33 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 20 Jul 2021 09:46:33 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrfedvgdeikecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtth gvrhhnpeehvdevteefgfeiudettdefvedvvdelkeejueffffelgeeuhffhjeetkeeiueeu leenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsoh hquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdeigedq udejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfihigmh gvrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 20 Jul 2021 09:46:33 -0400 (EDT) From: Boqun Feng To: Bjorn Helgaas , Arnd Bergmann , Marc Zyngier Cc: Catalin Marinas , Will Deacon , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Lorenzo Pieralisi , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Boqun Feng , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org, Sunil Muthuswamy , Mike Rapoport Subject: [RFC v5 3/8] arm64: PCI: Restructure pcibios_root_bridge_prepare() Date: Tue, 20 Jul 2021 21:44:24 +0800 Message-Id: <20210720134429.511541-4-boqun.feng@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210720134429.511541-1-boqun.feng@gmail.com> References: <20210720134429.511541-1-boqun.feng@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Restructure the pcibios_root_bridge_prepare() as the preparation for supporting cases when no real ACPI device is related to the PCI host bridge. No functional change. Signed-off-by: Boqun Feng --- arch/arm64/kernel/pci.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c index 1006ed2d7c60..5148ae242780 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64/kernel/pci.c @@ -82,14 +82,19 @@ int acpi_pci_bus_find_domain_nr(struct pci_bus *bus) int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge) { - if (!acpi_disabled) { - struct pci_config_window *cfg = bridge->bus->sysdata; - struct acpi_device *adev = to_acpi_device(cfg->parent); - struct device *bus_dev = &bridge->bus->dev; + struct pci_config_window *cfg; + struct acpi_device *adev; + struct device *bus_dev; - ACPI_COMPANION_SET(&bridge->dev, adev); - set_dev_node(bus_dev, acpi_get_node(acpi_device_handle(adev))); - } + if (acpi_disabled) + return 0; + + cfg = bridge->bus->sysdata; + adev = to_acpi_device(cfg->parent); + bus_dev = &bridge->bus->dev; + + ACPI_COMPANION_SET(&bridge->dev, adev); + set_dev_node(bus_dev, acpi_get_node(acpi_device_handle(adev))); return 0; } -- 2.30.2 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15582C07E95 for ; Tue, 20 Jul 2021 13:50:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D6D486113B for ; Tue, 20 Jul 2021 13:50:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D6D486113B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mVWFNuuEdgbomkKPZ5ksCPovhV3U3i53/d2xQeXPb98=; b=waxi0xcta+2SzL S+1EZ1WfE24eNPDxSk/xaK5+CgKfxU01MKblyZ+WuWUuQVwVSMB0z6xc63bK6QImvDw8XQLYycao0 8vgzQQPAuvP1blp3jKntgw19rQ6waNQzDoBSBWdbs4N6gRUqOZg5DjPRN7UqZi3dS7H2WW0GLlsjU t2JsyAGu1bdU89+kaiPani1QogKEYgzbRaqf7okIqQPVaz6L0ZNDNjcZeK2t472ZaLfqVH7jOzUBr xztBMBWfWFFD7qvkf+3zmcUxVnHMREGQKPsD7PLFxg7yISfOb1FvbpmCJrKBqrKLfsG+jJlFgG1ug hDbOlCCAQctcA8vliDbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5q5a-00CzT1-HA; Tue, 20 Jul 2021 13:47:14 +0000 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m5q4x-00CzLp-Rh for linux-arm-kernel@lists.infradead.org; Tue, 20 Jul 2021 13:46:37 +0000 Received: by mail-io1-xd2e.google.com with SMTP id v26so23989384iom.11 for ; Tue, 20 Jul 2021 06:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KHaue8/q0L/XgtITbxmFTSs2meF6bSyeVDHAyfwq3qQ=; b=EUs+7cDYQ2twuXBGcgJ3ID54nrlxwVRhd2/fJu+QbiO784ZQobUF+WYU5yGivOZIr5 Fe+Nt9tAF10wZb4Irfro//jmDtlX83g8lUuzbYzvfFQPoHZC2JidrWui4H2Izf9wbwNg S2cN2xTbiFxrq8mwfHLkjowKF2yt0zd6zP+RmmW7aB+IkWEa4gAa7HJdBGnKJS8Uo89U l2A9ooAKaVksbatALCJSaimnH95rgu56IFMfYXxtaYiOjiGNQimbe9fvHMMD+HJNWigK dBvDpkAnStfFNuBemWOJ+EQ/O34aK6kfhcnuV/ocmaa7sCHBNJGwEesG18jZKtSD41H1 i7sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KHaue8/q0L/XgtITbxmFTSs2meF6bSyeVDHAyfwq3qQ=; b=kpqbGGW/h12MZ19CvGLhk6i0Ys0Q/5hxxtvPPlx/hDoLPoL5U6TPQjhiruEkcHV7pC LwFKHAbJPRbRLhy6EkH7oATNsTwibCahyOoybgDBzcgPFhYQ5Jm2D8OuABbOAS1yjOP8 zIxN0V+1nTH4r7X15qtHaj+ly0mDyND1bjuhGiPH3I7L0yacGYpC6zP2NBEO8IIhabIz UxbwVLV85C3fetqLmMrtwrFFQQUaxlFjrSgGPWl2uCAIcZ1XDjxgZhrZWTd5Ny/ZaJnF zU7fJse5Gbg2EpnRh2VaNWct/q2mluFq8nDIUH/28ntuzS1uAkXabf0hR0ua9dyq+eTc 1qOg== X-Gm-Message-State: AOAM531tFbNFwsEA+sE3B0QSFrZOUPX2r7AG+E13p6L+2Nr2cndiPBam lLtKYYwDZpqL8S/j0IDVf0k= X-Google-Smtp-Source: ABdhPJw+oXm9AEsLFIoRyHMm+CxOfL8zZA7wUOGTA3d9buaMX1aXsUIyODDeHj9Gnn0IhiyrjH4bpg== X-Received: by 2002:a02:cc19:: with SMTP id n25mr26569885jap.140.1626788795137; Tue, 20 Jul 2021 06:46:35 -0700 (PDT) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id u10sm7576791iop.15.2021.07.20.06.46.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jul 2021 06:46:34 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailauth.nyi.internal (Postfix) with ESMTP id C28C427C005A; Tue, 20 Jul 2021 09:46:33 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 20 Jul 2021 09:46:33 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrfedvgdeikecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtth gvrhhnpeehvdevteefgfeiudettdefvedvvdelkeejueffffelgeeuhffhjeetkeeiueeu leenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsoh hquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdeigedq udejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfihigmh gvrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 20 Jul 2021 09:46:33 -0400 (EDT) From: Boqun Feng To: Bjorn Helgaas , Arnd Bergmann , Marc Zyngier Cc: Catalin Marinas , Will Deacon , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Lorenzo Pieralisi , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Boqun Feng , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org, Sunil Muthuswamy , Mike Rapoport Subject: [RFC v5 3/8] arm64: PCI: Restructure pcibios_root_bridge_prepare() Date: Tue, 20 Jul 2021 21:44:24 +0800 Message-Id: <20210720134429.511541-4-boqun.feng@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210720134429.511541-1-boqun.feng@gmail.com> References: <20210720134429.511541-1-boqun.feng@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210720_064635_946253_E22D27FD X-CRM114-Status: GOOD ( 13.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Restructure the pcibios_root_bridge_prepare() as the preparation for supporting cases when no real ACPI device is related to the PCI host bridge. No functional change. Signed-off-by: Boqun Feng --- arch/arm64/kernel/pci.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c index 1006ed2d7c60..5148ae242780 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64/kernel/pci.c @@ -82,14 +82,19 @@ int acpi_pci_bus_find_domain_nr(struct pci_bus *bus) int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge) { - if (!acpi_disabled) { - struct pci_config_window *cfg = bridge->bus->sysdata; - struct acpi_device *adev = to_acpi_device(cfg->parent); - struct device *bus_dev = &bridge->bus->dev; + struct pci_config_window *cfg; + struct acpi_device *adev; + struct device *bus_dev; - ACPI_COMPANION_SET(&bridge->dev, adev); - set_dev_node(bus_dev, acpi_get_node(acpi_device_handle(adev))); - } + if (acpi_disabled) + return 0; + + cfg = bridge->bus->sysdata; + adev = to_acpi_device(cfg->parent); + bus_dev = &bridge->bus->dev; + + ACPI_COMPANION_SET(&bridge->dev, adev); + set_dev_node(bus_dev, acpi_get_node(acpi_device_handle(adev))); return 0; } -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel