Re: 2.6.24-git: kmap_atomic() WARN_ON()

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Thomas Gleixner <tglx@...>
Cc: Jeff Garzik <jgarzik@...>, LKML <linux-kernel@...>
Date: Monday, February 25, 2008 - 3:59 pm

On 2008.02.07 00:58:42 +0100, Thomas Gleixner wrote:

Hm, do you have lockdep enabled? If not, does lockdep make this go away?
Because lockdep will set IRQF_DISABLED for all interrupt handlers, and
unless that flag is set, handle_IRQ_event will reenable interrupts while
the handler is running. And ahci_interrupt only uses a plain spin_lock,
so interrupts keep being enabled. The patch below should help with that.

Hmhm, maybe that also solves the deadlock you saw? Dunno...

I can't come up with an useful commit message right now, but I'll resend
in suitable form for submission if that thing actually works.

Björn


diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 1db93b6..ae3dbc8 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1739,6 +1739,7 @@ static irqreturn_t ahci_interrupt(int irq, void *dev_instance)
 	unsigned int i, handled = 0;
 	void __iomem *mmio;
 	u32 irq_stat, irq_ack = 0;
+	unsigned long flags;
 
 	VPRINTK("ENTER\n");
 
@@ -1751,7 +1752,7 @@ static irqreturn_t ahci_interrupt(int irq, void *dev_instance)
 	if (!irq_stat)
 		return IRQ_NONE;
 
-	spin_lock(&host->lock);
+	spin_lock_irqsave(&host->lock, flags);
 
 	for (i = 0; i < host->n_ports; i++) {
 		struct ata_port *ap;
@@ -1778,7 +1779,7 @@ static irqreturn_t ahci_interrupt(int irq, void *dev_instance)
 		handled = 1;
 	}
 
-	spin_unlock(&host->lock);
+	spin_unlock_irqrestore(&host->lock, flags);
 
 	VPRINTK("EXIT\n");
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.24-git: kmap_atomic() WARN_ON(), Thomas Gleixner, (Wed Feb 6, 7:58 pm)
Re: 2.6.24-git: kmap_atomic() WARN_ON(), Björn, (Mon Feb 25, 3:59 pm)
Re: 2.6.24-git: kmap_atomic() WARN_ON(), Jeff Garzik, (Mon Feb 25, 4:08 pm)
Re: 2.6.24-git: kmap_atomic() WARN_ON(), Andrew Morton, (Mon Feb 25, 4:40 pm)
Re: 2.6.24-git: kmap_atomic() WARN_ON(), Thomas Gleixner, (Mon Feb 25, 6:01 pm)
Re: 2.6.24-git: kmap_atomic() WARN_ON(), Jeff Garzik, (Mon Feb 25, 7:19 pm)
Re: 2.6.24-git: kmap_atomic() WARN_ON(), Thomas Gleixner, (Tue Feb 26, 4:50 am)
Re: 2.6.24-git: kmap_atomic() WARN_ON(), Ingo Molnar, (Tue Feb 26, 4:39 am)
Re: 2.6.24-git: kmap_atomic() WARN_ON(), Jeff Garzik, (Tue Feb 26, 12:32 pm)
Re: 2.6.24-git: kmap_atomic() WARN_ON(), Andrew Morton, (Tue Feb 26, 2:19 pm)
Re: 2.6.24-git: kmap_atomic() WARN_ON(), Ingo Molnar, (Tue Feb 26, 4:49 pm)
Re: 2.6.24-git: kmap_atomic() WARN_ON(), Nick Piggin, (Tue Feb 26, 7:49 pm)
Re: 2.6.24-git: kmap_atomic() WARN_ON(), Andrew Morton, (Tue Feb 26, 5:37 pm)
Re: 2.6.24-git: kmap_atomic() WARN_ON(), Jeff Garzik, (Tue Feb 26, 6:59 pm)
Re: 2.6.24-git: kmap_atomic() WARN_ON(), Alan Cox, (Tue Feb 26, 8:02 pm)
Re: 2.6.24-git: kmap_atomic() WARN_ON(), Andrew Morton, (Mon Feb 25, 6:17 pm)
Re: 2.6.24-git: kmap_atomic() WARN_ON(), Björn, (Mon Feb 25, 4:35 pm)
Re: 2.6.24-git: kmap_atomic() WARN_ON(), Rafael J. Wysocki, (Wed Feb 13, 6:39 pm)
Re: 2.6.24-git: kmap_atomic() WARN_ON(), Thomas Gleixner, (Wed Feb 13, 9:13 pm)