mmc: fix a race between card-detect rescan and clock-gate work instances
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Fri, 15 Apr 2011 18:08:19 +0000 (20:08 +0200)
committerSteve Conklin <sconklin@canonical.com>
Thu, 2 Jun 2011 19:23:11 +0000 (14:23 -0500)
commit0efc56f7f04b09e26322f0568cf39780fb48787b
tree3b538054a7ed2016d7d71f09b17e594987dc1831
parentdaa853e42c17c50833220f4c96ac9843820dc3d1
mmc: fix a race between card-detect rescan and clock-gate work instances

BugLink: http://bugs.launchpad.net/bugs/780546

commit 26fc8775b51484d8c0a671198639c6d5ae60533e upstream.

Currently there is a race in the MMC core between a card-detect
rescan work and the clock-gating work, scheduled from a command
completion. Fix it by removing the dedicated clock-gating mutex
and using the MMC standard locking mechanism instead.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Simon Horman <horms@verge.net.au>
Cc: Magnus Damm <damm@opensource.se>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/mmc/core/host.c
include/linux/mmc/host.h