From patchwork Wed Aug 11 15:36:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 12431473 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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=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 B41E0C4320A for ; Wed, 11 Aug 2021 15:36:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7223D60F46 for ; Wed, 11 Aug 2021 15:36:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233010AbhHKPhC (ORCPT ); Wed, 11 Aug 2021 11:37:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233189AbhHKPhB (ORCPT ); Wed, 11 Aug 2021 11:37:01 -0400 Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B868C061765; Wed, 11 Aug 2021 08:36:37 -0700 (PDT) Received: by mail-il1-x129.google.com with SMTP id a4so3248099ilj.12; Wed, 11 Aug 2021 08:36:37 -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=GWLHS7/8sRUtmPBUfizlYA1mSy1P6fTX/Paccfguq6M=; b=qcNIH8Msq5OiNc+L3Z12ZCE8w4EtGd20JL38KwwamTSNTSTMC3eqGwkenBJAWDayAK nqm0sz6epxb9sWaCbqn+N7LA0kHi15vojXcwMD3qAQNU0GBY7jUSv/6onB95VYDkLp/y sghqlkytM26c+cPSX0otKUN4wcrCkIwtQ61pf7sOlDRKuyrUSAL0jwIEWi224YLcx8I9 TalWA6dpPTmMh3cVQ/mcz8PxKTKJsCdomhx5gm8u0uXReyo+4almtLtZ+NI6cDUAjyd1 V2CR5diJMvIGg8IA/Pw3UD7Fh9p1mjqyGBqbLGxeO7VbuffW/yUgeiAhSLxE4xxL1i6o TNrA== 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=GWLHS7/8sRUtmPBUfizlYA1mSy1P6fTX/Paccfguq6M=; b=P4vFB0d8syu0VmD7w5vwrcakDN1pSriCyAfMKl4j2NIQKud6GKxcW7jCfwgDBuEnzc 05dw//gcfAeG3E3rZKPb5OeHIW9LwE9crYJpdVIKOLmAY/uYOxjXZ5tzy6pXR21RVh9l yym7Ed4EGrzp1MH04m/2ehkXg3huzhivNotPzk2KNYNgbqmdSjhuOWTZonOJbjZRxNWf J0FidO4jUbzCv0n+89MXRC1yJ/u43YZ5oIpviO3IfHQ5CqyMl3YNDGWyGJVSbMYRxsxf GZR00lBbarzTzC24QHRR1utKdUchmTnhoT9RlCQmpCgiLqsv2b9l1X9ZnLzLjocCuoNN jYog== X-Gm-Message-State: AOAM530VGO2f2DYeG9J5dxxm672KUqZPeGQhg1/9mIMC0Ac1htbCnsss shUl00IRWR7GgPZMT8xTuyg= X-Google-Smtp-Source: ABdhPJw7CZTvEfUfPqm/j+ddaSI2a9I3c0fRLtrRijCPdrvAwL2rCz2j6pNCSqyitNsKHlsE4XcAPQ== X-Received: by 2002:a92:4453:: with SMTP id a19mr335155ilm.221.1628696196604; Wed, 11 Aug 2021 08:36:36 -0700 (PDT) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id h8sm5899493ile.39.2021.08.11.08.36.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 08:36:36 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailauth.nyi.internal (Postfix) with ESMTP id 422DF27C005A; Wed, 11 Aug 2021 11:36:35 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 11 Aug 2021 11:36:35 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrkedugdeltdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtth gvrhhnpeehvdevteefgfeiudettdefvedvvdelkeejueffffelgeeuhffhjeetkeeiueeu leenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsoh hquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdeigedq udejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfihigmh gvrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 11 Aug 2021 11:36:34 -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 1/5] PCI: Introduce pci_create_root_bus_priv() Date: Wed, 11 Aug 2021 23:36:15 +0800 Message-Id: <20210811153619.88922-2-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 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In order to allow root bus creation to populate the ->private of the pci_host_bridge at the same, pci_create_root_bus_priv() is introduced. The new function will be used to support passing the corresponding ACPI device as the ->private field when creating the PCI root bus. No functional change. Signed-off-by: Boqun Feng --- drivers/pci/probe.c | 15 ++++++++++++--- include/linux/pci.h | 3 +++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index ea7f2a57e2f5..8f5fea2a7bd9 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -2991,13 +2991,14 @@ void __weak pcibios_remove_bus(struct pci_bus *bus) { } -struct pci_bus *pci_create_root_bus(struct device *parent, int bus, - struct pci_ops *ops, void *sysdata, struct list_head *resources) +struct pci_bus *pci_create_root_bus_priv(struct device *parent, int bus, + struct pci_ops *ops, void *sysdata, struct list_head *resources, + void *private, size_t priv_size) { int error; struct pci_host_bridge *bridge; - bridge = pci_alloc_host_bridge(0); + bridge = pci_alloc_host_bridge(priv_size); if (!bridge) return NULL; @@ -3008,6 +3009,9 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int bus, bridge->busnr = bus; bridge->ops = ops; + if (priv_size) + memcpy(bridge->private, private, priv_size); + error = pci_register_host_bridge(bridge); if (error < 0) goto err_out; @@ -3018,6 +3022,11 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int bus, put_device(&bridge->dev); return NULL; } +struct pci_bus *pci_create_root_bus(struct device *parent, int bus, + struct pci_ops *ops, void *sysdata, struct list_head *resources) +{ + return pci_create_root_bus_priv(parent, bus, ops, sysdata, resources, NULL, 0); +} EXPORT_SYMBOL_GPL(pci_create_root_bus); int pci_host_probe(struct pci_host_bridge *bridge) diff --git a/include/linux/pci.h b/include/linux/pci.h index 01aa201e1df0..119356312979 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1041,6 +1041,9 @@ void pcibios_scan_specific_bus(int busn); struct pci_bus *pci_find_bus(int domain, int busnr); void pci_bus_add_devices(const struct pci_bus *bus); struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata); +struct pci_bus *pci_create_root_bus_priv(struct device *parent, int bus, + struct pci_ops *ops, void *sysdata, struct list_head *resources, + void *private, size_t priv_size); struct pci_bus *pci_create_root_bus(struct device *parent, int bus, struct pci_ops *ops, void *sysdata, struct list_head *resources); From patchwork Wed Aug 11 15:36:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 12431475 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 85C7DC4338F for ; Wed, 11 Aug 2021 15:36:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 548E3610CF for ; Wed, 11 Aug 2021 15:36:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233253AbhHKPhE (ORCPT ); Wed, 11 Aug 2021 11:37:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232624AbhHKPhC (ORCPT ); Wed, 11 Aug 2021 11:37:02 -0400 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F0CCC061765; Wed, 11 Aug 2021 08:36:38 -0700 (PDT) Received: by mail-io1-xd2f.google.com with SMTP id s184so4229577ios.2; Wed, 11 Aug 2021 08:36:38 -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=H0aePHbvBlMQFFOlxS/RlBo9IjhQNt3o+m5ARm3Lb0E=; b=KSxqYJ+KWw7Gg3DhQLJkgDY1JuTJXIjrCvPJgn3MOCKyuVYdmdz68zetkXAXt3bu4x ES6AUIJPnki5DiPDmJ8aDEAo+XTY5BJ7Kg1rKv0gTRR+0i2E6TJO6igmNq15J3L5y3kv x+7brmJEjp2AiWLmaoPuAXa/PABSGWuETv74xIQmjrTlKl40vcEthWTA1Gr/CWv2lLQN khucthDm/e6F/W6tTJb9zWZ+/5HTQrjlwe94h4NDZ+/5C7i4lyeaPA2J2CXH2JitEFDw fNVbFqtmVgDS4r35EnL6xOX8mTE93LdZ61zLRoZiGGDhJUDGXWYWD3kKsMFiIdcR/DQd gonA== 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=H0aePHbvBlMQFFOlxS/RlBo9IjhQNt3o+m5ARm3Lb0E=; b=TSw1kqU0t7mDMW5wtuEOVV0/Uz6XjrB43Pi8XeqKjo3tW/N6fxHBiDT5c6bmVeFapn brCvnCmlx4uP92zJwyEh+7MoU2SuKbaNtusm3j7xsxDQXmgxPz82FisqcmlvLaBFJVbH vmdTKtC1iv1o08D4d2uf+5lwmtnUoBKuj4heRC5TFCTaKvzP7FP/CXDmQvyVbCKyUS+G pxwNKfSio0Vf1SDk9VjrttzVTus3/Z70rfIUz9+kPkUGSG5col+Jz3a+jE3zDUhNvVVq 2ocdEkmu/A/zOnBY+Qg6slLMqA6tZsViyq9rJQ3hURnYUXc+LT0IkHevyiY1+H0/TC6m /2pw== X-Gm-Message-State: AOAM532vWDdFMK3eyanaqVjNuAmK5Kr4JTkAdoyOvBGqeuoZCDK+l2Fm p2YbOC4yZwlX2WWUDn4/f9E= X-Google-Smtp-Source: ABdhPJw4swY5OoR9NWjAtDhIiSaQ+1h4/lWhktDxZBX90x+/YF3KS5bdFjgKxgydOLGMjvvdPVEdyA== X-Received: by 2002:a6b:b502:: with SMTP id e2mr256604iof.152.1628696198048; Wed, 11 Aug 2021 08:36:38 -0700 (PDT) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id x11sm14111871ilu.3.2021.08.11.08.36.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 08:36:37 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailauth.nyi.internal (Postfix) with ESMTP id 7433527C0054; Wed, 11 Aug 2021 11:36:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 11 Aug 2021 11:36:36 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrkedugdeltdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtth gvrhhnpeehvdevteefgfeiudettdefvedvvdelkeejueffffelgeeuhffhjeetkeeiueeu leenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsoh hquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdeigedq udejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfihigmh gvrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 11 Aug 2021 11:36:36 -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 2/5] PCI/ACPI: Store ACPI device information in the host bridge structure Date: Wed, 11 Aug 2021 23:36:16 +0800 Message-Id: <20210811153619.88922-3-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 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org In order to decouple the ACPI device information of a PCI host bridge from the sysdata, ->private of pci_host_bridge is used to store the ACPI device, and it's done by the new pci_create_root_bus_priv(). A reader function is also added, to retrieve the ACPI device information in pci_host_bridge. Signed-off-by: Boqun Feng --- drivers/acpi/pci_root.c | 5 +++-- include/linux/pci-acpi.h | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index d7deedf3548e..82824841cbda 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -894,8 +894,9 @@ struct pci_bus *acpi_pci_root_create(struct acpi_pci_root *root, pci_acpi_root_add_resources(info); pci_add_resource(&info->resources, &root->secondary); - bus = pci_create_root_bus(NULL, busnum, ops->pci_ops, - sysdata, &info->resources); + bus = pci_create_root_bus_priv(NULL, busnum, ops->pci_ops, sysdata, + &info->resources, &root->device, + sizeof(struct acpi_device *)); if (!bus) goto out_release_info; diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index 5ba475ca9078..21d4cc80aa55 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h @@ -80,6 +80,11 @@ extern struct pci_bus *acpi_pci_root_create(struct acpi_pci_root *root, struct acpi_pci_root_ops *ops, struct acpi_pci_root_info *info, void *sd); +static inline struct acpi_device * +acpi_pci_root_device(struct pci_host_bridge *bridge) +{ + return *((struct acpi_device **)bridge->private); +} void acpi_pci_add_bus(struct pci_bus *bus); void acpi_pci_remove_bus(struct pci_bus *bus); From patchwork Wed Aug 11 15:36:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 12431477 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 56E46C43214 for ; Wed, 11 Aug 2021 15:36:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2B1B760FD9 for ; Wed, 11 Aug 2021 15:36:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232624AbhHKPhH (ORCPT ); Wed, 11 Aug 2021 11:37:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233248AbhHKPhE (ORCPT ); Wed, 11 Aug 2021 11:37:04 -0400 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 845F7C0613D5; Wed, 11 Aug 2021 08:36:40 -0700 (PDT) Received: by mail-il1-x133.google.com with SMTP id c3so3315023ilh.3; Wed, 11 Aug 2021 08:36:40 -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=m+WerKLNTuUcJjz5ppPIhMIuAZu9yrWomJykGHOMdQE=; b=Xw6bPBKjGySndzPoxC/HBXcfij6Ej8gsr8XCwc/zUlawabtn9idGbjPtC5CiRKkBTI IA8wyHhBi1Eb/DNR66nHkc+bGlSqJ1oMU4yomnzFoL0dLvsgp9EijGkpycy+ME8ywYAU 9miztcb3otIBCm1rnSjISWjbUkHjtO5Zh2zXHk64EhOOR4+ZoIniFCi6Vzp+VeQwPEFF 0swypePmtrL4wWMaRNBmi/e63ZXF5YQpxE0eYKmevPTTY0pWT9oCPylMLKRBiOT3TNq1 9Jbxxt1ehFQEq3YrJUL7/RrF9dIgres10UXUChxe2NvXIyryaSik9xOkU7x4vyd0R6Yz cr1g== 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=m+WerKLNTuUcJjz5ppPIhMIuAZu9yrWomJykGHOMdQE=; b=PJ6KQ1a8g1oDOyv6OHsFsUocjdzpWKt+2QUVpYBsgGOaAva71E+z67DdBzuhAEFp01 C2GKXz3Kxdw8Khh905spuORcWhQtMTaLZGjbLZ9ovu/tszK44gSbJm7VbtAGRwoYWk86 tSbci4C9Fh8wTZAUZj+rGP5ZntM/hy4+BPpc4ajVnjlffC3J18+ixXdqClLYL3zBJalv 0AAYf+9pqTUaIEALh+8/h8r8sleI+/DYVnSZl4baROLP85WZJ9Gugd8tbRXICTYq+ukE 4hwpAc9KNZ7qHth2lMPC4d9qMUTCo94jDf2fzCTZjgRvlqpwn2OkhJLt7v5fnpSN2OAd 3SOA== X-Gm-Message-State: AOAM531hMIF0XEONkVXJORK03mf59s6CKCxnM3knUhe5wj/Uj9aVvY5R 59Tijx9xErqmiONQ3Kxy1jA= X-Google-Smtp-Source: ABdhPJwG2Q43Tufl+2zOtEvKna7XTvih3Y7p27iDvAbAfAT9elYx46qIz2mqI+h/bG7cZprSEiAaxg== X-Received: by 2002:a05:6e02:13f0:: with SMTP id w16mr276304ilj.268.1628696200058; Wed, 11 Aug 2021 08:36:40 -0700 (PDT) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id t15sm12914887iln.77.2021.08.11.08.36.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 08:36:39 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id BCAAA27C0054; Wed, 11 Aug 2021 11:36:38 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 11 Aug 2021 11:36:38 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrkedugdeklecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtth gvrhhnpeehvdevteefgfeiudettdefvedvvdelkeejueffffelgeeuhffhjeetkeeiueeu leenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsoh hquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdeigedq udejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfihigmh gvrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 11 Aug 2021 11:36:37 -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 3/5] PCI: hv: Set NULL as the ACPI device for the PCI host bridge Date: Wed, 11 Aug 2021 23:36:17 +0800 Message-Id: <20210811153619.88922-4-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 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org A PCI host bridge of Hyper-V doesn't have the corresponding ACPI device, therefore a NULL pointer needs to be set as the ->private of pci_host_bridge since for platforms with ACPI ->private is used to store the ACPI device information for the host bridges. And since kzalloc() is used to allocate pci_host_bridge, as a result, what is needed is just setting the correct size of ->private, kzalloc() will zero the field as if set a NULL pointer to it. Signed-off-by: Boqun Feng --- drivers/pci/controller/pci-hyperv.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c index 62dbe98d1fe1..fd3792b5edcc 100644 --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c @@ -3021,7 +3021,12 @@ static int hv_pci_probe(struct hv_device *hdev, */ BUILD_BUG_ON(sizeof(*hbus) > HV_HYP_PAGE_SIZE); - bridge = devm_pci_alloc_host_bridge(&hdev->device, 0); + /* + * devm_pci_alloc_host_bridge() use kzalloc(), and we want to set + * ->private as a NULL pointer, therefore no need to set ->private after + * allocation. + */ + bridge = devm_pci_alloc_host_bridge(&hdev->device, sizeof(struct acpi_device *)); if (!bridge) return -ENOMEM; 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: 12431479 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 790EFC00143 for ; Wed, 11 Aug 2021 15:36:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5652E610F7 for ; Wed, 11 Aug 2021 15:36:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233354AbhHKPhI (ORCPT ); Wed, 11 Aug 2021 11:37:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233220AbhHKPhF (ORCPT ); Wed, 11 Aug 2021 11:37:05 -0400 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9379C061765; Wed, 11 Aug 2021 08:36:41 -0700 (PDT) Received: by mail-io1-xd30.google.com with SMTP id n17so2656679ioc.7; 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=cWtc0cefgmuqOmDZ+gQi9l36SjmP1/efFiX6PgXb5G4BYfLbdUCpeDhT8Y9/Pdjw06 7fCAjzVGwDHPhkBrJlGsRGhpyC47JmmbGK//PmkQqPLbfdLZHhgEUbiDAYY9DhYfyh5d 8ESp/W1ShgEzKeAY/93zy1osgMkm6HI7vUOun3NiazWw+Gagwl3dOSGq5FmEcwrkwNGK Cl+D0p2JSwMRA7OXRPJMWPakv2XrnBO9GZ3fYVQwMJFZCvCDeKt8UmeBV4QYhMHCHkGD bUFgdYGQrjyHssJ5evvdxu9EMjwkRauUPvhDemNE+lJnHu7EnvgZEtroq862nnjmqKrM bwMQ== X-Gm-Message-State: AOAM530GoJ8lTE2Hk31sQs3bMUexEEA1cjIvynzYFIMIn55AcFj+ldtY wEPZ5IVJEwwHu8aazG/xVTw= 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 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.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); From patchwork Wed Aug 11 15:36:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 12431481 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 137D7C43214 for ; Wed, 11 Aug 2021 15:36:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC8C661077 for ; Wed, 11 Aug 2021 15:36:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233422AbhHKPhK (ORCPT ); Wed, 11 Aug 2021 11:37:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233322AbhHKPhH (ORCPT ); Wed, 11 Aug 2021 11:37:07 -0400 Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16BB5C061765; Wed, 11 Aug 2021 08:36:43 -0700 (PDT) Received: by mail-io1-xd2b.google.com with SMTP id f11so4203490ioj.3; Wed, 11 Aug 2021 08:36:43 -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=DQztCj7/CCGbKaKfsGCj2ylvssWy2hoSLtQUB8lGvqA=; b=XxdVMm6fenLsjMT3qAxdEjlJ+RMQ5X4WvI9Cx8RWNlvtVC+bhg0+IiOIOWs6QAXGzW jkQe1TurjzzTv9GUVGVu0YTsBAO3Q9XHzzW4O88HO8drG9qcx8EKovfgNPMeut0/preL 3FCzsFlWsg7vGO1XaDZhP1CcV8lkQYW5VV8mja8Yf+odS6OlCePmYV0P9s6UaHmmEW7f ziS2asakbEYEYnsvZLuj4tJpGTNJGpKB8WjhZFG8t4r1A9hMqA4oaVQ7Ko6ueU17dW8z SKaBDqcbedh7KSlTBOD4QTvLHGsU3gpdmmTaBb3PaUhQpaE7hpGwgStS9ew5DUu7zjWw EtoA== 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=DQztCj7/CCGbKaKfsGCj2ylvssWy2hoSLtQUB8lGvqA=; b=c1V6yf4ydZYgDshpfzhPPZQUecgqciATTKQdwucPF6FV+NXVSqA5e0oZwr3C2gKWUZ +CjO3Gnsj+Y1uKmxCVR611/xKQhIYPq9bwYUP3xzVixKmSG7BWUP3PPv5Z2wYipk44TZ VKQrkfd5H/hnYvKSp4wvjrhRkhvCaVbrgdNq88YsB71+0TuMyen36nBBZUUULiiuFAwX EuGUdES8iPTxCaPiiR1R4JH7mP+RNpH/0Dm8WPhY565BOsnBQpw4n9pKs3acp8AXOVZC /HnObZbp+T19XXfKudlYnpj5aaa7cTPkbb6QfqDDWzJpeK86PbihPUsfg/+N3pwCE6B7 o3Ag== X-Gm-Message-State: AOAM533kBtKRcH+ovgfHQsUrYL0Jkk1DH7dEiyBiQH6MBQJXO0K9Mcje e8ImDhoVKyJRPnm52qlmjR4= X-Google-Smtp-Source: ABdhPJzLLBPJ4N7FhEZx/e0t1/uMyV5jGKrTQJ5t5039LpTMBPPzh67wbfKPDN5YlpUF01jwpsVe+w== X-Received: by 2002:a05:6602:1848:: with SMTP id d8mr32570ioi.72.1628696202630; Wed, 11 Aug 2021 08:36:42 -0700 (PDT) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id m1sm13261529ilf.24.2021.08.11.08.36.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 08:36:42 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailauth.nyi.internal (Postfix) with ESMTP id 3382527C0054; Wed, 11 Aug 2021 11:36:41 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 11 Aug 2021 11:36:41 -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:40 -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 5/5] PCI: hv: Remove the dependency of pci_config_window Date: Wed, 11 Aug 2021 23:36:19 +0800 Message-Id: <20210811153619.88922-6-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 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The ACPI device information is now correctly set via ->private of pci_host_bridge, therefore no need to use pci_config_window in hv_pcibus_device, so remove it. Note we still need an empty pci_sysdata structure for non-x86, because it's x86-specific. Signed-off-by: Boqun Feng --- drivers/pci/controller/pci-hyperv.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c index fd3792b5edcc..f2b977ef7b84 100644 --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c @@ -448,12 +448,17 @@ enum hv_pcibus_state { hv_pcibus_maximum }; +/* + * Defines a empty struct for non-x86 architecture, this is OK because we only + * use this field as an "anchor" to get back to hv_pcibus_device object on + * non-x86 architecture. + */ +#ifndef CONFIG_X86 +struct pci_sysdata { }; +#endif + struct hv_pcibus_device { -#ifdef CONFIG_X86 struct pci_sysdata sysdata; -#elif defined(CONFIG_ARM64) - struct pci_config_window sysdata; -#endif struct pci_host_bridge *bridge; struct fwnode_handle *fwnode; /* Protocol version negotiated with the host */