Skip to contentSkip to conversation

mmc: dw-mmc: ensure that the card is not busy when changing clock.

PATCH Superseded Jaehoon Chung 3 participants 7 messages Aug 23, 2012 – Aug 27, 2012

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jaehoon Chung

author maintainer
#0 lore raw

PATCH 2/5 mmc: dw-mmc: ensure that the card is not busy when changing clock.

To avoid glitches in the card clock output,
need to check whether card is busy or not.

---
 drivers/mmc/host/dw_mmc.c |   30 ++++++++++++++++++++++++------
 drivers/mmc/host/dw_mmc.h |    1 +
 2 files changed, 25 insertions(+), 6 deletions(-)
drivers/mmc/host/dw_mmc.c +24 -6
index 36f98c0..8bef3c2 100644
@@ -623,6 +623,27 @@ static void mci_send_cmd(struct dw_mci_slot *slot, u32 cmd, u32 arg)
 		cmd, arg, cmd_status);
 }
 
+static void dw_mci_inform_ciu(struct dw_mci_slot *slot)
+{
+	struct dw_mci *host = slot->host;
+	unsigned long timeout = jiffies + msecs_to_jiffies(500);
+	u32 ctrl, status;
+
+	do {
+		status = mci_readl(host, STATUS);
+		if (!(status & SDMMC_DATA_BUSY))
+			break;
+		ctrl = mci_readl(host, CTRL);
+		ctrl |= SDMMC_CTRL_RESET;
+		mci_writel(host, CTRL, ctrl);
+	} while (time_before(jiffies, timeout));
+
+	if (status & SDMMC_DATA_BUSY)
+		dev_err(&slot->mmc->class_dev,"Card is busy..!\n");
+
+	mci_send_cmd(slot, SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0);
+}
+
 static void dw_mci_setup_bus(struct dw_mci_slot *slot)
 {
 	struct dw_mci *host = slot->host;
@@ -650,15 +671,13 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot)
 		mci_writel(host, CLKSRC, 0);
 
 		/* inform CIU */
-		mci_send_cmd(slot,
-			     SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0);
+		dw_mci_inform_ciu(slot);
 
 		/* set clock to desired speed */
 		mci_writel(host, CLKDIV, div);
 
 		/* inform CIU */
-		mci_send_cmd(slot,
-			     SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0);
+		dw_mci_inform_ciu(slot);
 
 		/* enable clock; only low power if no SDIO */
 		clk_en_a = SDMMC_CLKEN_ENABLE << slot->id;
@@ -667,8 +686,7 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot)
 		mci_writel(host, CLKENA, clk_en_a);
 
 		/* inform CIU */
-		mci_send_cmd(slot,
-			     SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0);
+		dw_mci_inform_ciu(slot);
 
 		host->current_speed = slot->clock;
 	}
drivers/mmc/host/dw_mmc.h +1 -0
index 15c27e1..b6a1a78 100644
@@ -127,6 +127,7 @@
 #define SDMMC_CMD_INDX(n)		((n) & 0x1F)
 /* Status register defines */
 #define SDMMC_GET_FCNT(x)		(((x)>>17) & 0x1FFF)
+#define SDMMC_DATA_BUSY			BIT(9)
 /* Internal DMAC interrupt defines */
 #define SDMMC_IDMAC_INT_AI		BIT(9)
 #define SDMMC_IDMAC_INT_NI		BIT(8)
Signature · 1 line
1.7.4.1
#1 lore raw
Quoted 15 lines · Jaehoon Chung

To avoid glitches in the card clock output,
need to check whether card is busy or not.

---
 drivers/mmc/host/dw_mmc.c |   30 ++++++++++++++++++++++++------
 drivers/mmc/host/dw_mmc.h |    1 +
 2 files changed, 25 insertions(+), 6 deletions(-)
drivers/mmc/host/dw_mmc.c +0 -0
index 36f98c0..8bef3c2 100644

