]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
mmc: tegra: race during sdhci probe
authorBibek Basu <bbasu@nvidia.com>
Tue, 7 Jan 2014 09:58:26 +0000 (15:28 +0530)
committerBitan Biswas <bbiswas@nvidia.com>
Thu, 9 Jan 2014 16:38:25 +0000 (08:38 -0800)
delayed_clk_gate_wrk function has to be set before
calling sdhci_add_host. Otherwise the timer_function
will be empty and the race can cause kernel panic

Bug 1432964

Change-Id: I0ec921c3588c8368d1119d7b3089c82cc6c08e1e
Signed-off-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: http://git-master/r/352674
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
drivers/mmc/host/sdhci-tegra.c

index 98c479a855f9bb0d45074e97ceafde3ae37502be..fdda83afe1f6b88944976cc29f7eebb09a864a1f 100644 (file)
@@ -3373,12 +3373,11 @@ static int sdhci_tegra_probe(struct platform_device *pdev)
        if (plat->nominal_vcore_mv <= plat->boot_vcore_mv)
                plat->en_nominal_vcore_tuning = false;
 
+       INIT_DELAYED_WORK(&host->delayed_clk_gate_wrk, delayed_clk_gate_cb);
        rc = sdhci_add_host(host);
        if (rc)
                goto err_add_host;
 
-       INIT_DELAYED_WORK(&host->delayed_clk_gate_wrk, delayed_clk_gate_cb);
-
        if (gpio_is_valid(plat->cd_gpio)) {
                rc = request_threaded_irq(gpio_to_irq(plat->cd_gpio), NULL,
                        carddetect_irq,