From patchwork Mon Jul 26 18:06:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 12400453 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 83C17C4338F for ; Mon, 26 Jul 2021 18:10:04 +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 5130260F91 for ; Mon, 26 Jul 2021 18:10:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5130260F91 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=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=245Fu0cS8mpQFkNTN/S9uWv4TtcP6i4mkt3mt1lzHiQ=; b=Z+NdudN7xV1j5j vvudgb89m7BPn5XHxfKRwCdRDhaDPkNfBhDAEsqTrKzOVbbcbDjysGwj+Hrr0in/QRAy3WIMxFsar az7JN7pD//vqjjPtvyHHwGD3TNGgbNGlTmFOGv14lvNT3blMN9Yati16M7VmGPbeodLxtghQeznuo uoA5HoJ/8Cc8FEFhbAiyYyPZ72xiusdzc0oGvuwdvcV8Jgyka8GKv4freHJlwDLx7hdw9iC+UMGyd I/VsyeUE71K/UxbIjxoEvp9poPCU6INP/ytqjCVVoIRY9laTTvxv24QQZlBnYh5bE776p9MAXhFke ugNywFO62IazgEjzLh2w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m851M-00CByp-QD; Mon, 26 Jul 2021 18:08:09 +0000 Received: from mail-io1-xd30.google.com ([2607:f8b0:4864:20::d30]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m850g-00CBob-UW for linux-arm-kernel@lists.infradead.org; Mon, 26 Jul 2021 18:07:28 +0000 Received: by mail-io1-xd30.google.com with SMTP id h1so12967706iol.9 for ; Mon, 26 Jul 2021 11:07:26 -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=LHrsItUFYAp+yhbZpF5x7FyTurt+NzbD/q2wgRgWa4g=; b=AcYJCK4IAtJVVb1NLiTC/jhNqsHskratKVULEK2AcYvaJf08IOpPv6Q3bVRBWPGu8h 5cMcNV8R/3CwKyZGVTHBgxaNDz3c5SulIWjB2hmBMQFZwhS9pSXAVFHPrTQLeWTukOjr k6qAZaVrwxYPPmfs2CuAuSm3WAGCaOXlI+LQ3tLklMbdOP7YIzuQ/KsnV/Hhz//SD6qx Y7H7D9A+TJqjKpzAWAh7s/J+HFJu/v/UCUAlOi0RwLSJerNNTCd73EAXtP/tmSr1PbG6 f0Ht+C3pIdgxhLkbMMJ60tKdyfpqtkTTzAqBNjvMShIYyCsovnJAVdSZ7Nw0Go/ye1Iv ToyA== 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=LHrsItUFYAp+yhbZpF5x7FyTurt+NzbD/q2wgRgWa4g=; b=prI8iBTO5gNlyIZNDQkcmfbUpOEp2l8WkhLdNjk810gTMpnJHluBMKzA3D7MVD63dU hmYxIeBByzzfvPqN4Ui9IkM/YWvc47OhbuUZQEDC7llOO5Hk4HJsUM8yskqAcTjE/aNA FVZCOFO2cr+pw9IMxwlZkXnwBNdp7xyBIDHWf/abyb+Rg0IVg/gqSe5z/XYv2fmEiQVj nk3LbtkiAse1NpZsehTHnbS8m5mbbFSf/p8YrM3F3FaTKPA8CH4/EwfxKKTtMmca00tG o2YxY6UQyEQbd177RoUlWTwlDJTetoUHppn6IE2zrHR5ysnfEwCbmTy2+t/apc0FuiXX YMwQ== X-Gm-Message-State: AOAM531CSSQ2sPiF+x/k/cBfDnuVZS8f+9z63jc8p/wlQk30QZ3oGrJS L/EMq9HKXQrJjvHIvrdiYes= X-Google-Smtp-Source: ABdhPJyyjproPpnhdk5Y+TcJ2Ft2rCFKihz1P0YZ7etQvYq41fU7f2wjmMJyy3cRbHKH9jcLhAD+kQ== X-Received: by 2002:a05:6638:148e:: with SMTP id j14mr17993794jak.136.1627322846198; Mon, 26 Jul 2021 11:07:26 -0700 (PDT) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com. [66.111.4.227]) by smtp.gmail.com with ESMTPSA id y14sm286275ilq.6.2021.07.26.11.07.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jul 2021 11:07:25 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailauth.nyi.internal (Postfix) with ESMTP id B689327C0066; Mon, 26 Jul 2021 14:07:24 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 26 Jul 2021 14:07:24 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrgeehgdduudejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeeuohhquhhn ucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilhdrtghomheqnecuggftrfgrth htvghrnhephedvveetfefgiedutedtfeevvddvleekjeeuffffleeguefhhfejteekieeu ueelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepsg hoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqieelvdeghedtieeg qddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepghhmrghilhdrtghomhesfhhigi hmvgdrnhgrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 26 Jul 2021 14:07:24 -0400 (EDT) From: Boqun Feng To: Bjorn Helgaas , Arnd Bergmann , Marc Zyngier , Lorenzo Pieralisi Cc: Catalin Marinas , Will Deacon , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Rob Herring , =?utf-8?q?Krzysztof_Wilczy=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: [PATCH v6 3/8] arm64: PCI: Restructure pcibios_root_bridge_prepare() Date: Tue, 27 Jul 2021 02:06:52 +0800 Message-Id: <20210726180657.142727-4-boqun.feng@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210726180657.142727-1-boqun.feng@gmail.com> References: <20210726180657.142727-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-20210726_110727_026622_DE4DABCA X-CRM114-Status: GOOD ( 13.49 ) 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: , 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 Acked-by: Catalin Marinas --- 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; }