]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.6.2/mmc-sh-mmcif-avoid-oops-on-spurious-interrupts.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.6.2 / mmc-sh-mmcif-avoid-oops-on-spurious-interrupts.patch
CommitLineData
6cbd67ed
GKH
1From 8464dd52d3198dd05cafb005371d76e5339eb842 Mon Sep 17 00:00:00 2001
2From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
3Date: Tue, 18 Sep 2012 06:42:42 +0000
4Subject: mmc: sh-mmcif: avoid oops on spurious interrupts
5
6From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
7
8commit 8464dd52d3198dd05cafb005371d76e5339eb842 upstream.
9
10On some systems, e.g., kzm9g, MMCIF interfaces can produce spurious
11interrupts without any active request. To prevent the Oops, that results
12in such cases, don't dereference the mmc request pointer until we make
13sure, that we are indeed processing such a request.
14
15Reported-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
16Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
17Signed-off-by: Chris Ball <cjb@laptop.org>
18Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20---
21 drivers/mmc/host/sh_mmcif.c | 4 ++++
22 1 file changed, 4 insertions(+)
23
24--- a/drivers/mmc/host/sh_mmcif.c
25+++ b/drivers/mmc/host/sh_mmcif.c
26@@ -1229,6 +1229,10 @@ static irqreturn_t sh_mmcif_intr(int irq
27 host->sd_error = true;
28 dev_dbg(&host->pd->dev, "int err state = %08x\n", state);
29 }
30+ if (host->state == STATE_IDLE) {
31+ dev_info(&host->pd->dev, "Spurious IRQ status 0x%x", state);
32+ return IRQ_HANDLED;
33+ }
34 if (state & ~(INT_CMD12RBE | INT_CMD12CRE)) {
35 if (!host->dma_active)
36 return IRQ_WAKE_THREAD;