I found tsc2007 driver and modified according to our needs. Our firm is producing its own TI DM365 board. In this board we used TSC2007 and connected PENIRQ pin to GPIO0 of
Thanks for the former two answers, in my case it was enough to disable the preemption:
preempt_disable(); // Your code with locks and schedule() preempt_enable();