From patchwork Wed Jun 9 16:32:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 12310785 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.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 0C881C48BCD for ; Wed, 9 Jun 2021 17:20:53 +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 BDD1B61376 for ; Wed, 9 Jun 2021 17:20:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BDD1B61376 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=cVRqX/LcDrpYO7Ln8+XtmJp/QeLp/xf6jmKEJTH8fmM=; b=AxsHHrg6oesNCN Ue7tX2Pf7o16Bdt48zWqnwcAuRE29EXu12tkwgduexuOGRG3/QNCSbFR3O87TMUZGCiSUSVCQdTin cmK9pT16i6SJ3nkX5e5TA5VTxhrDOhvX11wDcpo70Xf3NdO4Vr1GO7FWqk/bGgYsuQJeCknZmDz8R BMjSG5BSf0fsoRJ0ANEOe+asQY242Pb/i+PSk0AyKq0lwLBleIjToYOSVWBIJ+cC/hoBqBDH2wFd6 gNG6ycrdNH9O+5CvlTpmKjz2PaBXVbRXoTYE5rVZia0cHqJpGmrREgIqJl3u7A/VjVP45KvvkWtdT 5PerJeFMwh+2QQdLwNlQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lr1qK-00FFhP-Bt; Wed, 09 Jun 2021 17:18:17 +0000 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lr17w-00Ex2B-BC for linux-arm-kernel@lists.infradead.org; Wed, 09 Jun 2021 16:32:25 +0000 Received: by mail-io1-xd35.google.com with SMTP id k22so23427555ioa.9 for ; Wed, 09 Jun 2021 09:32:22 -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=h6/SeYfOWSphhPUzzUCOjWtJORlKfdGfIiP9ztyD/8s=; b=VzXVi+aP/kh7qxv56RdgMxAYCmt5nnDhOgudMEpuUcIKcvzShAfp01wYRDjMjsLmqy xMmx+fFZbLUFtlfq+iN+jQ6JFFjX04Qk8w6HR9VE5VV3M4kbZc+7za+Xoo5H03lkkTB9 blGt9ZzjHe4h1jMsU4wWYoVNgcdS9eJvh6qsHcX/9nmw7G7bNWr/uHe3m5uaJbB0Tg/H E5IrYL3OJ8VQyo7rsUqZcqIAfEwOAJgxwY3lHIiB6ari5063pTmWT56WJAjRdPUgNFrz odriMPk0pPLdW1r0HzGZ+Evxa4R/tQkWlXPebuWowEzMBsADddrNYEsFc4VMjN3jkEEr kutg== 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=h6/SeYfOWSphhPUzzUCOjWtJORlKfdGfIiP9ztyD/8s=; b=XyTjtLVueipKbjGhIrMpuCLkUeidDt9AlWBJkbpdqc7AucSr0uL5VV+cNhQjyZK2UN 1+ytidtCaj8fxKc/5INCSy6Hdq3/d6igTbB5Ly0JMKPMdNkHq3JoBbcorwjBbAGuD+zK pCmxj1aQel3/t5U2c1Ls3A61qkYqlBcNOhDK2LrUTX04A6Ykt6pH/D8eBkU7f+ioYI03 lHoDSoQJwsNeSPl/6Ph5xdUkME0WMuBGjY6glfuOga+djc+injUuX5vzX2hxD0JXYaUm 8k7E4soYTdcvfCYzfZjlKMxQi0ineZJ9rdGA/9bce2pqLWDSyc3xa4Ho67GCctOCEqja tHbw== X-Gm-Message-State: AOAM530ru7Z88tS4vwrJwSAldd0FhvWAHZgIBBwhO9ICyVeFxq2ZM4y3 +xrewTGh5OuiexOUkgT4PIE= X-Google-Smtp-Source: ABdhPJxTGsMwJckSOcHPUfZkQMSOylbN7ZjTcunLm5nQTVNYS9kSiq81BVkc6A3EWg7CyKw7qvnZ4A== X-Received: by 2002:a5e:860f:: with SMTP id z15mr227163ioj.193.1623256341541; Wed, 09 Jun 2021 09:32:21 -0700 (PDT) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id j18sm251468ila.29.2021.06.09.09.32.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jun 2021 09:32:21 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailauth.nyi.internal (Postfix) with ESMTP id 2A12327C005C; Wed, 9 Jun 2021 12:32:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 09 Jun 2021 12:32:20 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeduuddguddtvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepuehoqhhu nhcuhfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrg htthgvrhhnpeehvdevteefgfeiudettdefvedvvdelkeejueffffelgeeuhffhjeetkeei ueeuleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gsohhquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdei gedqudejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfih igmhgvrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 9 Jun 2021 12:32:19 -0400 (EDT) From: Boqun Feng To: Bjorn Helgaas , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org Cc: Catalin Marinas , Will Deacon , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Lorenzo Pieralisi , Rob Herring , Clint Sbisa , Boqun Feng , Ard Biesheuvel , Sunil Muthuswamy , Arnd Bergmann Subject: [RFC v3 2/7] PCI: Allow msi domain set-up at host probing time Date: Thu, 10 Jun 2021 00:32:06 +0800 Message-Id: <20210609163211.3467449-3-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_093224_421583_ACD2B251 X-CRM114-Status: GOOD ( 14.27 ) 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 For GENERIC_MSI_IRQ_DOMAIN drivers, we can set up the msi domain via dev_set_msi_domain() at probing time, and drivers can use this more generic way to set up the msi domain for the host bridge. This is the preparation for ARM64 Hyper-V PCI support. Originally-by: Arnd Bergmann Signed-off-by: Boqun Feng --- drivers/pci/probe.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index d2753097a1b0..38bee41dedcc 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -829,11 +829,14 @@ static struct irq_domain *pci_host_bridge_msi_domain(struct pci_bus *bus) { struct irq_domain *d; + /* Default set by host bridge driver */ + d = dev_get_msi_domain(bus->bridge); /* * Any firmware interface that can resolve the msi_domain * should be called from here. */ - d = pci_host_bridge_of_msi_domain(bus); + if (!d) + d = pci_host_bridge_of_msi_domain(bus); if (!d) d = pci_host_bridge_acpi_msi_domain(bus);