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=1796310599; b=uSImZ+B+lJX+TzBshWZQOkQFCVmtzxsENL3JcQ1wS7ORmtI+jBgrJVsZ0lNNcFX1OYiM X7o4/LcmGDxtx+IZTFTtT2e5EMxJa5a98nLbABV+BdCIaZMbsNelYRlVaU+3InTMJUZJa mXC1AdLVt5UY2gJhsfYuVcd7RsjhL8oNzEQo5PUbKsJJws5VkOg1RuVAY+A1caO78nliN R2qHZRsGEakgmQDdXUDgKeTK6onAvXPvjvgwUJLHok33jgitpx7LtI3/9Uv1p6TCQy1Jd UPZ/WdwtrWOxSMqc1PVcuidZ+nCPyVeMakeaNa9REZ5GN0LkwhRVFFizhBhCyB0oBYw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796310599; 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=BiENCRvHotn8esE0MrhEhFHg0QiaRxwhYcGQ3ewbQqY=; b=oNyhJNwDu82GNDKByf8bCH66yZgMPstCt9dLOl/YvowbkvHNSeMLlzEXhvFAXyxOymV4 hQlIygq7T5bBzN5r2qi8r5CAt5seSJd2NvxaIPEicnBvMeNtVCd6weiRi8mn6Jll45V/m 1i2sMnfLmGKbq7fB8Yd3xkyjmAUpREJIbamWB/VFTWw8KepcffTPnoeptnpzybmNNjQoG 1YKPTiaz6A4896Lfbz52ZL6jkDF3PZVWejpIEtaEwX3Izk8fYdqcIXTWwk9HEeix70G+7 SmjzQNVrb2H20BSeWYNfS3u29pohdSftrJUHBszyOpnklt4v+DLb2Ucy/olUxP4pNuw== 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=GFV1JZjh; 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 7A230606A322 for ; Thu, 3 Dec 2026 15:09:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7A230606A322 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=GFV1JZjh Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id DCCCA1A18DE; Thu, 3 Dec 2026 15:09:56 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id A8AB7604ED; Thu, 3 Dec 2026 15:09:56 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 756D311EA1868; Thu, 03 Dec 2026 16:09:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1796310591; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding; bh=BiENCRvHotn8esE0MrhEhFHg0QiaRxwhYcGQ3ewbQqY=; b=GFV1JZjhIFNemZNshTPocox4HwO3szepH8jfP3Mi+baggsmIBcridkn7878qwITH2W2VoV airrQOfzcAqobUHByjL/SXrB0WcZAo3z6XNxTnWj62YZojhTqNsIbzJo7wx5qoiwZdSb4Q kFZyjPxjyJiDnuLu97bWmrTrDpfF8LOqLLOfLrpZfQb9x1igbNH1sPQHuSBmuZvF4Uj52i DDDhmegn32K6rp9H5YEJEiVdandxn3W0kp+UT9Ce9/AH7K7mdUvSiuxu8kPitESrHRrMi7 XXiTqoTSolCf775R02fYQqMRV9EbELJgl0fJW/nrWJ5cZp5hHX1Ex09cuBSYmA== From: Gregory CLEMENT Subject: [PATCH v6 0/5] irqchip: add EyeQ5 PCIe MSI controller Date: Thu, 03 Dec 2026 16:09:44 +0100 Message-Id: <20261203-eyeq5_msi-v6-0-8ffe74494bd2@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/23NzU7EIBQF4FeZsBYD98ItuvI9jDH81cE4RUttn Ez67sK4EFOXJznfORdW4pxiYfeHC5vjmkrKUw10c2D+aKeXyFOomYEAkgIMj+f4oZ9PJXFD1sq g7wQZxWr/fY5j+rpuPT795PLpXqNf2kBrHFNZ8ny+nq2y9f7bXSUX3CtSg4bRaT0+uJyXtzTd+ nxibXmFX1txb6FaZS0GJGEEqb3F3qreYrVgiMYBwQc0e6s6K6m3qtkoAdEJqZzYW91Z0L3V1Q6 AinyQYkD6a7dt+wYjtMWepgEAAA== 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 sixth series addresses the ACK/disable_irq() race reported by Thomas Gleixner. The MSI is now acknowledged from the irq_chip callback under desc->lock instead of clearing GCSR_IRQSTATUS in the chained handler, so a concurrent disable_irq() can no longer clear a status bit that must stay latched. A dedicated race test reproduces the loss on v5 and passes with this change. Grégory Signed-off-by: Gregory CLEMENT --- Changes in v6: - irqchip: address the ACK path review from Thomas Gleixner: - acknowledge from the irq_chip callback under desc->lock instead of write-one-to-clearing GCSR_IRQSTATUS in the chained handler, so a concurrent disable_irq() cannot clear a status bit that must stay latched; - skip the acknowledge while the vector is disabled so the hardware retriggers it on unmask; - drop the bulk acknowledge and only mask and acknowledge unmapped vectors under the controller lock; - cache GCSR_IRQMASK and dispatch from a lockless READ_ONCE() snapshot; - move the per-iteration declarations into the loop scope. - irqchip: delegate the acknowledge to the parent irq_data with MSI_CHIP_FLAG_SET_ACK, so the callback gets the right chip_data/hwirq. - The issue was reproduced with a dedicated MSI race test on EyeQ5 hardware, and the same test passes with this revision. - Link to v5: https://patch.msgid.link/20261125-eyeq5_msi-v5-0-72346cd10736@bootlin.com 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 | 465 +++++++++++++++++++++ 7 files changed, 572 insertions(+) --- base-commit: 08b814ca0a6945b8effc1a0d64999d562f24c923 change-id: 20261028-eyeq5_msi-86aa1d590684 Best regards, -- Grégory CLEMENT, Bootlin Embedded Linux and Kernel engineering https://bootlin.com