[ 3.5.y.z extended stable ] Patch "mmc: sh-mmcif: avoid oops on spurious interrupts" has been added to staging queue

Herton Ronaldo Krzesinski herton.krzesinski at canonical.com
Mon Dec 10 20:43:21 UTC 2012


This is a note to let you know that I have just added a patch titled

    mmc: sh-mmcif: avoid oops on spurious interrupts

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Herton

------

>From 316d1704cf51f7606f1cbd5cc786114ac9859a88 Mon Sep 17 00:00:00 2001
From: Guennadi Liakhovetski <g.liakhovetski at gmx.de>
Date: Wed, 22 Aug 2012 06:49:47 +0000
Subject: [PATCH 02/11] mmc: sh-mmcif: avoid oops on spurious interrupts
 (second try)

commit 91ab252ac5a5c3461dd6910797611e9172626aed upstream.

On some systems, e.g., kzm9g, MMCIF interfaces can produce spurious
interrupts without any active request. To prevent the Oops, that results
in such cases, don't dereference the mmc request pointer until we make
sure, that we are indeed processing such a request.

Reported-by: Tetsuyuki Kobayashi <koba at kmckk.co.jp>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski at gmx.de>
Tested-by: Tetsuyuki Kobayashi <koba at kmckk.co.jp>
Signed-off-by: Chris Ball <cjb at laptop.org>
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski at canonical.com>
---
 drivers/mmc/host/sh_mmcif.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 724b35e..a5786a8 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -1066,7 +1066,6 @@ static irqreturn_t sh_mmcif_irqt(int irq, void *dev_id)
 {
 	struct sh_mmcif_host *host = dev_id;
 	struct mmc_request *mrq = host->mrq;
-	struct mmc_data *data = mrq->data;

 	cancel_delayed_work_sync(&host->timeout_work);

@@ -1114,13 +1113,14 @@ static irqreturn_t sh_mmcif_irqt(int irq, void *dev_id)
 	case MMCIF_WAIT_FOR_READ_END:
 	case MMCIF_WAIT_FOR_WRITE_END:
 		if (host->sd_error)
-			data->error = sh_mmcif_error_manage(host);
+			mrq->data->error = sh_mmcif_error_manage(host);
 		break;
 	default:
 		BUG();
 	}

 	if (host->wait_for != MMCIF_WAIT_FOR_STOP) {
+		struct mmc_data *data = mrq->data;
 		if (!mrq->cmd->error && data && !data->error)
 			data->bytes_xfered =
 				data->blocks * data->blksz;
--
1.7.9.5





More information about the kernel-team mailing list