10-24-2014 04:52 AM
It appears UIO limits to 2 maximum "unread" interrupts.
The interrupt counter (cat /proc/interrupt) stops counting after the 2nd interrupt fired without being read. My interrupts are configured as edge trigger and there is no need to clear any flags.
This doesn’t seem to add up for me, perhaps someone could advise?
10-24-2014 06:51 AM
Are you using the uio_pdrv_genirq driver (using generic-uio as the compatible property on your device in the device tree)?
The interrupt handling and that counting has not been crystal clear to me in my UIO work and I never went deeper to completely understand it. So this is more of a conversation for both of us to understand it better.
63 static irqreturn_t uio_pdrv_genirq_handler(int irq, struct uio_info *dev_info)
65 struct uio_pdrv_genirq_platdata *priv = dev_info->priv;
67 /* Just disable the interrupt in the interrupt controller, and
68 * remember the state so we can allow user space to enable it later.
72 if (!__test_and_set_bit(UIO_IRQ_DISABLED, &priv->flags))
76 return IRQ_HANDLED;
You can see that it disables the interrupt at the interrupt controller level until user space re-enables it by writing to the file.
186 /* This driver requires no hardware specific kernel code to handle
187 * interrupts. Instead, the interrupt handler simply disables the
188 * interrupt in the interrupt controller. User space is responsible
189 * for performing hardware specific acknowledge and re-enabling of
190 * the interrupt in the interrupt controller.
192 * Interrupt sharing is not supported.
I have sort of viewed it as this method with no kernel module is the easy path, but if you want complete control over things then a small kernel driver together with user space (the original UIO design before the variations of it) allows you to have more interrrupt control over the device, but others may have different thoughts.
11-04-2014 12:08 PM