Skip to contentSkip to conversation

mmc: toshsd: Fix unbalanced locking

PATCH In review Axel Lin 2 participants 2 messages Dec 11, 2014 – Dec 19, 2014 MMC, SD and SDIO

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 mmc: toshsd: Fix unbalanced locking

Fix returning IRQ_HANDLED with spin_lock held.

---
 drivers/mmc/host/toshsd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/host/toshsd.c +3 -1
index 4666262..a5aa539 100644
@@ -176,7 +176,8 @@ static irqreturn_t toshsd_thread_irq(int irq, void *dev_id)
 	spin_lock_irqsave(&host->lock, flags);
 
 	if (!sg_miter_next(sg_miter))
-		return IRQ_HANDLED;
+		goto done;
+
 	buf = sg_miter->addr;
 
 	/* Ensure we dont read more than one block. The chip will interrupt us
@@ -198,6 +199,7 @@ static irqreturn_t toshsd_thread_irq(int irq, void *dev_id)
 	sg_miter->consumed = count;
 	sg_miter_stop(sg_miter);
 
+done:
 	spin_unlock_irqrestore(&host->lock, flags);
 
 	return IRQ_HANDLED;
Signature · 1 line
1.9.1
#1 lore raw
Quoted 3 lines · Axel Lin

Fix returning IRQ_HANDLED with spin_lock held.

Thanks! Queued for 3.20.

Kind regards
Uffe

Quoted 31 lines
---
 drivers/mmc/host/toshsd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/host/toshsd.c +3 -2
index 4666262..a5aa539 100644
@@ -176,7 +176,8 @@ static irqreturn_t toshsd_thread_irq(int irq, void *dev_id)
        spin_lock_irqsave(&host->lock, flags);
 
        if (!sg_miter_next(sg_miter))
-               return IRQ_HANDLED;
+               goto done;
+
        buf = sg_miter->addr;
 
        /* Ensure we dont read more than one block. The chip will interrupt us
@@ -198,6 +199,7 @@ static irqreturn_t toshsd_thread_irq(int irq, void *dev_id)
        sg_miter->consumed = count;
        sg_miter_stop(sg_miter);
 
+done:
        spin_unlock_irqrestore(&host->lock, flags);
 
        return IRQ_HANDLED;
--

1.9.1