From patchwork Wed Aug 11 15:36:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 12431467 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 285ECC4320E for ; Wed, 11 Aug 2021 15:40:02 +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 E0D3E60FA0 for ; Wed, 11 Aug 2021 15:40:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E0D3E60FA0 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=kYy/UJjqVUtN9KMsxSMcVyzIZQcrqmTJgV01+lzgYtc=; b=L+FA3qDIRFUx4r nmAMOlXrQauNQ+9iFasdMWpI1jlwPOXHn16rej2jpqlVgpFfECDLRY9Zbe+UF0+RbJb4wLkvjduwI 1W2ZzqPnMuyydiPn2MUUC6e3GAD97sfD/uSW4Lmpr2860+myzaZyp+jFPZns9ACb0hBGqjeo1pk6F YuEEM+dub7R6/xPq9ixCjjOk+UZABquipQeMTUJq1xwnDu4BLiatGqUxUECSkUyOFtuPcYR1EajLD w4WfEB49ATP02xlJmdYWX8SfYNCZ2NsPGDyEX4HVZ44ihOlN4zikbj2o/t3yePRXN4dJTR0p79Vmw Js96RJWOsT2DU508ZgjA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDqIX-007ZQB-45; Wed, 11 Aug 2021 15:37:42 +0000 Received: from mail-io1-xd29.google.com ([2607:f8b0:4864:20::d29]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDqHa-007Z7K-5J for linux-arm-kernel@lists.infradead.org; Wed, 11 Aug 2021 15:36:43 +0000 Received: by mail-io1-xd29.google.com with SMTP id b142so2853268iof.4 for ; Wed, 11 Aug 2021 08:36:41 -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=wRFXDsRsZFP+swHvW0it2ljd9zsnjdp5Y+aRBZEgtII=; b=j5aHS3h3ClzuSFzHjW1f232qNdqNbr8RGmFfs1lj042PPgg1xQq48+wOSbQ6ijMk1k 0P8EFECxSVN6ir2xkYjqEWGSvKwYEwyesE0KZccKhWYE2JTCq9YwgUTJHRfy1dWG5XNx 5MgVnHvDXCsAK9L7G/zrejy+Q0uxWntknVdsx9iWGHecdzRCrdoc3zBBkHDgrXwV8jUo hDx2uSgwQrnf1mApyxjC04Sr4HFSDJFgf1MjBGveh8iPShD1Lt2iaY62cHA+N+INnYrJ swT1HASYf58Zn/+R/k4cWRkhZnW4J2DWEBlE6bmuDIfKNouocM7r7+zkjHHvhoAbmJYC 4Q1A== 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=wRFXDsRsZFP+swHvW0it2ljd9zsnjdp5Y+aRBZEgtII=; b=PBmXd33iZXmtGt+E/QlkZeN6TOnRbYw190Ea5Ri898IWWxPqf4Y2++qYQWyEUOObJD OarW7sEeDj+8rBZsNChaPdhpka2IPRnguzH0EmhPQwg7q5eO9PobPDhjcz41NJI8Zvf0 ehDF/MSHPP729251J2TF4zAcuOnkraqJA543y82V3X9xVBqLgX7mDZ8xkKNtOsKiUMgH qUacJSouPWBG0ve87H7C7xFNitf6O63BIN/FLmA9nNYuylifv3LQxhOIbYyaD7bvTvRr vYjZ49t1e68tgAx0p+j0rvZrflyFHkD6lcctOU8kh6+mitEt3rwlOdGKuu6HFnfAWMvk sDig== X-Gm-Message-State: AOAM533xJnZ7RMTGjLiI4nExHfamsrMMUhTANF2yn+4LpmccGpatAW5P zM5YA7llXQ6VtHCDGkWKrxo= X-Google-Smtp-Source: ABdhPJyewK+8jlT5DsfKdoU00MeBnHa8omGalrNwdkPuKHZw2jePTbG33EdqpOUGziPz18+svZ0UTQ== X-Received: by 2002:a02:7711:: with SMTP id g17mr476718jac.132.1628696201381; Wed, 11 Aug 2021 08:36:41 -0700 (PDT) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id w16sm13438214ilh.21.2021.08.11.08.36.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 08:36:41 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailauth.nyi.internal (Postfix) with ESMTP id 0357327C005A; Wed, 11 Aug 2021 11:36:40 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 11 Aug 2021 11:36:40 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrkedugdeltdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtth gvrhhnpeehvdevteefgfeiudettdefvedvvdelkeejueffffelgeeuhffhjeetkeeiueeu leenucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsoh hquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdeigedq udejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfihigmh gvrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 11 Aug 2021 11:36:39 -0400 (EDT) From: Boqun Feng To: Lorenzo Pieralisi Cc: Catalin Marinas , Will Deacon , Bjorn Helgaas , "Rafael J. Wysocki" , Len Brown , "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-pci@vger.kernel.org, linux-acpi@vger.kernel.org, linux-hyperv@vger.kernel.org, Sunil Muthuswamy , Marc Zyngier , Arnd Bergmann Subject: [RFC 4/5] arm64: PCI: Retrieve ACPI device information directly from host bridges Date: Wed, 11 Aug 2021 23:36:18 +0800 Message-Id: <20210811153619.88922-5-boqun.feng@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210811153619.88922-1-boqun.feng@gmail.com> References: <20210811153619.88922-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-20210811_083642_252376_D42F7842 X-CRM114-Status: GOOD ( 15.82 ) 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 Now since we store the corresponding ACPI device pointer in the ->private of pci_host_bridge, use it instead of the sysdata to retrieve the ACPI device information. Doing this decouples the dependency on the pci_config_window structure in Hyper-V virtual PCI, because passing a NULL pointer as the ACPI device is the soly reason of the dependency. The decoupling avoids adding pci_config_window in hv_pcibus_dev and also makes the code cleaner. Signed-off-by: Boqun Feng --- arch/arm64/kernel/pci.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c index 2276689b5411..783971749eb7 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64/kernel/pci.c @@ -82,25 +82,13 @@ int acpi_pci_bus_find_domain_nr(struct pci_bus *bus) int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge) { - struct pci_config_window *cfg; struct acpi_device *adev; struct device *bus_dev; if (acpi_disabled) return 0; - cfg = bridge->bus->sysdata; - - /* - * On Hyper-V there is no corresponding ACPI device for a root bridge, - * therefore ->parent is set as NULL by the driver. And set 'adev' as - * NULL in this case because there is no proper ACPI device. - */ - if (!cfg->parent) - adev = NULL; - else - adev = to_acpi_device(cfg->parent); - + adev = acpi_pci_root_device(bridge); bus_dev = &bridge->bus->dev; ACPI_COMPANION_SET(&bridge->dev, adev);