public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [07/34] mmc: atmel-mci: fix two parameters swapped
       [not found] <20100524230418.GA12770@kroah.com>
@ 2010-05-24 22:59 ` Greg KH
  2010-05-24 22:59 ` [08/34] mmc: atmel-mci: prevent kernel oops while removing card Greg KH
  2010-05-24 22:59 ` [09/34] mmc: atmel-mci: remove data error interrupt after xfer Greg KH
  2 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2010-05-24 22:59 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Nicolas Ferre,
	Haavard Skinnemoen, linux-mmc

2.6.34-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Nicolas Ferre <nicolas.ferre@atmel.com>

commit ebb1fea9b3adf25d7e2f643c614163af4f93a17f upstream.

Two parameters were swapped in the calls to atmci_init_slot().

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Reported-by: Anders Grahn <anders.grahn@hd-wireless.se>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/mmc/host/atmel-mci.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -1669,13 +1669,13 @@ static int __init atmci_probe(struct pla
 	ret = -ENODEV;
 	if (pdata->slot[0].bus_width) {
 		ret = atmci_init_slot(host, &pdata->slot[0],
-				MCI_SDCSEL_SLOT_A, 0);
+				0, MCI_SDCSEL_SLOT_A);
 		if (!ret)
 			nr_slots++;
 	}
 	if (pdata->slot[1].bus_width) {
 		ret = atmci_init_slot(host, &pdata->slot[1],
-				MCI_SDCSEL_SLOT_B, 1);
+				1, MCI_SDCSEL_SLOT_B);
 		if (!ret)
 			nr_slots++;
 	}



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

* [08/34] mmc: atmel-mci: prevent kernel oops while removing card
       [not found] <20100524230418.GA12770@kroah.com>
  2010-05-24 22:59 ` [07/34] mmc: atmel-mci: fix two parameters swapped Greg KH
@ 2010-05-24 22:59 ` Greg KH
  2010-05-24 22:59 ` [09/34] mmc: atmel-mci: remove data error interrupt after xfer Greg KH
  2 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2010-05-24 22:59 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Nicolas Ferre,
	Haavard Skinnemoen, linux-mmc

2.6.34-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Nicolas Ferre <nicolas.ferre@atmel.com>

commit 009a891b22395fc86e5f34057d79fffee4509ab5 upstream.

The removing of an SD card in certain circumstances can lead to a kernel
oops if we do not make sure that the "data" field of the host structure is
valid.  This patch adds a test in atmci_dma_cleanup() function and also
calls atmci_stop_dma() before throwing away the reference to data.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/mmc/host/atmel-mci.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -530,9 +530,10 @@ static void atmci_dma_cleanup(struct atm
 {
 	struct mmc_data			*data = host->data;
 
-	dma_unmap_sg(&host->pdev->dev, data->sg, data->sg_len,
-		     ((data->flags & MMC_DATA_WRITE)
-		      ? DMA_TO_DEVICE : DMA_FROM_DEVICE));
+	if (data)
+		dma_unmap_sg(&host->pdev->dev, data->sg, data->sg_len,
+			     ((data->flags & MMC_DATA_WRITE)
+			      ? DMA_TO_DEVICE : DMA_FROM_DEVICE));
 }
 
 static void atmci_stop_dma(struct atmel_mci *host)
@@ -1037,8 +1038,8 @@ static void atmci_command_complete(struc
 			"command error: status=0x%08x\n", status);
 
 		if (cmd->data) {
-			host->data = NULL;
 			atmci_stop_dma(host);
+			host->data = NULL;
 			mci_writel(host, IDR, MCI_NOTBUSY
 					| MCI_TXRDY | MCI_RXRDY
 					| ATMCI_DATA_ERROR_FLAGS);

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

* [09/34] mmc: atmel-mci: remove data error interrupt after xfer
       [not found] <20100524230418.GA12770@kroah.com>
  2010-05-24 22:59 ` [07/34] mmc: atmel-mci: fix two parameters swapped Greg KH
  2010-05-24 22:59 ` [08/34] mmc: atmel-mci: prevent kernel oops while removing card Greg KH
@ 2010-05-24 22:59 ` Greg KH
  2 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2010-05-24 22:59 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Nicolas Ferre,
	Haavard Skinnemoen, linux-mmc

2.6.34-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Nicolas Ferre <nicolas.ferre@atmel.com>

commit abc2c9fdf636c4335a8d72ac3c5ae152bca44b68 upstream.

Disable data error interrupts while we are actually recording that there
is not such errors.  This will prevent, in some cases, the warning message
printed at new request queuing (in atmci_start_request()).

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/mmc/host/atmel-mci.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -1230,6 +1230,7 @@ static void atmci_tasklet_func(unsigned
 			} else {
 				data->bytes_xfered = data->blocks * data->blksz;
 				data->error = 0;
+				mci_writel(host, IDR, ATMCI_DATA_ERROR_FLAGS);
 			}
 
 			if (!data->stop) {

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

end of thread, other threads:[~2010-05-24 23:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20100524230418.GA12770@kroah.com>
2010-05-24 22:59 ` [07/34] mmc: atmel-mci: fix two parameters swapped Greg KH
2010-05-24 22:59 ` [08/34] mmc: atmel-mci: prevent kernel oops while removing card Greg KH
2010-05-24 22:59 ` [09/34] mmc: atmel-mci: remove data error interrupt after xfer Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox