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: 1510155 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=AcYJCK4I; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4GYSZB2JgWz9shx for ; Tue, 27 Jul 2021 04:07:30 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232541AbhGZR07 (ORCPT ); Mon, 26 Jul 2021 13:26:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232359AbhGZR06 (ORCPT ); Mon, 26 Jul 2021 13:26:58 -0400 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE4E5C061757; Mon, 26 Jul 2021 11:07:26 -0700 (PDT) Received: by mail-io1-xd2d.google.com with SMTP id f11so13003668ioj.3; 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=E7G7uuLqzrU/GTzzGoA7tOJDlM84r83vXw12D/kl+2J8SZPfCJ3A5rlJFeV/myqgtz Mga/cufNKJr1I6/u00onQeicTRM8Bhjvz5tu3Cdpsx0Dqu1f77ws6j7kGzEqdmf1cFz3 nI1AgS5RKA8sPlgaQGLRKTZPq5Zfds6gsm6+tYFYylToNAxWLaQ7r10i7Qxqpb03nTyy mj+9vne2QKjXok1gl/soT0O/WfZWdINQG1atpafFwyJYnC0a6s9Pe18n8p2aZRbO6zBL hzFxGyWZUsmoKT2/Gw6OpS7QtmKQ8z7affpH/hP+3eOhVE6wCdFtjnY4/IrMPJkQf28r Ppfw== X-Gm-Message-State: AOAM5310/cOjVGUgg+v4TEuNQdF1hKUOjKTK94+sl8W3bPpEBcm8wRtO Y1GfyZ0oO2BIAhk5Yx2uADk= 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 Precedence: bulk List-ID: X-Mailing-List: linux-pci@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 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; }