From patchwork Mon Jul 26 18:06:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 12400505 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=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 1FAE5C4338F for ; Mon, 26 Jul 2021 18:11:01 +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 DB15D60F23 for ; Mon, 26 Jul 2021 18:11:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DB15D60F23 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=JBDgmSpFS7IwOm/OdPSgz/O6khicMxgLRwmw+XJ/Jac=; b=WT92TRoHkVWyxG GdISEF6EvAKPDXtn3CqAkQu3qSzu+zGidtG0VkWcCP/C79vO9tGOgdCyUTPwZCPCU4+TKjPqdst7Q w6DURQvNFRERoKsQOEZUzyjc/A8wnFVEINxEQGtFI9LAqj3vPmkFy6HNVgOjIWKCF1VTr3G2JzTXC WFI+gIIqnRsiqvZ5kmu4XWkJPwlYsEcwPC1B9nlvIdos1mSj/zY5KFqO8l7Ik2U5KQR+48jTlX7D/ 0gTZ/7xS3SqjVV3R55yXVUsgbJP+mGHALk0h/EhPjQ2qe7W+m1FL35ZsSQ3DGSGhTosCxp4UAeXme xgzHiKh5vuXS7GqJgbqw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m852Q-00CCLE-3B; Mon, 26 Jul 2021 18:09:14 +0000 Received: from mail-io1-xd32.google.com ([2607:f8b0:4864:20::d32]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m850k-00CBqD-El for linux-arm-kernel@lists.infradead.org; Mon, 26 Jul 2021 18:07:31 +0000 Received: by mail-io1-xd32.google.com with SMTP id y9so13039847iox.2 for ; Mon, 26 Jul 2021 11:07:30 -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=BKnYIljYr328ZulqWfxspol6sVJsE3IO6EjcczLUtpo=; b=pX7rlM6GUHNhhHEyiZzWNV2XqI30x9vSAqXrtHl2nHY8pbp7dMsW7WWjyBC1J7b63A /SrFGJFS2td9+cgI8G4TmejkeXXdj8UZ8Tp0eR0yoB9ctMBG1iAXFJjMvI8PEktB+EHA edvZR0kkAI1JJU4Wb//FkNzGzg3HV9RjHhNvVGgSbGJLHZ31KYZZ1FU71bPu7GLid24k kW3CvwXLLmq8QK5PC+6qGnXSiXjWYOWQz8fbkTMAPG7GzRR78+wfLaYT4r1kDyuHxqe8 GBvJQK5A3Ffa1MMP75v4s/+OYV061ni+hjc+Pc/bTGrnG1dpU1h2ZxCGTCny2GTZKqVp vZTw== 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=BKnYIljYr328ZulqWfxspol6sVJsE3IO6EjcczLUtpo=; b=HC54Zn1czNQTnV+o5HLsU3+Y7/Y1SwtyM8fH8r5qKmb9lW3L4qYb+dX5QN+epXWS+W lTlkxixdKrusRUVCrLxie7wwouHBF/RRvAR9KAuuOJkyL5vMWYnGiP7qFE2l8gcpiiNd FLjiaOw7dASk5UJ/cFC9592Feh2V4havxKCAq8h3qE3xJyaRfodmmCfNX81dSBBj9pBL CYc+4XXG7DYv1XmIe71xvwHht39I90/Lht4Gkq6xpjl3SudXQTTy/x+fGaEf6Ud5BtrD h821pooG59Xd/pGXMxyZXuL/nfWzlizhtHMksiRbhw0kocbkhdUjaKKU05Y7TNtA71Ke JvYQ== X-Gm-Message-State: AOAM532L/SehxfBGXlmamCEWsLAJKMHD0ANU+t/nll/5C2PsFkwNjcxV rE/vXn3Utskl3TNL7XNxUmk= X-Google-Smtp-Source: ABdhPJyGwT6K4xCYTa1+mA3eODO7pnAlMAube8Sg+6Ainm9/jy9B1/ByuhGCqg19qPiV7LnvSxWg9Q== X-Received: by 2002:a02:9648:: with SMTP id c66mr18075440jai.73.1627322849866; Mon, 26 Jul 2021 11:07:29 -0700 (PDT) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com. [66.111.4.227]) by smtp.gmail.com with ESMTPSA id v10sm304163iox.35.2021.07.26.11.07.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jul 2021 11:07:29 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id 70B3627C0068; Mon, 26 Jul 2021 14:07:28 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 26 Jul 2021 14:07:28 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrgeehgdduudekucetufdoteggodetrfdotf 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:27 -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 6/8] PCI: hv: Set ->domain_nr of pci_host_bridge at probing time Date: Tue, 27 Jul 2021 02:06:55 +0800 Message-Id: <20210726180657.142727-7-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210726_110730_549761_AC1F3623 X-CRM114-Status: GOOD ( 14.06 ) 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 ->domain_nr of pci_host_bridge. Note that we still need to keep the copy of domain number in x86-specific pci_sysdata, because x86 is not a PCI_DOMAINS_GENERIC=y architecture, so the ->domain_nr of pci_host_bridge doesn't work for it yet. 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;