LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 9/9] omap mmc host: Use disable_irq_nosync() from within irq handlers.
@ 2009-04-16  5:55 Ben Nizette
  2009-04-26 19:21 ` Pierre Ossman
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Nizette @ 2009-04-16  5:55 UTC (permalink / raw)
  To: linux-omap; +Cc: pierre, linux-kernel


disable_irq() should wait for all running handlers to complete
before returning.  As such, if it's used to disable an interrupt
from that interrupt's handler it will deadlock.  This replaces
the dangerous instances with the _nosync() variant which doesn't
have this problem.

Signed-off-by: Ben Nizette <bn@niasdigital.com>
---
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index 5570849..d5ea652 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -824,7 +824,7 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
 		del_timer(&host->cmd_abort_timer);
 		host->abort = 1;
 		OMAP_MMC_WRITE(host, IE, 0);
-		disable_irq(host->irq);
+		disable_irq_nosync(host->irq);
 		schedule_work(&host->cmd_abort_work);
 		return IRQ_HANDLED;
 	}
-- 
1.6.0.2




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 9/9] omap mmc host: Use disable_irq_nosync() from within irq handlers.
  2009-04-16  5:55 [PATCH 9/9] omap mmc host: Use disable_irq_nosync() from within irq handlers Ben Nizette
@ 2009-04-26 19:21 ` Pierre Ossman
  2009-05-14 17:22   ` Tony Lindgren
  0 siblings, 1 reply; 4+ messages in thread
From: Pierre Ossman @ 2009-04-26 19:21 UTC (permalink / raw)
  To: Carlos Aguiar, Anderson Briglia, Syed Mohammed, Khasim
  Cc: Ben Nizette, linux-omap, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1227 bytes --]

Should I queue this up or do you want to do something differently for
this?

On Thu, 16 Apr 2009 15:55:21 +1000
Ben Nizette <bn@niasdigital.com> wrote:

> 
> disable_irq() should wait for all running handlers to complete
> before returning.  As such, if it's used to disable an interrupt
> from that interrupt's handler it will deadlock.  This replaces
> the dangerous instances with the _nosync() variant which doesn't
> have this problem.
> 
> Signed-off-by: Ben Nizette <bn@niasdigital.com>
> ---
> diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
> index 5570849..d5ea652 100644
> --- a/drivers/mmc/host/omap.c
> +++ b/drivers/mmc/host/omap.c
> @@ -824,7 +824,7 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
>  		del_timer(&host->cmd_abort_timer);
>  		host->abort = 1;
>  		OMAP_MMC_WRITE(host, IE, 0);
> -		disable_irq(host->irq);
> +		disable_irq_nosync(host->irq);
>  		schedule_work(&host->cmd_abort_work);
>  		return IRQ_HANDLED;
>  	}


-- 
     -- Pierre Ossman

  WARNING: This correspondence is being monitored by the
  Swedish government. Make sure your server uses encryption
  for SMTP traffic and consider using PGP for end-to-end
  encryption.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 9/9] omap mmc host: Use disable_irq_nosync() from within irq handlers.
  2009-04-26 19:21 ` Pierre Ossman
@ 2009-05-14 17:22   ` Tony Lindgren
  2009-05-22 12:00     ` Pierre Ossman
  0 siblings, 1 reply; 4+ messages in thread
From: Tony Lindgren @ 2009-05-14 17:22 UTC (permalink / raw)
  To: Pierre Ossman
  Cc: Carlos Aguiar, Anderson Briglia, Syed Mohammed, Khasim,
	Ben Nizette, linux-omap, linux-kernel

* Pierre Ossman <pierre@ossman.eu> [090426 12:22]:
> Should I queue this up or do you want to do something differently for
> this?

Looks like a valid fix to me.

Acked-by: Tony Lindgren <tony@atomide.com>
 
> On Thu, 16 Apr 2009 15:55:21 +1000
> Ben Nizette <bn@niasdigital.com> wrote:
> 
> > 
> > disable_irq() should wait for all running handlers to complete
> > before returning.  As such, if it's used to disable an interrupt
> > from that interrupt's handler it will deadlock.  This replaces
> > the dangerous instances with the _nosync() variant which doesn't
> > have this problem.
> > 
> > Signed-off-by: Ben Nizette <bn@niasdigital.com>
> > ---
> > diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
> > index 5570849..d5ea652 100644
> > --- a/drivers/mmc/host/omap.c
> > +++ b/drivers/mmc/host/omap.c
> > @@ -824,7 +824,7 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
> >  		del_timer(&host->cmd_abort_timer);
> >  		host->abort = 1;
> >  		OMAP_MMC_WRITE(host, IE, 0);
> > -		disable_irq(host->irq);
> > +		disable_irq_nosync(host->irq);
> >  		schedule_work(&host->cmd_abort_work);
> >  		return IRQ_HANDLED;
> >  	}
> 
> 
> -- 
>      -- Pierre Ossman
> 
>   WARNING: This correspondence is being monitored by the
>   Swedish government. Make sure your server uses encryption
>   for SMTP traffic and consider using PGP for end-to-end
>   encryption.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 9/9] omap mmc host: Use disable_irq_nosync() from within irq handlers.
  2009-05-14 17:22   ` Tony Lindgren
@ 2009-05-22 12:00     ` Pierre Ossman
  0 siblings, 0 replies; 4+ messages in thread
From: Pierre Ossman @ 2009-05-22 12:00 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Carlos Aguiar, Anderson Briglia, Syed Mohammed, Khasim,
	Ben Nizette, linux-omap, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 547 bytes --]

On Thu, 14 May 2009 10:22:26 -0700
Tony Lindgren <tony@atomide.com> wrote:

> * Pierre Ossman <pierre@ossman.eu> [090426 12:22]:
> > Should I queue this up or do you want to do something differently for
> > this?
> 
> Looks like a valid fix to me.
> 
> Acked-by: Tony Lindgren <tony@atomide.com>
>  

Applied.

-- 
     -- Pierre Ossman

  WARNING: This correspondence is being monitored by the
  Swedish government. Make sure your server uses encryption
  for SMTP traffic and consider using PGP for end-to-end
  encryption.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-05-22 12:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-16  5:55 [PATCH 9/9] omap mmc host: Use disable_irq_nosync() from within irq handlers Ben Nizette
2009-04-26 19:21 ` Pierre Ossman
2009-05-14 17:22   ` Tony Lindgren
2009-05-22 12:00     ` Pierre Ossman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).