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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5C49C43217 for ; Thu, 17 Nov 2022 08:46:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234756AbiKQIqT (ORCPT ); Thu, 17 Nov 2022 03:46:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239673AbiKQIqB (ORCPT ); Thu, 17 Nov 2022 03:46:01 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31EC3BFE; Thu, 17 Nov 2022 00:45:55 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668674753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=u1qaKDnyy/v30VRyUA4NSH5qeXvkkd40FRaF+9lRfrQ=; b=h6YVokPX8fb70te11kTLevM9/Tboh3oKuMtJJqjfaSfvridZtz9knm1PMY7gwzFZeQ3wR0 InixWku56XJk+RjRgkJErnPN390sPFUT8m6hzoLo/iWyR0L6+MMxpg9Bct7Hy8EMwiM8tT X9ABf4vnMDaieCcGsTz77TKOfFzyspa74HP6w0GZ/zQgReOg6wgr+/NgAHX2aJ3yJCSE7J GlzcTOcM+zrDJs0vFcyyvxBI+Vz8hSwgMBn7DKy5uff7GKO4LEehKJfDsACVdDykyfbhMM zHg6Lyp15oyGx4VNVB56XLqtYmP3vZk1wzpzAkS0ltNMGOXEUiA1lnq7/sAFAg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668674753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=u1qaKDnyy/v30VRyUA4NSH5qeXvkkd40FRaF+9lRfrQ=; b=t+QHIk0r5usoqiFoP1tk+PBrdg5zeTk4fanz2TZTeBvICzwCPm2sx3NsyBFjsFhU0n1N5c xfO8A/jSVfLn6JCg== To: Jason Gunthorpe Cc: LKML , x86@kernel.org, Joerg Roedel , Will Deacon , linux-pci@vger.kernel.org, Bjorn Helgaas , Lorenzo Pieralisi , Marc Zyngier , Greg Kroah-Hartman , Dave Jiang , Alex Williamson , Kevin Tian , Dan Williams , Logan Gunthorpe , Ashok Raj , Jon Mason , Allen Hubbe , "Ahmed S. Darwish" , Reinette Chatre Subject: Re: [patch 12/33] PCI/MSI: Add support for per device MSI[X] domains In-Reply-To: References: <20221111133158.196269823@linutronix.de> <20221111135205.951710169@linutronix.de> <87tu2yo77n.ffs@tglx> Date: Thu, 17 Nov 2022 09:45:53 +0100 Message-ID: <87wn7um0ji.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 16 2022 at 20:22, Jason Gunthorpe wrote: > On Wed, Nov 16, 2022 at 11:38:52PM +0100, Thomas Gleixner wrote: > >> >> +bool pci_setup_msi_device_domain(struct pci_dev *pdev) >> >> +{ >> >> + if (WARN_ON_ONCE(pdev->msix_enabled)) >> >> + return false; >> >> + >> >> + if (pci_match_device_domain(pdev, DOMAIN_BUS_PCI_DEVICE_MSI)) >> >> + return true; >> >> + if (pci_match_device_domain(pdev, DOMAIN_BUS_PCI_DEVICE_MSIX)) >> >> + msi_remove_device_irq_domain(&pdev->dev, MSI_DEFAULT_DOMAIN); >> >> + >> >> + return pci_create_device_domain(pdev, &pci_msi_template, 1); >> > >> > Hardwired to one 1? What about multi-msi? >> >> MSI has exactly ONE descriptor whether it's single or multi-MSI. >> >> Multi-MSI can have several interrupts hanging off the same descriptor, >> but that's not how MSI looks at it because you write ONE message and the >> hardware does the substitution of the low bits depending on which vector >> is raised. > > Okay, that is very clear, maybe this in a comment right here ? Sure.