]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: sh_mmcif: fix late delayed work initialisation
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Fri, 20 Jan 2012 23:41:28 +0000 (00:41 +0100)
committerChris Ball <cjb@laptop.org>
Tue, 14 Feb 2012 01:39:03 +0000 (20:39 -0500)
commit2629d2914c3c51a22841c183750e09a2abb942a6
tree86ecab1283f528cb4e8ac603434eb50252d93b5f
parent6f131584c688e25d98416e5f47a45346723d5963
mmc: sh_mmcif: fix late delayed work initialisation

If the driver is loaded with a card in the slot, mmc_add_host() will
schedule an immediate card-detection work, which will start IO and wait
for command completion. Usually the kernel first returns to the sh_mmcif
probe function, lets it finish and only then schedules the rescan work.
But sometimes, expecially under heavy system load, the work will be
scheduled immediately before returning to the probe method. In this case
it is important for the driver to be fully prepared for IO. For sh_mmcif
this means, that also the timeout work has to be initialised before
calling mmc_add_host(). It is also better to prepare interrupts
beforehand. Besides, since mmc_add_host() does card-detection itself,
there is no need to do it again immediately afterwards.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/host/sh_mmcif.c