From mboxrd@z Thu Jan 1 00:00:00 1970 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=-14.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 86E4DC4338F for ; Tue, 27 Jul 2021 16:16:27 +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 54AA461B5F for ; Tue, 27 Jul 2021 16:16:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 54AA461B5F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:In-Reply-To:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=5dtMrPXTqQ2F9fQFC5WrNNJBuI5MPqZjg9gbqvNGaWs=; b=KPa6Z7UcdQojUw 7yQjeO0FJuSL6FysdMWziRbxKGaNNJ4oqWqPKnXZoVlNmjSuSdoynqTLGtazE/vsFWUiV+kxYF442 ocD2PFZHiOW0lg6+jJaeXtsEHGUIELEpyHVvV67bXanTL5tKZvS3eoFMawfNkeVIsjUUF6yLUzDt9 RHgL7OmJ2w63J/g9KRFrBjHUGevzmaRNfwLoUIMdvM56enk+NWpYoU14uTixoMjO05ln8OWEMc+UA ZwqfkK0duhxykua72/ejatHpS0ONlahZeYudvX83XASqRO2iwj1iKY/5zCvNXwC5CFY8eqE0jYwuz 7TDXJhLYLSM4FQeMMsyw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m8Pj6-00FKkb-Pm; Tue, 27 Jul 2021 16:14:41 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m8Piz-00FKir-Dq for linux-arm-kernel@lists.infradead.org; Tue, 27 Jul 2021 16:14:35 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id CC4E661B7C; Tue, 27 Jul 2021 16:14:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627402473; bh=QtgOoB9l9cTt54Ke4pcqbiOYoSYZ30ZDlwTKxMdh9Bk=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=WsMICcmPMJy6ahbt4KsB7HzhNmWBjuOD49tW3sLQ7zYca6ihf+3Wp7hktwgcWEz2X thbQLoSKabk4c9MoD5A4S+YePzfIgdEPNzCDekr6EmOOlE7DhFMNH7XYtTqq5+J5j0 Ex9Ut0AAJvdLmYmRmND/VYktwF5cjXsfqarzi+AHifVa7O7Fn0Wj2K02Ej1iAFEiYR SLwj9iOgsq4BazOb3J23e+whmvKjrPR4aVywvVyySSKbRn3rEohI9ncLYrhNzYT2x1 tJYLn2xlEugdiWg9DqsJWhVxBKRllp/zC1XykcU1ThRw6UroY5z9re/tStBB5XUydx CiOq/V459Nnpg== Date: Tue, 27 Jul 2021 11:14:31 -0500 From: Bjorn Helgaas To: Boqun Feng Cc: Bjorn Helgaas , Arnd Bergmann , Marc Zyngier , Lorenzo Pieralisi , Catalin Marinas , Will Deacon , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Rob Herring , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , 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: Re: [PATCH v6 2/8] PCI: Support populating MSI domains of root buses via bridges Message-ID: <20210727161431.GA718548@bjorn-Precision-5520> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210726180657.142727-3-boqun.feng@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210727_091433_547162_F99A1983 X-CRM114-Status: GOOD ( 24.67 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jul 27, 2021 at 02:06:51AM +0800, Boqun Feng wrote: > Currently, at probing time, the MSI domains of root buses are populated > if either the information of MSI domain is available from firmware (DT > or ACPI), or arch-specific sysdata is used to pass the fwnode of the MSI > domain. These two conditions don't cover all, e.g. Hyper-V virtual PCI > on ARM64, which doesn't have the MSI information in the firmware and > couldn't use arch-specific sysdata because running on an architecture > with PCI_DOMAINS_GENERIC=y. > > To support populating MSI domains of the root buses at the probing when > neither of the above condition is true, the ->msi_domain of the > corresponding bridge device is used: in pci_host_bridge_msi_domain(), > which should return the MSI domain of the root bus, the ->msi_domain of > the corresponding bridge is fetched first as a potential value of the > MSI domain of the root bus. > > In order to use the approach to populate MSI domains, the driver needs > to dev_set_msi_domain() on the bridge before calling > pci_register_host_bridge(), and makes sure GENERIC_MSI_IRQ_DOMAIN=y. > > Another advantage of this new approach is providing an arch-independent > way to populate MSI domains, which allows sharing the driver code as > much as possible between architectures. > > Originally-by: Arnd Bergmann > Signed-off-by: Boqun Feng Acked-by: Bjorn Helgaas > --- > drivers/pci/probe.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c > index 60c50d4f156f..ea7f2a57e2f5 100644 > --- a/drivers/pci/probe.c > +++ b/drivers/pci/probe.c > @@ -829,11 +829,15 @@ static struct irq_domain *pci_host_bridge_msi_domain(struct pci_bus *bus) > { > struct irq_domain *d; > > + /* If the host bridge driver sets a MSI domain of the bridge, use it */ > + 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); > > -- > 2.32.0 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel