mmc: core: use non-reentrant workqueue for clock gating
authorMika Westerberg <mika.westerberg@linux.intel.com>
Thu, 18 Aug 2011 12:23:49 +0000 (15:23 +0300)
committerChris Ball <cjb@laptop.org>
Wed, 31 Aug 2011 20:25:50 +0000 (16:25 -0400)
The default multithread workqueue can cause the same work to be executed
concurrently on a different CPUs. This isn't really suitable for clock
gating as it might already gated the clock and gating it twice results both
host->clk_old and host->ios.clock to be set to 0.

To prevent this from happening we use system_nrt_wq instead.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Chris Ball <cjb@laptop.org>
Cc: <stable@kernel.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/core/host.c

index 96a26b2bf5f04fddd9c43aa2d1dbc142add2c8dd..793d0a0dad8d74d85d239da2c3b107e47a5d1b4e 100644 (file)
@@ -179,7 +179,7 @@ void mmc_host_clk_release(struct mmc_host *host)
        host->clk_requests--;
        if (mmc_host_may_gate_card(host->card) &&
            !host->clk_requests)
-               schedule_work(&host->clk_gate_work);
+               queue_work(system_nrt_wq, &host->clk_gate_work);
        spin_unlock_irqrestore(&host->clk_lock, flags);
 }