Message ID | 20210609163211.3467449-7-boqun.feng@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=j3iR=LD=lists.infradead.org=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@kernel.org> 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.8 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,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 C4548C48BCF for <linux-arm-kernel@archiver.kernel.org>; Wed, 9 Jun 2021 17:30:06 +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 89F57613D2 for <linux-arm-kernel@archiver.kernel.org>; Wed, 9 Jun 2021 17:30:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 89F57613D2 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=coISBF/nxGzHEBLS5hv9smt6aWiHtW+tYeq8JgqObnA=; b=Ylbzo1e3i8ZbRU CfbZ9rvWLtKk1vdoQSN+V2RnyDStG0vHEpjqbdV5/viFrgaOCnTkPZGeXvjgnkMzvlNVUnD5zJArI RpsGGCuxhTA5hkiRKOHv674cfQx8z/VgjXMfXITTO0ClCNtoBlBjJ9Wnfa4bGi9Yz3SOj/R3Z/37N VhGfkO9NUzmWW/be4P/EBiKp9nJo0HPx8pd12VWFPCDzMRt0EesqICFtfdZ/HZEiHRhrLKEgZfDju PHsPJiMI+z4tSaIXGfUCAszYIYK0om7j2/vw4ibtlAZCUoaFbjbYclM2xEI/2CmNQwYQx3RXB1NaI MbWmVu0oXPcB22xk/GgQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lr1zI-00FILz-U9; Wed, 09 Jun 2021 17:27:35 +0000 Received: from mail-il1-f177.google.com ([209.85.166.177]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lr18x-00ExSc-Qe for linux-arm-kernel@lists.infradead.org; Wed, 09 Jun 2021 16:33:29 +0000 Received: by mail-il1-f177.google.com with SMTP id b5so27086919ilc.12 for <linux-arm-kernel@lists.infradead.org>; Wed, 09 Jun 2021 09:33:27 -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=ejFMapilAMOPPgo65R0NoskzTqCmBJQGTttVyFEof2s=; b=msxBvyiJQsbZYn9NVGTvjMwaHc6gfCHlPxwqAAetEsFg3aT1qqdvBeUI8ZS1GSyVOr fb3UQ0BD56z/9dZTq3kf8skbvHbiNXPtj76RLdJzgQbvf/qJ3b6GYZnYP9MOuHqTg98W +kOo1FVGNr+bo21YZYzwXMvunLzJGGoQ9AnJWHgl6YluBQ2ZAa8m6t4QcXSy8K70uzMN qKHmXEI+EWLi79TOw1zNhk1GxbWsKvUzqxt9DP3JFkRwgoppbKOwmm2otClEynJ+Mg3p Mdb4EzuQXRnr19TlALueNSBx20UNJNDryBSAZF2JYMl8oVhaJvbkvjl4inyKSAgPPlQZ rCiQ== 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=ejFMapilAMOPPgo65R0NoskzTqCmBJQGTttVyFEof2s=; b=ijfiA40IkLpP3az2AXZnbYxlF+pswLnk8mGrOi/VQZpjN+NuW4pz75pLbDmL9NX0FS CrfafvfhlvsD7mP3IIKVuJytr1vyB4q7PvWvbhVurHUoxkAT0m3A6VYrRWm7XD7u0SZC UxS6NHGqQHl/+lDkyX/Qqz+UOSZUAgfNcZgCb6VezDu+mju/769+xde/WUI6/81xAhui JZY6uGDhSg/TxlB4dkLu8VQcKPteUcsOFMYT91SIkpnH+r/y+7jpI5ihptE6DH4Uzgkx PWe7FCvQh8IMYlWpWmn1PmoemBS2FI+UjfhUiEmeJoU+N9ZMtn3NJLGWe2MaTR8YzPIl X6JA== X-Gm-Message-State: AOAM530MLTn39rSURQ8NQ78naG8sG/8FxBTp1im9r4KsUcHj5CKWvdnN 8GgJS1asOmUzZvDADEPa6f4= X-Google-Smtp-Source: ABdhPJyGfS687wl4KOUdiCz4Zzh820mpkXMSIFgCcRgiZpXFua5L069oVO9LWHjCOlyNwF69yurATw== X-Received: by 2002:a05:6e02:b43:: with SMTP id f3mr439896ilu.22.1623256346695; Wed, 09 Jun 2021 09:32:26 -0700 (PDT) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id i13sm262519ilr.16.2021.06.09.09.32.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jun 2021 09:32:26 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id 524A327C005B; Wed, 9 Jun 2021 12:32:25 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 09 Jun 2021 12:32:25 -0400 X-ME-Sender: <xms:GO3AYGDm3INFlRCiI83_K99y8sKEE6gi0aG6DXm-N9f5p6da_3Jmog> <xme:GO3AYAhzfoT1t-cZe096aVxq6W_To8PyJzr4t9-A7uGdtTpVTgVQ1N786yTV3cPyY Y-q4wn75vIkyKgRGg> X-ME-Received: <xmr:GO3AYJmC8PcS3l_DCeQ4rFJdSSuZct9s_4EK9m8sN2wLILnkO0tkPp5pHmA> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeduuddguddtvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepuehoqhhu nhcuhfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrg htthgvrhhnpeehvdevteefgfeiudettdefvedvvdelkeejueffffelgeeuhffhjeetkeei ueeuleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gsohhquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdei gedqudejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfih igmhgvrdhnrghmvg X-ME-Proxy: <xmx:GO3AYEx9rP6Sp2ikvXBbIdbW-rAauqz-yRhhUkb9DQN8Kw97pP9D6A> <xmx:GO3AYLRlVw6berf7skW6RTIpLbhdktbTni8suXCqgBMQIBTeZWVVGw> <xmx:GO3AYPahbPscEt8oY19nfckwWrRizVfZgNn8ycaZIqRZsVpvGPxnNQ> <xmx:Ge3AYMj_0QMAffADY3pwxG7HwaCLeu2xkBp6C80nZBbVszifGFea5eKNpbA> Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 9 Jun 2021 12:32:24 -0400 (EDT) From: Boqun Feng <boqun.feng@gmail.com> To: Bjorn Helgaas <bhelgaas@google.com>, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org Cc: Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, "K. Y. Srinivasan" <kys@microsoft.com>, Haiyang Zhang <haiyangz@microsoft.com>, Stephen Hemminger <sthemmin@microsoft.com>, Wei Liu <wei.liu@kernel.org>, Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>, Rob Herring <robh@kernel.org>, Clint Sbisa <csbisa@amazon.com>, Boqun Feng <boqun.feng@gmail.com>, Ard Biesheuvel <ardb@kernel.org>, Sunil Muthuswamy <sunilmut@microsoft.com> Subject: [RFC v3 6/7] arm64: PCI: Support root bridge preparation for Hyper-V PCI Date: Thu, 10 Jun 2021 00:32:10 +0800 Message-Id: <20210609163211.3467449-7-boqun.feng@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210609163211.3467449-1-boqun.feng@gmail.com> References: <20210609163211.3467449-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-20210609_093327_893330_F56CE340 X-CRM114-Status: GOOD ( 14.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
PCI: hv: Support host bridge probing on ARM64
|
expand
|
diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c index 1006ed2d7c60..020bc268bf06 100644 --- a/arch/arm64/kernel/pci.c +++ b/arch/arm64/kernel/pci.c @@ -84,7 +84,12 @@ 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); + /* + * On Hyper-V, there is no corresponding APCI device for a root + * bridge, therefore ->parent is set as NULL by the driver. Then + * 'adev' should be NULL in this case. + */ + struct acpi_device *adev = cfg->parent ? to_acpi_device(cfg->parent) : NULL; struct device *bus_dev = &bridge->bus->dev; ACPI_COMPANION_SET(&bridge->dev, adev);
Currently at root bridge preparation, the corresponding ACPI device will be set as the companion, however for a Hyper-V virtual PCI root bridge, there is no corresponding ACPI device, because a Hyper-V virtual PCI root bridge is discovered via VMBus rather than ACPI table. In order to support this, we need to make pcibios_root_bridge_prepare() work with cfg->parent being NULL. Signed-off-by: Boqun Feng <boqun.feng@gmail.com> --- arch/arm64/kernel/pci.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)