Re: [PATCH] spi: davinci: use request_threaded_irq() to fix deadlock

From: Grant Likely
Date: Tue Feb 05 2013 - 13:16:43 EST


On Wed, 2 Jan 2013 10:19:08 -0500, Murali Karicheri <m-karicheri2@xxxxxx> wrote:
> On 12/22/2012 05:08 AM, Grant Likely wrote:
> > On Fri, 21 Dec 2012 15:13:26 -0500, Murali Karicheri<m-karicheri2@xxxxxx> wrote:
> >> With RT pre-empt patch applied to Linux kernel, the irq handler will be
> >> force converted to an irq thread. spi driver can get back to back messages
> >> from the slave device. In such cases, IRQ thread doesn't get a chance to
> >> run to read the slave data. Hence the irq handler must be run in hard irq
> >> context to read/write data from slave device. Otherwise, the kernel goes
> >> into a deadlock. This patch fixes this issue when PREEMPT_RT_FULL is
> >> enabled in the kernel. A dummy thread function is provided to satisfy the
> >> request_threaded_irq() API. Passing a NULL for function also causes the
> >> irq handler to be executed in the thread context.
> >>
> >> Signed-off-by: Murali Karicheri<m-karicheri2@xxxxxx>
> > Thomas, would you mind taking a look at this for me. My gut feel is that
> > this is the wrong way to solve the problem that Murali is having and
> > that it really just hacks something that works.
> Grant,
>
> Thanks for reviewing this. As per the RT patch, all of the IRQ handlers
> will be converted to thread by brute force. This breaks the SPI driver
> since the data is overwritten with back to back irq as thread is not
> getting a chance to read the word before next irq happens. What my
> patch does is to keep the functionality as before by using a new irq
> API. So though this is not the best solution, this solves the problem
> and give an opportunity for improvement by splitting this into two part
> to handle the irq. But I am not convinced if this is really needed.

Okay. Applied, thanks.

g.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/