drivers/mmc/host/dw_mmc.c static void mci_send_cmd(struct dw_mci_slot *slot, u32 cmd, u32 arg) · line 629

Quoted 7 lines
drivers/mmc/host/dw_mmc.c +4 -0
@@ -623,6 +623,27 @@ static void mci_send_cmd(struct dw_mci_slot *slot, u32 cmd, u32 arg)
                cmd, arg, cmd_status);
 }
 
+static void dw_mci_inform_ciu(struct dw_mci_slot *slot)
+{
+       struct dw_mci *host = slot->host;
+       unsigned long timeout = jiffies + msecs_to_jiffies(500);

Is there a reason why this timeout value was chosen? It seems quite long.

drivers/mmc/host/dw_mmc.c static void mci_send_cmd(struct dw_mci_slot *slot, u32 cmd, u32 arg) · line 642

Quoted 13 lines
drivers/mmc/host/dw_mmc.c +13 -0
+       u32 ctrl, status;
+
+       do {
+               status = mci_readl(host, STATUS);
+               if (!(status & SDMMC_DATA_BUSY))
+                       break;
+               ctrl = mci_readl(host, CTRL);
+               ctrl |= SDMMC_CTRL_RESET;
+               mci_writel(host, CTRL, ctrl);
+       } while (time_before(jiffies, timeout));
+
+       if (status & SDMMC_DATA_BUSY)
+               dev_err(&slot->mmc->class_dev,"Card is busy..!\n");

The two periods in this message do not need to be there.

author maintainer
#2 lore raw
Quoted 19 lines · Will Newton
Quoted 18 lines · Jaehoon Chung

To avoid glitches in the card clock output,
need to check whether card is busy or not.

---
 drivers/mmc/host/dw_mmc.c |   30 ++++++++++++++++++++++++------
 drivers/mmc/host/dw_mmc.h |    1 +
 2 files changed, 25 insertions(+), 6 deletions(-)
drivers/mmc/host/dw_mmc.c +0 -0
index 36f98c0..8bef3c2 100644
@@ -623,6 +623,27 @@ static void mci_send_cmd(struct dw_mci_slot *slot, u32 cmd, u32 arg)
                cmd, arg, cmd_status);
 }
 
Quoted 6 lines

drivers/mmc/host/dw_mmc.c static void mci_send_cmd(struct dw_mci_slot *slot, u32 cmd, u32 arg) · line 629

Quoted 4 lines
drivers/mmc/host/dw_mmc.c +4 -0
+static void dw_mci_inform_ciu(struct dw_mci_slot *slot)
+{
+       struct dw_mci *host = slot->host;
+       unsigned long timeout = jiffies + msecs_to_jiffies(500);

Is there a reason why this timeout value was chosen? It seems quite long.

There is no special reason. I will fix it with more reasonable value.

Quoted 16 lines
Quoted 4 lines
drivers/mmc/host/dw_mmc.c +3 -0
+       u32 ctrl, status;
+
+       do {

drivers/mmc/host/dw_mmc.c static void mci_send_cmd(struct dw_mci_slot *slot, u32 cmd, u32 arg) · line 642

Quoted 10 lines
drivers/mmc/host/dw_mmc.c +10 -0
+               status = mci_readl(host, STATUS);
+               if (!(status & SDMMC_DATA_BUSY))
+                       break;
+               ctrl = mci_readl(host, CTRL);
+               ctrl |= SDMMC_CTRL_RESET;
+               mci_writel(host, CTRL, ctrl);
+       } while (time_before(jiffies, timeout));
+
+       if (status & SDMMC_DATA_BUSY)
+               dev_err(&slot->mmc->class_dev,"Card is busy..!\n");

The two periods in this message do not need to be there.

Will fix.

Best Regards,
Jaehoon Chung

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
In reply to Jaehoon Chung

Hi Jaehoon,

Quoted 2 lines · Jaehoon Chung

To avoid glitches in the card clock output,
need to check whether card is busy or not.

Could you describe the problem more?
In which situation did you meet this?

Thanks,
Seungwon Jeon

Quoted 86 lines
---
 drivers/mmc/host/dw_mmc.c |   30 ++++++++++++++++++++++++------
 drivers/mmc/host/dw_mmc.h |    1 +
 2 files changed, 25 insertions(+), 6 deletions(-)
drivers/mmc/host/dw_mmc.c +24 -6
index 36f98c0..8bef3c2 100644
@@ -623,6 +623,27 @@ static void mci_send_cmd(struct dw_mci_slot *slot, u32 cmd, u32 arg)
 		cmd, arg, cmd_status);
 }
 
+static void dw_mci_inform_ciu(struct dw_mci_slot *slot)
+{
+	struct dw_mci *host = slot->host;
+	unsigned long timeout = jiffies + msecs_to_jiffies(500);
+	u32 ctrl, status;
+
+	do {
+		status = mci_readl(host, STATUS);
+		if (!(status & SDMMC_DATA_BUSY))
+			break;
+		ctrl = mci_readl(host, CTRL);
+		ctrl |= SDMMC_CTRL_RESET;
+		mci_writel(host, CTRL, ctrl);
+	} while (time_before(jiffies, timeout));
+
+	if (status & SDMMC_DATA_BUSY)
+		dev_err(&slot->mmc->class_dev,"Card is busy..!\n");
+
+	mci_send_cmd(slot, SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0);
+}
+
 static void dw_mci_setup_bus(struct dw_mci_slot *slot)
 {
 	struct dw_mci *host = slot->host;
@@ -650,15 +671,13 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot)
 		mci_writel(host, CLKSRC, 0);
 
 		/* inform CIU */
-		mci_send_cmd(slot,
-			     SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0);
+		dw_mci_inform_ciu(slot);
 
 		/* set clock to desired speed */
 		mci_writel(host, CLKDIV, div);
 
 		/* inform CIU */
-		mci_send_cmd(slot,
-			     SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0);
+		dw_mci_inform_ciu(slot);
 
 		/* enable clock; only low power if no SDIO */
 		clk_en_a = SDMMC_CLKEN_ENABLE << slot->id;
@@ -667,8 +686,7 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot)
 		mci_writel(host, CLKENA, clk_en_a);
 
 		/* inform CIU */
-		mci_send_cmd(slot,
-			     SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0);
+		dw_mci_inform_ciu(slot);
 
 		host->current_speed = slot->clock;
 	}
drivers/mmc/host/dw_mmc.h +1 -1
index 15c27e1..b6a1a78 100644
@@ -127,6 +127,7 @@
 #define SDMMC_CMD_INDX(n)		((n) & 0x1F)
 /* Status register defines */
 #define SDMMC_GET_FCNT(x)		(((x)>>17) & 0x1FFF)
+#define SDMMC_DATA_BUSY			BIT(9)
 /* Internal DMAC interrupt defines */
 #define SDMMC_IDMAC_INT_AI		BIT(9)
 #define SDMMC_IDMAC_INT_NI		BIT(8)
--

1.7.4.1
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author maintainer
#4 lore raw

Hi Seungwon,

Quoted 6 lines · Seungwon Jeon

Hi Jaehoon,

Quoted 2 lines · Jaehoon Chung

To avoid glitches in the card clock output,
need to check whether card is busy or not.

Could you describe the problem more?

synopsys spec is mentioned. (7.1 Software/Hardware Restrictions)
"Before disabling clock, ensure that card is not busy due to any previous data command."

Quoted 1 line

In which situation did you meet this?

At specific board, i found the problem that didn't inform ciu.
(It didn't produce always.)
At that time, i checked the status register whether card is busy or not. (Start bit of CMD register is cleared, but card is busy.)
Current code didn't check the card status. Just check whether the start-bit cleared. host regard that command is completed, will send the next command.
But next command didn't issue because Card is busy.
This patch can prevent this situation.

If you have any comment or opinion, please let me know. it's great help to me

Best Regards,
Jaehoon Chung

Quoted 95 lines

Thanks,
Seungwon Jeon

Quoted 81 lines
---
 drivers/mmc/host/dw_mmc.c |   30 ++++++++++++++++++++++++------
 drivers/mmc/host/dw_mmc.h |    1 +
 2 files changed, 25 insertions(+), 6 deletions(-)
drivers/mmc/host/dw_mmc.c +24 -6
index 36f98c0..8bef3c2 100644
@@ -623,6 +623,27 @@ static void mci_send_cmd(struct dw_mci_slot *slot, u32 cmd, u32 arg)
 		cmd, arg, cmd_status);
 }
 
+static void dw_mci_inform_ciu(struct dw_mci_slot *slot)
+{
+	struct dw_mci *host = slot->host;
+	unsigned long timeout = jiffies + msecs_to_jiffies(500);
+	u32 ctrl, status;
+
+	do {
+		status = mci_readl(host, STATUS);
+		if (!(status & SDMMC_DATA_BUSY))
+			break;
+		ctrl = mci_readl(host, CTRL);
+		ctrl |= SDMMC_CTRL_RESET;
+		mci_writel(host, CTRL, ctrl);
+	} while (time_before(jiffies, timeout));
+
+	if (status & SDMMC_DATA_BUSY)
+		dev_err(&slot->mmc->class_dev,"Card is busy..!\n");
+
+	mci_send_cmd(slot, SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0);
+}
+
 static void dw_mci_setup_bus(struct dw_mci_slot *slot)
 {
 	struct dw_mci *host = slot->host;
@@ -650,15 +671,13 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot)
 		mci_writel(host, CLKSRC, 0);
 
 		/* inform CIU */
-		mci_send_cmd(slot,
-			     SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0);
+		dw_mci_inform_ciu(slot);
 
 		/* set clock to desired speed */
 		mci_writel(host, CLKDIV, div);
 
 		/* inform CIU */
-		mci_send_cmd(slot,
-			     SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0);
+		dw_mci_inform_ciu(slot);
 
 		/* enable clock; only low power if no SDIO */
 		clk_en_a = SDMMC_CLKEN_ENABLE << slot->id;
@@ -667,8 +686,7 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot)
 		mci_writel(host, CLKENA, clk_en_a);
 
 		/* inform CIU */
-		mci_send_cmd(slot,
-			     SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0);
+		dw_mci_inform_ciu(slot);
 
 		host->current_speed = slot->clock;
 	}
drivers/mmc/host/dw_mmc.h +1 -1
index 15c27e1..b6a1a78 100644
@@ -127,6 +127,7 @@
 #define SDMMC_CMD_INDX(n)		((n) & 0x1F)
 /* Status register defines */
 #define SDMMC_GET_FCNT(x)		(((x)>>17) & 0x1FFF)
+#define SDMMC_DATA_BUSY			BIT(9)
 /* Internal DMAC interrupt defines */
 #define SDMMC_IDMAC_INT_AI		BIT(9)
 #define SDMMC_IDMAC_INT_NI		BIT(8)
--
Quoted 5 lines

1.7.4.1
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
Quoted 22 lines · Jaehoon Chung

Hi Seungwon,

Quoted 6 lines · Seungwon Jeon

Hi Jaehoon,

Quoted 2 lines · Jaehoon Chung

To avoid glitches in the card clock output,
need to check whether card is busy or not.

Could you describe the problem more?

synopsys spec is mentioned. (7.1 Software/Hardware Restrictions)
"Before disabling clock, ensure that card is not busy due to any previous data command."

Quoted 1 line

In which situation did you meet this?

At specific board, i found the problem that didn't inform ciu.
(It didn't produce always.)
At that time, i checked the status register whether card is busy or not. (Start bit of CMD register is cleared, but card is busy.)
Current code didn't check the card status. Just check whether the start-bit cleared. host regard that command is completed, will send the next command.
But next command didn't issue because Card is busy.
This patch can prevent this situation.

Quoted 1 line

If you have any comment or opinion, please let me know. it's great help to me

If you know a point in time, we can reproduce it.

Quoted 103 lines

Best Regards,
Jaehoon Chung

Quoted 86 lines

Thanks,
Seungwon Jeon

Quoted 83 lines
---
 drivers/mmc/host/dw_mmc.c |   30 ++++++++++++++++++++++++------
 drivers/mmc/host/dw_mmc.h |    1 +
 2 files changed, 25 insertions(+), 6 deletions(-)
drivers/mmc/host/dw_mmc.c +24 -6
index 36f98c0..8bef3c2 100644
@@ -623,6 +623,27 @@ static void mci_send_cmd(struct dw_mci_slot *slot, u32 cmd, u32 arg)
 		cmd, arg, cmd_status);
 }
 
+static void dw_mci_inform_ciu(struct dw_mci_slot *slot)
+{
+	struct dw_mci *host = slot->host;
+	unsigned long timeout = jiffies + msecs_to_jiffies(500);
+	u32 ctrl, status;
+
+	do {
+		status = mci_readl(host, STATUS);
+		if (!(status & SDMMC_DATA_BUSY))
+			break;
+		ctrl = mci_readl(host, CTRL);
+		ctrl |= SDMMC_CTRL_RESET;
+		mci_writel(host, CTRL, ctrl);
+	} while (time_before(jiffies, timeout));
+
+	if (status & SDMMC_DATA_BUSY)
+		dev_err(&slot->mmc->class_dev,"Card is busy..!\n");
+
+	mci_send_cmd(slot, SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0);
+}
+
 static void dw_mci_setup_bus(struct dw_mci_slot *slot)
 {
 	struct dw_mci *host = slot->host;
@@ -650,15 +671,13 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot)
 		mci_writel(host, CLKSRC, 0);
 
 		/* inform CIU */
-		mci_send_cmd(slot,
-			     SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0);
+		dw_mci_inform_ciu(slot);
 
 		/* set clock to desired speed */
 		mci_writel(host, CLKDIV, div);
 
 		/* inform CIU */
-		mci_send_cmd(slot,
-			     SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0);
+		dw_mci_inform_ciu(slot);
 
 		/* enable clock; only low power if no SDIO */
 		clk_en_a = SDMMC_CLKEN_ENABLE << slot->id;
@@ -667,8 +686,7 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot)
 		mci_writel(host, CLKENA, clk_en_a);
 
 		/* inform CIU */
-		mci_send_cmd(slot,
-			     SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0);
+		dw_mci_inform_ciu(slot);
 
 		host->current_speed = slot->clock;
 	}
drivers/mmc/host/dw_mmc.h +1 -1
index 15c27e1..b6a1a78 100644
@@ -127,6 +127,7 @@
 #define SDMMC_CMD_INDX(n)		((n) & 0x1F)
 /* Status register defines */
 #define SDMMC_GET_FCNT(x)		(((x)>>17) & 0x1FFF)
+#define SDMMC_DATA_BUSY			BIT(9)
 /* Internal DMAC interrupt defines */
 #define SDMMC_IDMAC_INT_AI		BIT(9)
 #define SDMMC_IDMAC_INT_NI		BIT(8)
--

1.7.4.1
--

Quoted 9 lines
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author maintainer
#6 lore raw
Quoted 23 lines · Seungwon Jeon
Quoted 22 lines · Jaehoon Chung

Hi Seungwon,

Quoted 6 lines · Seungwon Jeon

Hi Jaehoon,

Quoted 2 lines · Jaehoon Chung

To avoid glitches in the card clock output,
need to check whether card is busy or not.

Could you describe the problem more?

synopsys spec is mentioned. (7.1 Software/Hardware Restrictions)
"Before disabling clock, ensure that card is not busy due to any previous data command."

Quoted 1 line

In which situation did you meet this?

