From: Nicolas Ferre Date: Thu, 27 Nov 2008 16:23:49 +0000 (+0100) Subject: mmc: at91_mci: reorder timer setup and mmc_add_host() call X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=99ba04053a3712498327bd147c22a9877100a904;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git 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 Reported-by: Wu Xuan Signed-off-by: Pierre Ossman --- 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) goto fail0; } + setup_timer(&host->timer, at91_timeout_timer, (unsigned long)host); + platform_set_drvdata(pdev, mmc); /* @@ -1101,8 +1103,6 @@ static int __init at91_mci_probe(struct platform_device *pdev) mmc_add_host(mmc); - setup_timer(&host->timer, at91_timeout_timer, (unsigned long)host); - /* * monitor card insertion/removal if we can */