From patchwork Sat Nov 27 01:22:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 1560543 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=TEH82iHa; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=6MlFc/aH; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4J1DXc4LGgz9sRR for ; Sat, 27 Nov 2021 12:28:48 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350142AbhK0BcA (ORCPT ); Fri, 26 Nov 2021 20:32:00 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:40502 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350311AbhK0B37 (ORCPT ); Fri, 26 Nov 2021 20:29:59 -0500 Message-ID: <20211126230957.239391799@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1637976148; 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=D0nbUkdccTCr+2Br2gyXx7cP8vfnCoeXBZSgMbFqpdM=; b=TEH82iHayKr/ntaPYYfi30q+zCMZHKxasmVUpcMFsUzBAk6YgBm3YBOTFIVC6RffhkF/Tk bwUmRooEMF85FbSUM+o9jdCi6u+6knuAgcavR0gB7dKy2Q/iq3kcQjkIbfjWHKFKnVPbpR xIltg0AIgjG0BjA0HRjgpmSAKa9JAmk5F7FfSZAu0vBKn9KBzWaSNl30AxYaaf+ealQWgk fgufOWF0E0tVfiWFQ7V4bV0rN6KFodraeUo049MRdidrEH7XWB8C/1Z8OhA6+XouFTwtaE WIHKJ533Tz3Fo8jw7nBLGws1Qb94n7NwcnisVd8rgqbYmiwpFesUWoSmTJfj1w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1637976148; 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=D0nbUkdccTCr+2Br2gyXx7cP8vfnCoeXBZSgMbFqpdM=; b=6MlFc/aHe2yyZUJPi9w8j4A1gcK4pI/ykoPIROYyuyct/PJqIaqSJWUIpI3wZ/ETqn93vt Dk5vUE+uTfjirbDg== 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, Greg Kroah-Hartman , linux-s390@vger.kernel.org, Heiko Carstens , Christian Borntraeger , Jon Mason , Dave Jiang , Allen Hubbe , linux-ntb@googlegroups.com Subject: [patch 00/32] genirq/msi, PCI/MSI: Spring cleaning - Part 2 MIME-Version: 1.0 Date: Sat, 27 Nov 2021 02:22:27 +0100 (CET) Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org This is the third part of [PCI]MSI refactoring which aims to provide the ability of expanding MSI-X vectors after enabling MSI-X. The first two parts of this work can be found here: https://lore.kernel.org/r/20211126222700.862407977@linutronix.de https://lore.kernel.org/r/20211126224100.303046749@linutronix.de This third part has the following important changes: 1) Add locking to protect the MSI descriptor storage Right now the MSI descriptor storage (linked list) is not protected by anything under the assumption that the list is installed before use and destroyed after use. As this is about to change there has to be protection 2) A new set of iterators which allow filtering on the state of the descriptors namely whether a descriptor is associated to a Linux interrupt or not. This cleans up a lot of use cases which have to do this filtering manually. 3) A new set of MSI descriptor allocation functions which make the usage sites simpler and confine the storage handling to the core code. Trivial MSI descriptors (non PCI) are now allocated by the core code automatically when the underlying irq domain requests that. 4) Rework of sysfs handling to prepare for dynamic extension of MSI-X The current mechanism which creates the directory and the attributes for all MSI descriptors in one go is obviously not suitable for dynamic extension. The rework splits the directory creation out and lets the MSI interrupt allocation create the per descriptor attributes. 5) Conversion of the MSI descriptor storage to xarray The linked list based storage is suboptimal even without dynamic expansion as it requires full list walks to get to a specific descriptor. With dynamic expansion this gets even more convoluted. Xarray is way more suitable and simplifies the final goal of dynamic expansion of the MSI-X space. This third series is based on: git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git msi-v1-part-2 and also available from git: git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git msi-v1-part-3 For the curious who can't wait for the next part to arrive the full series is available via: git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git msi-v1-part-4 Thanks, tglx --- .clang-format | 1 arch/powerpc/platforms/4xx/hsta_msi.c | 7 arch/powerpc/platforms/cell/axon_msi.c | 7 arch/powerpc/platforms/pasemi/msi.c | 9 arch/powerpc/sysdev/fsl_msi.c | 8 arch/powerpc/sysdev/mpic_u3msi.c | 9 arch/s390/pci/pci_irq.c | 6 arch/x86/pci/xen.c | 14 drivers/base/core.c | 3 drivers/base/platform-msi.c | 110 ----- drivers/bus/fsl-mc/fsl-mc-msi.c | 61 -- drivers/ntb/msi.c | 19 drivers/pci/controller/pci-hyperv.c | 15 drivers/pci/msi/irqdomain.c | 11 drivers/pci/msi/legacy.c | 20 drivers/pci/msi/msi.c | 255 +++++------ drivers/pci/xen-pcifront.c | 2 drivers/soc/ti/ti_sci_inta_msi.c | 77 +-- include/linux/device.h | 4 include/linux/msi.h | 135 +++++- include/linux/soc/ti/ti_sci_inta_msi.h | 1 kernel/irq/msi.c | 719 ++++++++++++++++++++++----------- 22 files changed, 841 insertions(+), 652 deletions(-)