Skip to contentSkip to conversation

mmc: atmel-mci: fix data timeout issue

PATCH New ludovic.desroches at atmel.com 2 participants 2 messages May 23, 2012 – Jun 6, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: atmel-mci: fix data timeout issue

From: Ludovic Desroches <[email protected]>

The data timeout timer was configured after mmc_add_host call. So, with bad timings, it was possible to have a mmc request causing mod_timer call on a non setup timer.

---
 drivers/mmc/host/atmel-mci.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/atmel-mci.c +2 -2
index 93a1012..a25e23a 100644
@@ -2396,6 +2396,8 @@ static int __init atmci_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, host);
 
+	setup_timer(&host->timer, atmci_timeout_timer, (unsigned long)host);
+
 	/* We need at least one slot to succeed */
 	nr_slots = 0;
 	ret = -ENODEV;
@@ -2434,8 +2436,6 @@ static int __init atmci_probe(struct platform_device *pdev)
 		}
 	}
 
-	setup_timer(&host->timer, atmci_timeout_timer, (unsigned long)host);
-
 	dev_info(&pdev->dev,
 			"Atmel MCI controller at 0x%08lx irq %d, %u slots\n",
 			host->mapbase, irq, nr_slots);
Signature · 1 line
1.7.5.4
Applied
#1 lore raw

PATCH 1/1 mmc: atmel-mci: fix data timeout issue

Hi,

Quoted 25 lines · ludovic.desroches at atmel.com

From: Ludovic Desroches <[email protected]>

The data timeout timer was configured after mmc_add_host call. So, with bad timings, it was possible to have a mmc request causing mod_timer call on a non setup timer.

---
 drivers/mmc/host/atmel-mci.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/atmel-mci.c +2 -0
index 93a1012..a25e23a 100644
@@ -2396,6 +2396,8 @@ static int __init atmci_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, host);
 
+	setup_timer(&host->timer, atmci_timeout_timer, (unsigned long)host);
+
 	/* We need at least one slot to succeed */
 	nr_slots = 0;
 	ret = -ENODEV;

drivers/mmc/host/atmel-mci.c static int __init atmci_probe(struct platform_device *pdev) · line 2441

Quoted 8 lines
drivers/mmc/host/atmel-mci.c +0 -2
@@ -2434,8 +2436,6 @@ static int __init atmci_probe(struct platform_device *pdev)
 		}
 	}
 
-	setup_timer(&host->timer, atmci_timeout_timer, (unsigned long)host);
-
 	dev_info(&pdev->dev,
 			"Atmel MCI controller at 0x%08lx irq %d, %u slots\n",
 			host->mapbase, irq, nr_slots);

Pushed to mmc-next for 3.5, thanks.

- Chris.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child