Skip to content

Commit

Permalink
mmc: at91_mci: reorder timer setup and mmc_add_host() call
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nicolas Ferre authored and Pierre Ossman committed Nov 30, 2008
1 parent 8decec7 commit 99ba040
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mmc/host/at91_mci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/*
Expand All @@ -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
*/
Expand Down

0 comments on commit 99ba040

Please sign in to comment.