aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Ferre <nicolas.ferre@atmel.com>2008-11-27 11:23:49 -0500
committerPierre Ossman <drzeus@drzeus.cx>2008-11-30 17:52:44 -0500
commit99ba04053a3712498327bd147c22a9877100a904 (patch)
treeaa81411e14d3be918c1dfa6738d2ec0d8f9b143a
parent8decec78a3d9e240f14553284629ac4851ff3744 (diff)
mmc: at91_mci: reorder timer setup and mmc_add_host() call
As said in function comment mmc_add_host() requires that: "The host must be prepared to start servicing requests before this function completes." During this function, at91_mci_request() can be invoqued without timer beeing setup leading to a kernel Oops. This has been reported inserting this driver as a module. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Reported-by: Wu Xuan <wux@landicorp.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
-rw-r--r--drivers/mmc/host/at91_mci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mmc/host/at91_mci.c b/drivers/mmc/host/at91_mci.c
index 1f8b5b36222c..e556d42cc45a 100644
--- a/drivers/mmc/host/at91_mci.c
+++ b/drivers/mmc/host/at91_mci.c
@@ -1088,6 +1088,8 @@ static int __init at91_mci_probe(struct platform_device *pdev)
1088 goto fail0; 1088 goto fail0;
1089 } 1089 }
1090 1090
1091 setup_timer(&host->timer, at91_timeout_timer, (unsigned long)host);
1092
1091 platform_set_drvdata(pdev, mmc); 1093 platform_set_drvdata(pdev, mmc);
1092 1094
1093 /* 1095 /*
@@ -1101,8 +1103,6 @@ static int __init at91_mci_probe(struct platform_device *pdev)
1101 1103
1102 mmc_add_host(mmc); 1104 mmc_add_host(mmc);
1103 1105
1104 setup_timer(&host->timer, at91_timeout_timer, (unsigned long)host);
1105
1106 /* 1106 /*
1107 * monitor card insertion/removal if we can 1107 * monitor card insertion/removal if we can
1108 */ 1108 */