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
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>; + }; + ... reserved_memory: reserved-memory { #address-cells = <2>; #size-cells = <2>; ranges; ... + dummy_region { + reg = <0x1 0xa00a0000 0x0 0x1000>; + no-map; + status = "okay"; + };
../../driver.c
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; dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); if (!dev) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { dev_err(&pdev->dev, "failed to get memory resource\n"); return -ENODEV; } dev->base = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(dev->base)) return PTR_ERR(dev->base); if (!pdev->dev.msi.domain) { dev_err(&pdev->dev, "MSI domain is not set; please check the msi-parent property in DT\n"); return -ENODEV; } ret = platform_device_msi_init_and_alloc_irqs(&pdev->dev, 1, dummy_write_msi_msg); if (ret < 0) { dev_err(&pdev->dev, "failed to allocate MSI IRQs: %d\n", ret); return ret; } dev->msi_irq = ret; ret = devm_request_irq(&pdev->dev, dev->msi_irq, dummy_msi_irq_handler, 0, DRIVER_NAME, dev); if (ret) { dev_err(&pdev->dev, "failed to request MSI IRQ %d, ret: %d\n", dev->msi_irq, ret); return ret; } ... platform_set_drvdata(pdev, dev); dev_info(&pdev->dev, "Dummy MSI device probed, allocated MSI IRQ %d\n", dev->msi_irq); return 0; } ...
Kernel log:
$ 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
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.