How to mapping MSI (LPIs) in Linux kernel 6.12.y ?

Hello everyone,


I am experiencing an issue with dummy device driver(for test) based on kernel-6.12.y

The problem occurs during the call to devm_request_irq()

Issue Description:

The dummy device node in the device tree is configured to use ITS-based MSI (LPI) by setting the msi‑parent property.
The driver calls the upstream API platform_device_msi_init_and_alloc_irqs() to allocate an MSI vector.
I've confirmed that dev->msi.domain is properly set.

patches:

../../cpu.dtsi

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH 0>;
+ its0: msi-controller@17640000 {
+ compatible = "arm,gic-v3-its";
+ msi-controller;
+ #msi-cells = <1>;
+ reg = <0x0 0x17640000 0x0 0x20000>;
+ dma-noncoherent;
+ };
+
...
+ dummy_device: dummy_dev@1a00a0000 {
+ compatible = "dummy,mydev";
+ reg = <0x1 0xa00a0000 0x0 0x1000>;
+ msi-parent = <&its0 0x1>;
+ };
+
...
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

../../driver.c

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
static void dummy_write_msi_msg(struct msi_desc *desc, struct msi_msg *msg)
{
/*
* For this dummy driver, we simply zero them.
*/
msg->address_lo = 0;
msg->address_hi = 0;
msg->data = 0;
}
static irqreturn_t dummy_msi_irq_handler(int irq, void *dev_id)
{
pr_info("hello (MSI LPI)\n");
return IRQ_HANDLED;
}
int dummy_msi_probe(struct platform_device *pdev)
{
struct dummy_dev *dev;
struct resource *res;
int ret;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Kernel log:

Fullscreen
1
2
3
4
5
6
7
8
9
10
$ dmesg | grep ITS
[ 0.000000] ITS [mem 0x17640000-0x1765ffff]
[ 0.000000] GIC: enabling workaround for ITS: non-coherent attribute
[ 0.000000] ITS@0x0000000017640000: allocated 8192 Devices @1a0430000 (indirect, esz 8, psz 64K, shr 0)
[ 0.000000] ITS@0x0000000017640000: allocated 32768 Interrupt Collections @1a0440000 (flat, esz 2, psz 64K, shr 0)
[ 0.000000] ITS: using cache flushing for cmd queue
$ dmesg | grep MSI
[ 2.830015] dummy_msi_dev 1a00a0000.dummy_dev: MSI domain is set!
[ 2.942358] dummy_msi_dev 1a00a0000.dummy_dev: failed to request MSI IRQ 0, ret: -22
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

What I Suspect:

1. Whether the ITS MSI parent configuration and the device tree’s msi‑parent property (e.g., <&its 0x1>) are correctly configured.
2. Issues in the ITS domain initialization process, including the application of the LPI offset and the MSI message composition.

Request for Assistance:

1. Could you provide guidance on the proper usage of the msi‑parent property in the device tree and key points to verify during ITS domain initialization?
2. Are there any additional debugging pointers or recommended solutions to resolve this issue?

For testing purposes, our dummy device driver is assigned a dummy memory region using reserved-memory.

Thank you in advance for your insights and assistance.

0