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: 12671077 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 A5389C4167D for ; Fri, 10 Dec 2021 22:19:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344665AbhLJWWb (ORCPT ); Fri, 10 Dec 2021 17:22:31 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:49616 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344667AbhLJWWV (ORCPT ); Fri, 10 Dec 2021 17:22:21 -0500 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) Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.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(-)