From patchwork Fri Dec 10 22:18:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 12695725 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 59AF3C433F5 for ; Fri, 10 Dec 2021 22:23:59 +0000 (UTC) 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:Date:MIME-Version:Subject:Cc:To:From: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=pxuN9jioB7B5e5+4x4KGe7qX39C49LmAE0Nn+5yZ7Ro=; b=ZDCUC3BEzXC1nv z3ZZVgMCRHMEA5AaCh9NHgbS7WcWJUyosejDL0wIAa+vh4XfZOEk21w+9SiKE1jcvx6eoCYtgGeUh 4LV0KpqmOmN+VOSgRWvkvMdZKFrWyOcBd13cPM/ILBEPcFrkJDvKNr8tA8ea619O77ckCK9189AlO x+CrvTpm/wMpgey/wklGvQq7lzoeTzvYG3ihwn/3/XjzeCOnNnXUi3Lq+IpfrZU7ubUofkHwSMVGs OmdMP1NW3paA9blg/2A0ZceKgVLjciECDO5GWUldSHoYAEYKVmBCIyN8lwNcbWXahJPaNfxkYoPDW K/ti1juTVyCfnjF4nhxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvoHT-0040lz-5Y; Fri, 10 Dec 2021 22:22:19 +0000 Received: from galois.linutronix.de ([2a0a:51c0:0:12e:550::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvoE6-003z1b-Kc for linux-arm-kernel@lists.infradead.org; Fri, 10 Dec 2021 22:18:54 +0000 Message-ID: <20211210221642.869015045@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1639174723; 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: content-transfer-encoding:content-transfer-encoding; bh=IBbfy8DUMmeX2/DxJ4bxtqprC0vLuk1jWkG3suZ0PZw=; b=qC+ywncigd88uX881G7drnWnPitC8LQEDjIxWICRbmx1CnZuuhH2HOM78Mj73Xd+ZCv0Kb ncvkjbnzAtbd+ixrpTmp/mZ4pThJranbywfqMLopOdcOEGpsPc6uk3V8xaldwObLZfsa/F EQ9V2dZmFKR1bqfNssiazFt8n3Mf+7q1vPMaTRADEfAyYuxcvDch8l/qTyx/UZYaRnEdfG 107k2ftTZl52fiKXc5XfVwoW5s/CdJw8zCMdv0ss6LKqyYgeRXX/LiA2+XXHlrLhd7JdKS +inOsrufS8ZmeqDmP1k3/yTr0mCeJApmaMV52ZYaBfM4TpXhGFC+GjjHRExr/A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1639174723; 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: content-transfer-encoding:content-transfer-encoding; bh=IBbfy8DUMmeX2/DxJ4bxtqprC0vLuk1jWkG3suZ0PZw=; b=5lxdmWfE59j3yHf4IXX2tpXuGGPaN2BKbOiQcB9ippOtvBNy75YsOs7y6x5FiIbDSi4ZaA +C6w+xOR5nRMXFBA== From: Thomas Gleixner To: LKML Cc: Bjorn Helgaas , Marc Zygnier , Alex Williamson , Kevin Tian , Jason Gunthorpe , Megha Dey , Ashok Raj , linux-pci@vger.kernel.org, Cedric Le Goater , Juergen Gross , xen-devel@lists.xenproject.org, Arnd Bergmann , Michael Ellerman , Benjamin Herrenschmidt , linuxppc-dev@lists.ozlabs.org, Greg Kroah-Hartman , Bjorn Helgaas , Stuart Yoder , Laurentiu Tudor , Nishanth Menon , Tero Kristo , Santosh Shilimkar , linux-arm-kernel@lists.infradead.org, Vinod Koul , dmaengine@vger.kernel.org, Mark Rutland , Will Deacon , Robin Murphy , Joerg Roedel , iommu@lists.linux-foundation.org, Jassi Brar , Peter Ujfalusi , Sinan Kaya Subject: [patch V3 00/35] genirq/msi, PCI/MSI: Spring cleaning - Part 2 MIME-Version: 1.0 Date: Fri, 10 Dec 2021 23:18:43 +0100 (CET) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211210_141851_005568_A49C5BF2 X-CRM114-Status: GOOD ( 15.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 This is the second part of [PCI]MSI refactoring which aims to provide the ability of expanding MSI-X vectors after enabling MSI-X. This is based on the first part of this work which can be found here: https://lore.kernel.org/r/20211206210147.872865823@linutronix.de and has been applied to: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/msi This second part has the following important changes: 1) Cleanup of the MSI related data in struct device struct device contains at the moment various MSI related parts. Some of them (the irq domain pointer) cannot be moved out, but the rest can be allocated on first use. This is in preparation of adding more per device MSI data later on. 2) Consolidation of sysfs handling As a first step this moves the sysfs pointer from struct msi_desc into the new per device MSI data structure where it belongs. Later changes will cleanup this code further, but that's not possible at this point. 3) Use PCI device properties instead of looking up MSI descriptors and analysing their data. 4) Provide a function to retrieve the Linux interrupt number for a given MSI index similar to pci_irq_vector() and cleanup all open coded variants. It's also available from git: git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git msi-v3-part-2 Part 3 of this effort is available on top git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git msi-v3-part-3 Part 3 is not going to be reposted as there is no change vs. V2. V2 of part 2 can be found here: https://lore.kernel.org/r/20211206210307.625116253@linutronix.de Changes versus V2: - Use PCI device properties instead of creating a new set - Jason - Picked up Reviewed/Tested/Acked-by tags as appropriate Thanks, tglx Tested-by: Nishanth Menon Tested-by: Nishanth Menon Tested-by: Michael Kelley --- arch/powerpc/platforms/cell/axon_msi.c | 5 arch/powerpc/platforms/pseries/msi.c | 38 +--- arch/x86/kernel/apic/msi.c | 5 arch/x86/pci/xen.c | 11 - drivers/base/platform-msi.c | 152 ++++++++----------- drivers/bus/fsl-mc/dprc-driver.c | 8 - drivers/bus/fsl-mc/fsl-mc-allocator.c | 9 - drivers/bus/fsl-mc/fsl-mc-msi.c | 26 +-- drivers/dma/mv_xor_v2.c | 16 -- drivers/dma/qcom/hidma.c | 44 ++--- drivers/dma/ti/k3-udma-private.c | 6 drivers/dma/ti/k3-udma.c | 14 - drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 23 -- drivers/irqchip/irq-mbigen.c | 4 drivers/irqchip/irq-mvebu-icu.c | 12 - drivers/irqchip/irq-ti-sci-inta.c | 2 drivers/mailbox/bcm-flexrm-mailbox.c | 9 - drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 4 drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c | 4 drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 5 drivers/pci/msi/irqdomain.c | 20 ++ drivers/pci/msi/legacy.c | 6 drivers/pci/msi/msi.c | 133 ++++++---------- drivers/pci/xen-pcifront.c | 2 drivers/perf/arm_smmuv3_pmu.c | 5 drivers/soc/fsl/dpio/dpio-driver.c | 8 - drivers/soc/ti/k3-ringacc.c | 6 drivers/soc/ti/ti_sci_inta_msi.c | 22 -- drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c | 4 include/linux/device.h | 25 ++- include/linux/fsl/mc.h | 4 include/linux/msi.h | 95 ++++-------- include/linux/pci.h | 1 include/linux/soc/ti/ti_sci_inta_msi.h | 1 kernel/irq/msi.c | 158 +++++++++++++++----- 35 files changed, 429 insertions(+), 458 deletions(-)