UIO device no longer opens when an interrupt is added

551 Views Asked by At

Linux version: v4.19
Platform: Xilinx Ultrascale+ Zynq

In the Xilinx programmable logic I've created a memory mapped device. I'm using uio_pdrv_genirq as my device driver. The device shows up as uio0 and I'm able to read and write to it without any issues.

Up until now I have not had an interrupt associated with this device. As my design matures, I'm wanting to add an interrupt to the device. So I've created the appropriate logic, connected the interrupt to the CPU, and updated the device tree configuration to tell Linux about the interrupt's existence. I've checked thoroughly and I'm quite certain that I am specifying the correct interrupt ID in the device tree.

However as soon as I specify the interrupt, I start having problems. My user space program hangs when I try to open the device. I've verified with printf():s that I'm no longer exiting this function.

fid = open("/dev/uio0", O_RDWR | O_SYNC);

Clearly this has something to do with the interrupt. Perhaps there is some additional device tree configuration of the interrupt controller that I'm missing? Or something I have to do in user space before opening the device?

Here is the device tree configuration for my device and the interrupt controller:

my_device@a0040000 {
    compatible = "generic-uio";
    reg = <0x0 0xa0040000 0x0 0x40000>;
    interrupt-parent = <&gic>;
    interrupts = <0 89 4>;
};

gic: interrupt-controller@f9010000 {
    compatible = "arm,gic-400", "arm,cortex-a15-gic";
    #interrupt-cells = <3>;
    reg = <0x0 0xf9010000 0x10000>,
          <0x0 0xf9020000 0x20000>,
          <0x0 0xf9040000 0x20000>,
          <0x0 0xf9060000 0x20000>;
    interrupt-controller;
    interrupt-parent = <&gic>;
    interrupts = <1 9 0xf04>;
};
0

There are 0 best solutions below