mmc: atmel-mci: fix data timeout issue
authorLudovic Desroches <ludovic.desroches@atmel.com>
Wed, 23 May 2012 13:52:15 +0000 (15:52 +0200)
committerChris Ball <cjb@laptop.org>
Wed, 6 Jun 2012 09:57:27 +0000 (05:57 -0400)
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.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/host/atmel-mci.c

index 420aca642b14ba42a6fa7fe014cc865e49445b73..456c077455cbf564d36e355a2f119da0600bf44c 100644 (file)
@@ -2314,6 +2314,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;
@@ -2352,8 +2354,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);