mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Nizette <bn@niasdigital.com>
To: dmitry.torokhov@gmail.com
Cc: tglx@linutronix.de, David Brownell <david-b@pacbell.net>,
	hskinnemoen@atmel.com, kernel@avr32linux.org,
	linux-kernel@vger.kernel.org, imre.deak@nokia.com, mingo@elte.hu,
	Bill Gatliff <bgat@billgatliff.com>,
	Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Subject: [PATCH] ads7846: fix unsafe disable_irq (was [REGRESSION] threaded interrupt handler support breaks (some) irq handling on AVR32)
Date: Thu, 16 Apr 2009 10:41:57 +1000	[thread overview]
Message-ID: <1239842517.29831.47.camel@linux-51e8.site> (raw)
In-Reply-To: <20090415095710.5c853a7f@hskinnemoen-d830>

On Wed, 2009-04-15 at 09:57 +0200, Haavard Skinnemoen wrote:
> Shouldn't that be disable_irq_nosync()?

Indeed, good catch.  That fixes it.

--------------8<--------------------

The use of disable_irq inside the handler for the interrupt being
disabled has always been dangerous.  disable_irq should wait for that
handler to complete before returning -> deadlock.

For some reason this wasn't actually the case until 3aa551c9b was merged
but since this time, the ads7846 driver has deadlocked the system on
first interrupt.

Convert the driver to use the handler-safe _nosync variant.

Signed-off-by: Ben Nizette <bn@niasdigital.com>

---

diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 61b4a02..f2513e6 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -746,7 +746,7 @@ static irqreturn_t ads7846_irq(int irq, void *handle)
 			 * that here.  (The "generic irq" framework may help...)
 			 */
 			ts->irq_disabled = 1;
-			disable_irq(ts->spi->irq);
+			disable_irq_nosync(ts->spi->irq);
 			ts->pending = 1;
 			hrtimer_start(&ts->timer, ktime_set(0, TS_POLL_DELAY),
 					HRTIMER_MODE_REL);



  parent reply	other threads:[~2009-04-16  0:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1239685153.19815.12.camel@linux-51e8.site>
2009-04-14  8:37 ` [REGRESSION] threaded interrupt handler support breaks (some) irq handling on AVR32 Ben Nizette
2009-04-15  1:30   ` Ben Nizette
2009-04-15  7:57     ` Haavard Skinnemoen
2009-04-15  8:33       ` Haavard Skinnemoen
2009-04-15 16:01         ` Bill Gatliff
2009-04-16  8:40           ` Haavard Skinnemoen
2009-04-16 13:25             ` Bill Gatliff
2009-04-16  0:41       ` Ben Nizette [this message]
2009-04-16  1:58         ` [PATCH] ads7846: fix unsafe disable_irq (was [REGRESSION] threaded interrupt handler support breaks (some) irq handling on AVR32) Dmitry Torokhov

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=1239842517.29831.47.camel@linux-51e8.site \
    --to=bn@niasdigital.com \
    --cc=bgat@billgatliff.com \
    --cc=david-b@pacbell.net \
    --cc=dmitry.torokhov@gmail.com \
    --cc=haavard.skinnemoen@atmel.com \
    --cc=hskinnemoen@atmel.com \
    --cc=imre.deak@nokia.com \
    --cc=kernel@avr32linux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome