mmc: only stop edmac if slot state really changed
authorlintao <lintao@rock-chips.com>
Mon, 27 Oct 2014 05:53:16 +0000 (13:53 +0800)
committerlintao <lintao@rock-chips.com>
Tue, 28 Oct 2014 03:15:45 +0000 (11:15 +0800)
   This commit follow up with 27dc823e, avoid unnecessary emdac operation
in routine card of bh.

Signed-off-by: lintao <lintao@rock-chips.com>
drivers/mmc/host/rk_sdmmc.c

index dba448bf52f439fc92ecd1008348c8a5c8d21c2f..30b22095fd30c3cf417f237a95ca3391dff6b335 100755 (executable)
@@ -2965,11 +2965,6 @@ static void dw_mci_work_routine_card(struct work_struct *work)
 
                present = dw_mci_get_cd(mmc);
 
-                /* Stop edma when rountine card triggered */
-                if(cpu_is_rk3036() || cpu_is_rk312x())
-                       if(host->dma_ops && host->dma_ops->stop)
-                               host->dma_ops->stop(host);
-
                 /* Card insert, switch data line to uart function, and vice verse.
                  * ONLY audi chip need switched by software, using udbg tag in dts!
                  */
@@ -2992,6 +2987,10 @@ static void dw_mci_work_routine_card(struct work_struct *work)
                                present ? "inserted" : "removed.", mmc_hostname(mmc));
        
                        dw_mci_ctrl_all_reset(host);
+                       /* Stop edma when rountine card triggered */
+                       if(cpu_is_rk3036() || cpu_is_rk312x())
+                               if(host->dma_ops && host->dma_ops->stop)
+                                       host->dma_ops->stop(host);
                        rk_send_wakeup_key();//wake up system
                        spin_lock_bh(&host->lock);