From patchwork Wed Jul 14 10:27:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 12376665 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 DE08DC07E9A for ; Wed, 14 Jul 2021 10:34:12 +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 A725161178 for ; Wed, 14 Jul 2021 10:34:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A725161178 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=EM091p7r/dhBAm/FGg3x1KC54ZBRVRvkcTLQ212gkNQ=; b=ZbORH8ivrfXUTs z/otPbjbFd/qdGr9X3v4MStMcXtlCxTcjxMPM+UtGzsfDwKndd2Op2klXNadppQr+x6JD5//zhQP5 L0FFMoKNvvI/eQyU0VlvfjyUCJbsUR03CRG08+GEAaaib6q1XOTZ9Ob6XHXVpxAU2CPbA2yUHtjSw s/GjwP1EPdC6rU8dCj7E+gLH2JwzRR1g/WcGjDLuvvWTLP8T39Qhbi9sCouOZMGA5gNGghQb4+th6 trvYMiYW1l6c+LgI6Yiln91Wh/y+nhq/hsAmYm5FGa1f/62ZcvH5K3+CcoWvxx97q1gZjTA22XzNu 0CaU91lCDa1W3QdoZWAQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3cAy-00D9Zp-Bc; Wed, 14 Jul 2021 10:31:37 +0000 Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3c93-00D8qb-Hr for linux-arm-kernel@lists.infradead.org; Wed, 14 Jul 2021 10:29:43 +0000 Received: by mail-qt1-x82b.google.com with SMTP id g8so1504964qtj.1 for ; Wed, 14 Jul 2021 03:29: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=whrqx7S/6ArEqBZa1UoQwNLZIIZFAIXLGfuEnNJo6+E=; b=GWCio3dmCWMxhi0Hlb6ME6Vnx1TNNM4BffNZVN464KPAkLW7GVAOqEdHG1qhct5fbE cF2LiZQf0bIoQ56Zd0ut46zjF2jvEnJAAhwV0SjVVmZHc/pxhoMO7uXSOAj+ltoK32uw bZq85a4CCnOuKRbq2QZRIk0rrvF+Ah7mLRgdx5GPz8FFkbMBPJ9o6Mabe/dsN36hhxGG QmjuwWIzMKdMcAPXumFv6a0XI5mv28W9W+Tu+HXJxeaW3zXXyrFHip/lGJ6cdGvtiTv1 sREOPUCxdyL/uY7hVEgMxKzN73+UQ12XwAwXddTY04BYgsZ2e3vq33iZiswYsmZkwa1o jcgg== 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=whrqx7S/6ArEqBZa1UoQwNLZIIZFAIXLGfuEnNJo6+E=; b=R1Ge+Y588Qc5xjpi1fEFJQT61fHVFs7ZQ2c2lweg0YmYpA69czQ/eUDxebTq4rABCa lJxWjR0A61Zg4Xe/VChm+fZeX31gL7J2AwAXAX2zuVWdz+gJJtYqrLYJx6yQzaw3cLdG hZUa+zYyqOwRBbrT2xgFZi4P91iy8JRqsqJ9CY29T2tJPLED2Gogzl577kHitI03MoSw ck8s+TcW/e9OTmJ8mXI8ySpyqH8/VxfEm63pHNSvaHtQeVW/CyGeiz5kkS7ulsvcEsN3 Ah+P2Z+7MopiXor0g68hyD9yBGGxfGUvSA0uYOJTma5IMHLM9X9/bxMoqWU81xifAIK/ JnJw== X-Gm-Message-State: AOAM531aavHyDb2kPGCQQE2hIVwWTIWCQIht2tknhQqh1IxwEOnRvTnP 7VpbkemfTfKjqLHojKJ4oRI= X-Google-Smtp-Source: ABdhPJwlf04xGZajypUy8gTnChPsSNYLZwPxkvXTnSa2OFm2z8oRT063aRVBIcD6a3Tmd47utX/qkA== X-Received: by 2002:ac8:7d04:: with SMTP id g4mr8855257qtb.384.1626258576433; Wed, 14 Jul 2021 03:29:36 -0700 (PDT) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id h10sm822245qka.83.2021.07.14.03.29.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jul 2021 03:29:35 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id 1D69327C005B; Wed, 14 Jul 2021 06:29:35 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 14 Jul 2021 06:29:35 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudekgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtth gvrhhnpeehvdevteefgfeiudettdefvedvvdelkeejueffffelgeeuhffhjeetkeeiueeu leenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpegsoh hquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdeigedq udejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfihigmh gvrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 14 Jul 2021 06:29:34 -0400 (EDT) From: Boqun Feng To: Bjorn Helgaas , Arnd Bergmann , Marc Zyngier Cc: Catalin Marinas , Will Deacon , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Lorenzo Pieralisi , 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: [RFC v4 5/7] PCI: hv: Use pci_host_bridge::domain_nr for PCI domain Date: Wed, 14 Jul 2021 18:27:35 +0800 Message-Id: <20210714102737.198432-6-boqun.feng@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210714102737.198432-1-boqun.feng@gmail.com> References: <20210714102737.198432-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-20210714_032937_659337_EF1DE567 X-CRM114-Status: GOOD ( 12.53 ) 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 No functional change, just store and maintain the PCI domain number in the generic pci_host_bridge instead of x86 specific pci_sysdata. Signed-off-by: Boqun Feng --- drivers/pci/controller/pci-hyperv.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c index 8d42da5dd1d4..5741b1dd3c14 100644 --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c @@ -2299,7 +2299,7 @@ static void hv_eject_device_work(struct work_struct *work) * because hbus->bridge->bus may not exist yet. */ wslot = wslot_to_devfn(hpdev->desc.win_slot.slot); - pdev = pci_get_domain_bus_and_slot(hbus->sysdata.domain, 0, wslot); + pdev = pci_get_domain_bus_and_slot(hbus->bridge->domain_nr, 0, wslot); if (pdev) { pci_lock_rescan_remove(); pci_stop_and_remove_bus_device(pdev); @@ -3071,6 +3071,7 @@ static int hv_pci_probe(struct hv_device *hdev, "PCI dom# 0x%hx has collision, using 0x%hx", dom_req, dom); + hbus->bridge->domain_nr = dom; hbus->sysdata.domain = dom; hbus->hdev = hdev; @@ -3080,7 +3081,7 @@ static int hv_pci_probe(struct hv_device *hdev, spin_lock_init(&hbus->device_list_lock); spin_lock_init(&hbus->retarget_msi_interrupt_lock); hbus->wq = alloc_ordered_workqueue("hv_pci_%x", 0, - hbus->sysdata.domain); + hbus->bridge->domain_nr); if (!hbus->wq) { ret = -ENOMEM; goto free_dom; @@ -3207,7 +3208,7 @@ static int hv_pci_probe(struct hv_device *hdev, destroy_wq: destroy_workqueue(hbus->wq); free_dom: - hv_put_dom_num(hbus->sysdata.domain); + hv_put_dom_num(hbus->bridge->domain_nr); free_bus: kfree(hbus); return ret; @@ -3315,7 +3316,7 @@ static int hv_pci_remove(struct hv_device *hdev) irq_domain_remove(hbus->irq_domain); irq_domain_free_fwnode(hbus->sysdata.fwnode); - hv_put_dom_num(hbus->sysdata.domain); + hv_put_dom_num(hbus->bridge->domain_nr); kfree(hbus); return ret;