At specific board, i found the problem that didn't inform ciu.
(It didn't produce always.)
At that time, i checked the status register whether card is busy or not. (Start bit of CMD register is cleared, but card is busy.)
Current code didn't check the card status. Just check whether the start-bit cleared. host regard that command is completed, will send the next command.
But next command didn't issue because Card is busy.
This patch can prevent this situation.

Quoted 2 lines
Quoted 1 line

If you have any comment or opinion, please let me know. it's great help to me

If you know a point in time, we can reproduce it.

Well, i didn't sure that you can reproduce this.
On trats board, this problem is produced when kernel is booting.

Best Regards,
Jaehoon Chung

Quoted 110 lines
Quoted 100 lines

Best Regards,
Jaehoon Chung

Quoted 86 lines

Thanks,
Seungwon Jeon

Quoted 83 lines
---
 drivers/mmc/host/dw_mmc.c |   30 ++++++++++++++++++++++++------
 drivers/mmc/host/dw_mmc.h |    1 +
 2 files changed, 25 insertions(+), 6 deletions(-)
drivers/mmc/host/dw_mmc.c +24 -6
index 36f98c0..8bef3c2 100644
@@ -623,6 +623,27 @@ static void mci_send_cmd(struct dw_mci_slot *slot, u32 cmd, u32 arg)
 		cmd, arg, cmd_status);
 }
 
+static void dw_mci_inform_ciu(struct dw_mci_slot *slot)
+{
+	struct dw_mci *host = slot->host;
+	unsigned long timeout = jiffies + msecs_to_jiffies(500);
+	u32 ctrl, status;
+
+	do {
+		status = mci_readl(host, STATUS);
+		if (!(status & SDMMC_DATA_BUSY))
+			break;
+		ctrl = mci_readl(host, CTRL);
+		ctrl |= SDMMC_CTRL_RESET;
+		mci_writel(host, CTRL, ctrl);
+	} while (time_before(jiffies, timeout));
+
+	if (status & SDMMC_DATA_BUSY)
+		dev_err(&slot->mmc->class_dev,"Card is busy..!\n");
+
+	mci_send_cmd(slot, SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0);
+}
+
 static void dw_mci_setup_bus(struct dw_mci_slot *slot)
 {
 	struct dw_mci *host = slot->host;
@@ -650,15 +671,13 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot)
 		mci_writel(host, CLKSRC, 0);
 
 		/* inform CIU */
-		mci_send_cmd(slot,
-			     SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0);
+		dw_mci_inform_ciu(slot);
 
 		/* set clock to desired speed */
 		mci_writel(host, CLKDIV, div);
 
 		/* inform CIU */
-		mci_send_cmd(slot,
-			     SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0);
+		dw_mci_inform_ciu(slot);
 
 		/* enable clock; only low power if no SDIO */
 		clk_en_a = SDMMC_CLKEN_ENABLE << slot->id;
@@ -667,8 +686,7 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot)
 		mci_writel(host, CLKENA, clk_en_a);
 
 		/* inform CIU */
-		mci_send_cmd(slot,
-			     SDMMC_CMD_UPD_CLK | SDMMC_CMD_PRV_DAT_WAIT, 0);
+		dw_mci_inform_ciu(slot);
 
 		host->current_speed = slot->clock;
 	}
drivers/mmc/host/dw_mmc.h +1 -1
index 15c27e1..b6a1a78 100644
@@ -127,6 +127,7 @@
 #define SDMMC_CMD_INDX(n)		((n) & 0x1F)
 /* Status register defines */
 #define SDMMC_GET_FCNT(x)		(((x)>>17) & 0x1FFF)
+#define SDMMC_DATA_BUSY			BIT(9)
 /* Internal DMAC interrupt defines */
 #define SDMMC_IDMAC_INT_AI		BIT(9)
 #define SDMMC_IDMAC_INT_NI		BIT(8)
--

1.7.4.1
--

Quoted 9 lines
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html