Can I set up the priority of a workqueue?
I am modifying the SPI kernel module "spidev" so it can communicate faster with my hardware. The external hardware is a CAN controller with a very small buffer, so I must read any incoming data quickly to avoid loosing data. I have configured a GPIO interrupt to inform me of the new data, but I cannot read the SPI hardware in the interrupt handler. My interrupt handler basically sets up a workqueue that will read the SPI data. It works fine when there is only one active process in the kernel. As soon as I open any other process (even the process viewer top) at the same time, I start loosing data in bunches, i.e., I might receive 1000 packects of data with no problems and then loose 15 packets in a row and so on. I suspect that the cause of my problem is that when the other process (top, in this case) has control over the cpu the interrupt handler runs, but the work in the workqueue doesn't until the scheduler is called again. I tried to increase the priority of my process with no success.
I wonder if there is a way to tell the kernel to execute the work in workqueue immediatelly after the interrupt handling function. Suggestions are welcome.