[RAMEN9610-13999][COMMON] mmc: dw_mmc: set the drto timer only if drto does not occur
authordukhyun kwon <d_hyun.kwon@samsung.com>
Thu, 19 Jul 2018 04:07:01 +0000 (13:07 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:23:21 +0000 (20:23 +0300)
In the SOC where drto(Data response timeout)does not occur,
the corresponding function can be set separately.

Change-Id: I4b4bb53006fc4ca2932cb47b71fd2cbcc9da8ded
Signed-off-by: dukhyun kwon <d_hyun.kwon@samsung.com>
drivers/mmc/host/dw_mmc.c
drivers/mmc/host/dw_mmc.h

index c3839f512c66314fcd62c01035a92cc57a2ac696..4ce998a884cccaca6833b0c8e62fc362aa37b2fc 100644 (file)
@@ -2621,7 +2621,8 @@ static void dw_mci_tasklet_func(unsigned long priv)
                                 * If all data-related interrupts don't come
                                 * within the given time in reading data state.
                                 */
-                               if (host->dir_status == DW_MCI_RECV_STATUS)
+                               if ((host->pdata->sw_drto) &&
+                                               (host->dir_status == DW_MCI_RECV_STATUS))
                                        dw_mci_set_drto(host);
                                break;
                        }
@@ -2664,7 +2665,8 @@ static void dw_mci_tasklet_func(unsigned long priv)
                                 * interrupt doesn't come within the given time.
                                 * in reading data state.
                                 */
-                               if (host->dir_status == DW_MCI_RECV_STATUS)
+                               if ((host->pdata->sw_drto) &&
+                                               (host->dir_status == DW_MCI_RECV_STATUS))
                                        dw_mci_set_drto(host);
                                break;
                        }
@@ -3253,7 +3255,8 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
                }
 
                if (pending & SDMMC_INT_DATA_OVER) {
-                       del_timer(&host->dto_timer);
+                       if (host->pdata->sw_drto)
+                               del_timer(&host->dto_timer);
 
                        mci_writel(host, RINTSTS, SDMMC_INT_DATA_OVER);
                        dw_mci_debug_cmd_log(host->cmd, host, false, DW_MCI_FLAG_DTO, 0);
@@ -4022,6 +4025,8 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)
                pdata->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH;
        if (of_find_property(np, "card-detect-gpio", NULL))
                pdata->cd_type = DW_MCI_CD_GPIO;
+       if (of_find_property(np, "broken-drto", NULL))
+               pdata->sw_drto = true;
 
        return pdata;
 }
@@ -4163,7 +4168,8 @@ int dw_mci_probe(struct dw_mci *host)
 
        setup_timer(&host->cto_timer, dw_mci_cto_timer, (unsigned long)host);
 
-       setup_timer(&host->dto_timer, dw_mci_dto_timer, (unsigned long)host);
+       if (host->pdata->sw_drto)
+               setup_timer(&host->dto_timer, dw_mci_dto_timer, (unsigned long)host);
 
        spin_lock_init(&host->lock);
        spin_lock_init(&host->irq_lock);
index 916e2063544190f91b176fccd6feff872883d5b3..3c27ddae08071e383e1f7137e6eddd8f7f7522ee 100644 (file)
@@ -375,6 +375,9 @@ struct dw_mci_board {
        bool enable_cclk_on_suspend;
        bool on_suspend;
 
+       /* Broke DRTO */
+       bool sw_drto;
+
        /* Number of descriptors */
        unsigned int desc_sz;
 };