From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: Murali Karicheri <m-karicheri2-l0cyMroinI0@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Thomas Gleixner <tglx-ypw0egVD2fIeQtMskbmMgg@public.gmane.org>
Subject: Re: [PATCH] spi: davinci: use request_threaded_irq() to fix deadlock
Date: Tue, 05 Feb 2013 17:13:33 +0000 [thread overview]
Message-ID: <20130205171333.B4D483E0D17@localhost> (raw)
In-Reply-To: <50E44FEC.3080009-l0cyMroinI0@public.gmane.org>
On Wed, 2 Jan 2013 10:19:08 -0500, Murali Karicheri <m-karicheri2-l0cyMroinI0@public.gmane.org> wrote:
> On 12/22/2012 05:08 AM, Grant Likely wrote:
> > On Fri, 21 Dec 2012 15:13:26 -0500, Murali Karicheri<m-karicheri2-l0cyMroinI0@public.gmane.org> 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-l0cyMroinI0@public.gmane.org>
> > 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.
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
WARNING: multiple messages have this Message-ID (diff)
From: Grant Likely <grant.likely@secretlab.ca>
To: Murali Karicheri <m-karicheri2@ti.com>
Cc: spi-devel-general@lists.sourceforge.net,
davinci-linux-open-source@linux.davincidsp.com,
Thomas Gleixner <tglx@linuronix.de>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] spi: davinci: use request_threaded_irq() to fix deadlock
Date: Tue, 05 Feb 2013 17:13:33 +0000 [thread overview]
Message-ID: <20130205171333.B4D483E0D17@localhost> (raw)
In-Reply-To: <50E44FEC.3080009@ti.com>
On Wed, 2 Jan 2013 10:19:08 -0500, Murali Karicheri <m-karicheri2@ti.com> wrote:
> On 12/22/2012 05:08 AM, Grant Likely wrote:
> > On Fri, 21 Dec 2012 15:13:26 -0500, Murali Karicheri<m-karicheri2@ti.com> 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@ti.com>
> > 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.
next prev parent reply other threads:[~2013-02-05 17:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-21 20:13 [PATCH] spi: davinci: use request_threaded_irq() to fix deadlock Murali Karicheri
[not found] ` <1356120806-27964-1-git-send-email-m-karicheri2-l0cyMroinI0@public.gmane.org>
2012-12-22 10:08 ` Grant Likely
2012-12-22 10:08 ` Grant Likely
2013-01-02 15:19 ` Murali Karicheri
[not found] ` <50E44FEC.3080009-l0cyMroinI0@public.gmane.org>
2013-02-05 17:13 ` Grant Likely [this message]
2013-02-05 17:13 ` Grant Likely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130205171333.B4D483E0D17@localhost \
--to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
--cc=davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=m-karicheri2-l0cyMroinI0@public.gmane.org \
--cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=tglx-ypw0egVD2fIeQtMskbmMgg@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.