From patchwork Wed Jul 14 10:27:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 12376641 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 C358FC07E9A for ; Wed, 14 Jul 2021 10:31:58 +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 926CE6024A for ; Wed, 14 Jul 2021 10:31:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 926CE6024A 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=7zTMeqJzcZIMIke8nrStvTKOhTgD+zQXp8O6KDROv+o=; b=NoET2wAcH4Jnx2 Ef4bKloKDmqgsO4Ty+SWvAp4ETzMbNz3i0Qh94EvREK4THNy30DHLWPSJH/jU8gJQo5bdb3Gg5kp3 viyMAEyOG3qT4KDxA1El1V0Ot1WpEnS7u9zT0yK0xfBS623EBIMXEzcs/D85Awr1TDk0BEiJruxO7 Uv6itNlQgt+8cSeQdgoCSY6DIEB3tTPFoGYzBp/Kz0b/uc8h2op5TDRnPiOL+j/5UJ2dLGPVl4SS/ Uba5MnQNF71QueQ2nWTLP2mYA6J1SR4idC4XXG3V1hAdw1VCw/u7BaUbNoMHZEkmTGNuSOn1RgpsT b9nenbW7C/0MK+OMprqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3c9d-00D91d-MK; Wed, 14 Jul 2021 10:30:13 +0000 Received: from mail-qv1-xf29.google.com ([2607:f8b0:4864:20::f29]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3c8z-00D8or-E8 for linux-arm-kernel@lists.infradead.org; Wed, 14 Jul 2021 10:29:42 +0000 Received: by mail-qv1-xf29.google.com with SMTP id f3so748310qvm.2 for ; Wed, 14 Jul 2021 03:29:33 -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=AJUjK4/VFCQ/TP7J5j1RckVIjIlpsxzAZdtnL2G5Q9I=; b=nn0xpgZ2PBdAWYP+fMz5Wj1N11ZjtmR0VJ7ChNKx1A44qRNj03WxfjzYwdlKXoZUiv C+z8b7XusSAbzRz7ju2rDpWPOeDuVjXLp9i0LKGxoaHn4MfTu6oEF1WVZAnvlomiR2n9 s/g4O5UenB8hxTvfv8pzeMsVD4SL4VecLlERF3XQlEsZrvFFdjde+oPlRXgS40RDQUgi wgNEuBYVY2+NjLtLTtSOZ67D2n8Gky50RcMFQPV1CyYbyydRww3BsLMX6uaQqwMn/n7Y 5djxwhCjLoxBwhMeiNW2Jn7kla4dpX/122DPLfwWqMrL+Y/rrm35Y0Rj4XY8gnVLnoqU 0BUA== 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=AJUjK4/VFCQ/TP7J5j1RckVIjIlpsxzAZdtnL2G5Q9I=; b=HSVvukdN1Um+IzmQ8pF+OqUXDLv+nZzeEYIeJi28vxRMdTk+A7cNqiamvSA6GOoPrB YYPSsGEhp0se/nkw6RwdGfNszg4uB3erhQB0SSwb08sk9pBHKEOPRSC5j32aHwBQEZT0 G2EsnP3gyB9eoH+6NaOxuhj5ZyD5ltvypuCJs9ngV3ouMJKJuuaMD88MQ6G1GusD0aTL QXA5lxR/MHfddz+xzqzSKeqx7msQNulslZB7kw9bgMc1SP62HNC7K6mP94+UPvsnDdYt qL/rNsMfIM4RvFKNyCmiRTBQZa7JFfdjSr4KPj2QcmthVr2STalqnhj8PYGzKwOHbtRZ HdNA== X-Gm-Message-State: AOAM53383bUrro9+VhLUDxIQ+kU4138d+sWcXkUxgbVLzs8zCDBVyW+T k0Xh6lDPnl0w1NBN54M+ujc= X-Google-Smtp-Source: ABdhPJzm+7agwprpp/QPPMKRTn9v3zu1l7XQ0J59ezVzkrjj6cvdedKqticWumi2f9eJbC7pXdiPTg== X-Received: by 2002:a0c:d68f:: with SMTP id k15mr9971850qvi.14.1626258572392; Wed, 14 Jul 2021 03:29:32 -0700 (PDT) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id n64sm819743qkd.79.2021.07.14.03.29.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jul 2021 03:29:32 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id 2148B27C005A; Wed, 14 Jul 2021 06:29:31 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 14 Jul 2021 06:29:31 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudekgddvkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtth gvrhhnpeehvdevteefgfeiudettdefvedvvdelkeejueffffelgeeuhffhjeetkeeiueeu leenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsoh hquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdeigedq udejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfihigmh gvrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 14 Jul 2021 06:29:30 -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 2/7] PCI: Allow msi domain set-up at host probing time Date: Wed, 14 Jul 2021 18:27:32 +0800 Message-Id: <20210714102737.198432-3-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_032933_521325_9664885D X-CRM114-Status: GOOD ( 14.77 ) 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 60c50d4f156f..539b5139e376 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);