From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.246.84.56 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795634840; b=YCJnOM+EVs/bbLFoILl7VTKYohplpKMXhHzZFJH71WWz8cQ+5X2QVa+3RhnjFs1ZQD/U I4pzY/uk70UAXfa5deau3sldRAaeLFNkDj5tFiK4MX7WwprAvao93omKyyB4++pzAsq5t v8X+V1yr3p+46b3ThZJPS4HNZ7FD+QcWBajC2Dw3ovu58AoeXXgvNBb1EH95JJUBRKYDI jw6NYJDEZ/88Hg4PgCVpxeCfC4eqc1tjKASpWy8hNtkfV9cXv5CU8pdXbhhuzqakTG4av 6vks5EMaHfBL3h3eMb6YyN0tqqBPq0PsaxBYRfqlxR+1OpKIiL5wnZvrp/tAf8lMd/Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795634840; h=DMARC-Filter:Received:Received:Received:DKIM-Signature:From:Subject: Date:Message-Id:MIME-Version:Content-Type:Content-Transfer-Encoding: X-B4-Tracking:X-Change-ID:To:Cc:X-Mailer:X-Last-TLS-Session-Version; bh=j74I7LI9opuntHVLbuDLFrvkTz2zr3CrChXSgc2w0Ks=; b=wfKqEGGJDidr67mOgTFDRBJ2g7gf4H4pMHmIK97MgyfvA2qE9cyVHUrfLudeYzNark+/ iZS1Q6OSVlQCxbA0ddkWS3VJNdy+Q/FiMqFT3AQY9xU7HllenbwZrwNWXMBvG6K8wojcR JETvJ22KZbvptIRiTkLVXO0wWh/oVdZmLQa67rMyPeP+tcleGu2goy5642VVjJH5gr0Lk 4oojxLS3flxRJ4CWtDITQCPCLtyYS+E8PS03467Z8wdk7P03yn/uSn09phC8PWuTSwfIA cSJLuMcltuBaNDi5km3DBRs1dSsGG+7hh2fTlm9n4ZAqO6B15sSa7QdMxDKzJw79zLQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=lm7gs1Ub; arc=none smtp.remote-ip=185.246.84.56 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2463C606A332; Wed, 25 Nov 2026 19:27:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2463C606A332 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=lm7gs1Ub Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 8FFB01A17F3; Wed, 25 Nov 2026 19:27:18 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 55D4860480; Wed, 25 Nov 2026 19:27:18 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 35C0611E6938B; Wed, 25 Nov 2026 20:27:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1795634832; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding; bh=j74I7LI9opuntHVLbuDLFrvkTz2zr3CrChXSgc2w0Ks=; b=lm7gs1UbdlUEuHY8PLsUpYZfej4EaA9yROgBK+IEmNidxr2zuHZ1BvLhnuK+ulfy+XhzM8 SOWwfTB+LZLZn1xa4SqiBDhrU+7LIZOiHoRhCMGvArb1GyBHcyxBYTP/38dGEswbirKBbx 1fN+j9yEdFwmknTRPCwg6U3K6+fOCjO/C/E5Fx2XvCClOtGldEs5fE7N3Ot0sHOiuHeQx2 3+OHChwt5be0gp5qRIR0iUOBwcdwOUn3qBXfoarzzHvYXoFvj1MZjmPcTjtlDmEYsmgR9+ 0z4bbyni0gmu+XaMjQ+9D+4OkpMt3defPJsPlJGmrXbQnppnn5M5EG43FFO9tQ== From: Gregory CLEMENT Subject: [PATCH v5 0/5] irqchip: add EyeQ5 PCIe MSI controller Date: Wed, 25 Nov 2026 20:27:07 +0100 Message-Id: <20261125-eyeq5_msi-v5-0-72346cd10736@bootlin.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/23NwU4EIRAE0F/ZcBYDTdOLnvwPYwwwPS7GHXQYJ 2428+/CehCzHiupV3UWhefERdzvzmLmNZWUpxrszU7Eg59eWKahZgEKSCtwkk/8YZ+PJUlH3uv B3ilyKGr/feYxfV22Hp9+cvkMrxyXNtAah1SWPJ8uZ6tuvf92Vy2VjEi4tzAGa8eHkPPylqbbm I+iLa/wayvuLVSL3pvBkHKK8Nqa3mJvTbXgiMa9gTgYd22xs5p6i82yBmOC0hjUX7tt2zdf+5M nagEAAA== X-Change-ID: 20261028-eyeq5_msi-86aa1d590684 To: Vladimir Kondratiev , =?utf-8?q?Beno=C3=AEt_Monin?= , =?utf-8?q?Th=C3=A9o_Lebrun?= , Thomas Gleixner , Radu Rendec , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thomas Bogendoerfer Cc: Thomas Petazzoni , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Gregory CLEMENT X-Mailer: b4 0.16.0 X-Last-TLS-Session-Version: TLSv1.3 Hello, This series adds support for the MSI controller present in the Mobileye EyeQ5 PCIe ports. Although the driver uses the standard MSI library, the EyeQ5 hardware has several specific features. First, each PCIe port has its own MSI controller, which snoops the MSI write TLPs that the port receives. A port supports a maximum of 4 MSI vectors, and the memory-region property gives the base address of the doorbell window. In addition, the GCSR mode selects the role: in root complex mode the driver registers a PCI MSI parent, while in endpoint mode it registers a platform MSI parent. The last specific point is that the driver uses the snooper domain as a chained controller on one GIC interrupt. The series adds the binding document, the irqchip driver, the EyeQ5 DTS changes, and the MAINTAINERS entry. In particular, the DTS changes add the two MSI controllers to the EyeQ5 SoC. I tested the series on two EyeQ5 SoCs that have a PCIe link. One SoC acted as the host and the other SoC acted as the endpoint. The pci_endpoint_test kselftest passed the MSI-X and DOORBELL_TEST cases. The MSI test uses one vector because the controller does not support standard Multi-MSI. An additional test made sure that each MSI-X vector uses its target CPU (using affinity). This fifth series fixes the issues pointed out by Sashiko. I also ran a Sashiko-like tool, which pointed out three more potential issues that I fixed too. I hope that with this extra step, there are no more corner cases to fix. As a side note, I am still a little annoyed by having to add an empty function as an irq_ack callback. I saw that a few other drivers do the same. Could we do better? First, I was thinking of adding a flag so that in handle_edge_irq() we would not try to use the callback if the flag is set. The drawback is adding an extra test; I do not know if it is really sensible here. At least we could provide this empty function in kernel/irq/chip.c, so each driver could use it instead of declaring its own empty function. These are just suggestions and they do not affect the current series. Grégory Signed-off-by: Gregory CLEMENT --- Changes in v5: - irqchip: fix the MSI loss. Mask the vector on disable_irq() with IRQ_DISABLE_UNLAZY so the MSI stays pending in GCSR_IRQSTATUS until enable_irq(). (sashiko) - irqchip: filter GCSR_IRQSTATUS with GCSR_IRQMASK in eyeq_msi_isr() so a masked vector is not dispatched when a sibling fires. (sashiko) - irqchip: clear GCSR_IRQSTATUS on vector alloc and free, so a reused vector does not deliver a stale MSI to its new owner. - irqchip: program the hardware before creating the IRQ domain, so no vector can be allocated before the hardware is ready. - irqchip: bound the ISR loop, so a device that keeps setting a vector cannot hang a CPU. - Link to v4: https://patch.msgid.link/20261116-eyeq5_msi-v4-0-2e1233b014b0@bootlin.com Changes in v4: - irqchip: use a plain raw_spinlock() in the mask/unmask callbacks, which run with interrupts disabled. - irqchip: use guard_chained_irq() to balance the chained handler on every return path. - irqchip: simplify the domain alloc/free callbacks now that nr_irqs is always 1. - irqchip: reformat the MSI flag macros and use a distinct "EYEQ-P-" prefix for the platform MSI parent. - MIPS: move the EYEQ5_MSI selection into a separate MIPS patch, out of the irqchip driver patch. - Link to v3: https://patch.msgid.link/20261104-eyeq5_msi-v3-0-2866f732cd38@bootlin.com Changes in v3: - Address review comments from sashiko. - dt-bindings: drop the interrupt-controller, #interrupt-cells and label properties. - irqchip: use handle_edge_irq() with an ack callback instead of handle_simple_irq(), so a vector is masked while disabled and a second MSI is not lost while the first is in progress. For this one, I ran some tests to confirm that the issue was real (it was) and that the fix resolves it. - irqchip: convert to a platform driver because the node is no longer an interrupt controller and is no longer probed by of_irq_init(). - irqchip: stop parsing the label property and use the node full name in the boot message. - MIPS: dts: update the MSI nodes according to the binding changes. - Link to v2: https://patch.msgid.link/20261102-eyeq5_msi-v2-0-4aa3d3608064@bootlin.com Changes in v2: - Address review comments from Krzysztof Kozlowski, Thomas Gleixner and sashiko. - dt-bindings: drop the num-vectors property (all ports have four vectors) and simplify the example. - irqchip: use the fixed four-vector count, add lockdep assertions, and dispatch through generic_handle_demux_domain_irq() with a redirect-based irq_set_affinity() callback. - irqchip: drop MSI_FLAG_MULTI_PCI_MSI (standard Multi-MSI cannot work with the address-based vector decoding) and MSI_FLAG_NO_AFFINITY; add MSI_FLAG_PCI_MSI_MASK_PARENT. - irqchip: keep vectors masked during allocation, mask all vectors and clear pending status before installing the chained handler, and reject of_irq_get() returning 0. - MIPS: dts: drop the num-vectors property from both MSI nodes. - Reformat the driver for the 100-column limit. - Link to v1: https://patch.msgid.link/20261028-eyeq5_msi-v1-0-c464752fb55f@bootlin.com To: Vladimir Kondratiev To: Benoît Monin To: Gregory CLEMENT To: Théo Lebrun To: Thomas Gleixner To: Radu Rendec To: Rob Herring To: Krzysztof Kozlowski To: Conor Dooley To: Thomas Bogendoerfer Cc: Thomas Petazzoni Cc: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: devicetree@vger.kernel.org --- Gregory CLEMENT (5): dt-bindings: interrupt-controller: add Mobileye EyeQ5 PCIe MSI controller irqchip: irq-eyeq5-msi: add EyeQ5 PCIe MSI controller driver MIPS: eyeq: select the EyeQ5 MSI controller MIPS: dts: eyeq5: add MSI controllers MAINTAINERS: add EyeQ5 MSI controller entry .../interrupt-controller/mobileye,eyeq5-msi.yaml | 76 ++++ MAINTAINERS | 2 + arch/mips/Kconfig | 1 + arch/mips/boot/dts/mobileye/eyeq5.dtsi | 22 + drivers/irqchip/Kconfig | 5 + drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-eyeq5-msi.c | 475 +++++++++++++++++++++ 7 files changed, 582 insertions(+) --- base-commit: 08b814ca0a6945b8effc1a0d64999d562f24c923 change-id: 20261028-eyeq5_msi-86aa1d590684 Best regards, -- Grégory CLEMENT, Bootlin Embedded Linux and Kernel engineering https://bootlin.com