Skip to contentSkip to conversation

mmc: dw-mmc: relocate the position called dw_mci_setup_bus()

PATCH Superseded Jaehoon Chung 2 participants 5 messages Oct 29, 2012 – Oct 30, 2012

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Jaehoon Chung

author maintainer
#0 lore raw

PATCH v2 1/1 mmc: dw-mmc: relocate the position called dw_mci_setup_bus()

After power-on, must be ensured at least 74~80 clocks before sending any first command. To ensure, it's good that dw_mci_setup_bus() is located at dw_mci_set_ios instead of __dw_mci_start_request()

------
Changelog V2:
- Modified the commit-message.

---
 drivers/mmc/host/dw_mmc.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/mmc/host/dw_mmc.c +3 -3
index 4b2bedc..de79093 100644
@@ -682,9 +682,6 @@ static void __dw_mci_start_request(struct dw_mci *host,
 	if (host->pdata->select_slot)
 		host->pdata->select_slot(slot->id);
 
-	/* Slot specific timing and width adjustment */
-	dw_mci_setup_bus(slot);
-
 	host->cur_slot = slot;
 	host->mrq = mrq;
 
@@ -810,6 +807,9 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 	if (slot->host->drv_data->set_ios)
 		slot->host->drv_data->set_ios(slot->host, ios);
 
+	/* Slot specific timing and width adjustment */
+	dw_mci_setup_bus(slot);
+
 	switch (ios->power_mode) {
 	case MMC_POWER_UP:
 		set_bit(DW_MMC_CARD_NEED_INIT, &slot->flags);
Signature · 1 line
1.7.4.1
#1 lore raw

Monday, October 29, 2012, Jaehoon Chung <[email protected]>

Quoted 3 lines

After power-on, must be ensured at least 74~80 clocks before sending any first command. To ensure, it's good that dw_mci_setup_bus() is located at dw_mci_set_ios instead of __dw_mci_start_request()

After power-up, host driver sets 'DW_MMC_CARD_NEED_INIT' flag, right?
And then, this flag help to add SDMMC_CMD_INIT flag into CMD, when __dw_mci_start_request is executed. 74~80 clocks is ensured with SDMMC_CMD_INIT regardless location change, isn't it?
I mentioned this part in previous mail. Could you check it?

Thanks,
Seungwon Jeon

Quoted 41 lines

------
Changelog V2:
- Modified the commit-message.

---
 drivers/mmc/host/dw_mmc.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/mmc/host/dw_mmc.c +3 -4
index 4b2bedc..de79093 100644
@@ -682,9 +682,6 @@ static void __dw_mci_start_request(struct dw_mci *host,
 	if (host->pdata->select_slot)
 		host->pdata->select_slot(slot->id);
 
-	/* Slot specific timing and width adjustment */
-	dw_mci_setup_bus(slot);
-
 	host->cur_slot = slot;
 	host->mrq = mrq;
 
@@ -810,6 +807,9 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 	if (slot->host->drv_data->set_ios)
 		slot->host->drv_data->set_ios(slot->host, ios);
 
+	/* Slot specific timing and width adjustment */
+	dw_mci_setup_bus(slot);
+
 	switch (ios->power_mode) {
 	case MMC_POWER_UP:
 		set_bit(DW_MMC_CARD_NEED_INIT, &slot->flags);
--

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
#2 lore raw
Quoted 8 lines · Seungwon Jeon

Monday, October 29, 2012, Jaehoon Chung <[email protected]>

Quoted 3 lines

After power-on, must be ensured at least 74~80 clocks before sending any first command. To ensure, it's good that dw_mci_setup_bus() is located at dw_mci_set_ios instead of __dw_mci_start_request()

After power-up, host driver sets 'DW_MMC_CARD_NEED_INIT' flag, right?
And then, this flag help to add SDMMC_CMD_INIT flag into CMD, when __dw_mci_start_request is executed. 74~80 clocks is ensured with SDMMC_CMD_INIT regardless location change, isn't it?
I mentioned this part in previous mail. Could you check it?

According to eMMC spec, after power-on, need to wait for 74-clock before sending first command You can see code that after mmc_set_ios(), waiting for mmc_delay(10) into mmc_power_up(). (You can read the comment at mmc_power_up(), Maybe mmc_delay(10) didn't ensure the 74-clock).

Best Regards,
Jaehoon Chung

Quoted 51 lines

Thanks,
Seungwon Jeon

Quoted 36 lines

------
Changelog V2:
- Modified the commit-message.

---
 drivers/mmc/host/dw_mmc.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/mmc/host/dw_mmc.c +3 -4
index 4b2bedc..de79093 100644
@@ -682,9 +682,6 @@ static void __dw_mci_start_request(struct dw_mci *host,
 	if (host->pdata->select_slot)
 		host->pdata->select_slot(slot->id);
 
-	/* Slot specific timing and width adjustment */
-	dw_mci_setup_bus(slot);
-
 	host->cur_slot = slot;
 	host->mrq = mrq;
 
@@ -810,6 +807,9 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 	if (slot->host->drv_data->set_ios)
 		slot->host->drv_data->set_ios(slot->host, ios);
 
+	/* Slot specific timing and width adjustment */
+	dw_mci_setup_bus(slot);
+
 	switch (ios->power_mode) {
 	case MMC_POWER_UP:
 		set_bit(DW_MMC_CARD_NEED_INIT, &slot->flags);
--
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

#3 lore raw
Quoted 5 lines · Jaehoon Chung
Quoted 4 lines · Seungwon Jeon

Monday, October 29, 2012, Jaehoon Chung <[email protected]>

Quoted 3 lines

After power-on, must be ensured at least 74~80 clocks before sending any first command. To ensure, it's good that dw_mci_setup_bus() is located at dw_mci_set_ios instead of __dw_mci_start_request()

Quoted 8 lines
Quoted 2 lines

After power-up, host driver sets 'DW_MMC_CARD_NEED_INIT' flag, right?
And then, this flag help to add SDMMC_CMD_INIT flag into CMD, when __dw_mci_start_request is

executed.

Quoted 2 lines

74~80 clocks is ensured with SDMMC_CMD_INIT regardless location change, isn't it? I mentioned this part in previous mail. Could you check it?

According to eMMC spec, after power-on, need to wait for 74-clock before sending first command You can see code that after mmc_set_ios(), waiting for mmc_delay(10) into mmc_power_up(). (You can read the comment at mmc_power_up(), Maybe mmc_delay(10) didn't ensure the 74-clock).

There is 'send_initialization' bit in CMD register.
If this bit set with CMD0, it will guarantee 80 clocks by host controller. Currently this is applied in driver.
I agree change the location of dw_mci_setup_bus.
But commit message seem not proper for it.
Please let me know, if I miss something.

Thanks,
Seungwon Jeon

Quoted 59 lines

Best Regards,
Jaehoon Chung

Quoted 42 lines

Thanks,
Seungwon Jeon

Quoted 38 lines

------
Changelog V2:
- Modified the commit-message.

---
 drivers/mmc/host/dw_mmc.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/mmc/host/dw_mmc.c +3 -4
index 4b2bedc..de79093 100644
@@ -682,9 +682,6 @@ static void __dw_mci_start_request(struct dw_mci *host,
 	if (host->pdata->select_slot)
 		host->pdata->select_slot(slot->id);
 
-	/* Slot specific timing and width adjustment */
-	dw_mci_setup_bus(slot);
-
 	host->cur_slot = slot;
 	host->mrq = mrq;
 
@@ -810,6 +807,9 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 	if (slot->host->drv_data->set_ios)
 		slot->host->drv_data->set_ios(slot->host, ios);
 
+	/* Slot specific timing and width adjustment */
+	dw_mci_setup_bus(slot);
+
 	switch (ios->power_mode) {
 	case MMC_POWER_UP:
 		set_bit(DW_MMC_CARD_NEED_INIT, &slot->flags);
--

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
#4 lore raw

Dear Seungwon,

Quoted 8 lines · Seungwon Jeon
Quoted 7 lines · Jaehoon Chung
Quoted 6 lines · Seungwon Jeon

Monday, October 29, 2012, Jaehoon Chung <[email protected]>

Quoted 3 lines

After power-on, must be ensured at least 74~80 clocks before sending any first command. To ensure, it's good that dw_mci_setup_bus() is located at dw_mci_set_ios instead of __dw_mci_start_request()

After power-up, host driver sets 'DW_MMC_CARD_NEED_INIT' flag, right?
And then, this flag help to add SDMMC_CMD_INIT flag into CMD, when __dw_mci_start_request is

Quoted 8 lines
Quoted 6 lines

executed.

Quoted 2 lines

74~80 clocks is ensured with SDMMC_CMD_INIT regardless location change, isn't it? I mentioned this part in previous mail. Could you check it?

According to eMMC spec, after power-on, need to wait for 74-clock before sending first command You can see code that after mmc_set_ios(), waiting for mmc_delay(10) into mmc_power_up(). (You can read the comment at mmc_power_up(), Maybe mmc_delay(10) didn't ensure the 74-clock).

There is 'send_initialization' bit in CMD register.
If this bit set with CMD0, it will guarantee 80 clocks by host controller.

Is it guaranteed 80-clocks by host-controller? So I understood something wrong. My understanding is that "if flags is set, need to wait for 80-clock." If host-controller can ensure the 80-clock, location is not important.

My point was just entire sequence with core.c and dw_mmc.c Anyway, thank you for review.
If i miss other thing. let me know, plz.

Best Regards,
Jaehoon Chung

Quoted 72 lines

Currently this is applied in driver.
I agree change the location of dw_mci_setup_bus.
But commit message seem not proper for it.
Please let me know, if I miss something.

Thanks,
Seungwon Jeon

Quoted 55 lines

Best Regards,
Jaehoon Chung

Quoted 42 lines

Thanks,
Seungwon Jeon

Quoted 38 lines

------
Changelog V2:
- Modified the commit-message.

---
 drivers/mmc/host/dw_mmc.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/mmc/host/dw_mmc.c +3 -4
index 4b2bedc..de79093 100644
@@ -682,9 +682,6 @@ static void __dw_mci_start_request(struct dw_mci *host,
 	if (host->pdata->select_slot)
 		host->pdata->select_slot(slot->id);
 
-	/* Slot specific timing and width adjustment */
-	dw_mci_setup_bus(slot);
-
 	host->cur_slot = slot;
 	host->mrq = mrq;
 
@@ -810,6 +807,9 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 	if (slot->host->drv_data->set_ios)
 		slot->host->drv_data->set_ios(slot->host, ios);
 
+	/* Slot specific timing and width adjustment */
+	dw_mci_setup_bus(slot);
+
 	switch (ios->power_mode) {
 	case MMC_POWER_UP:
 		set_bit(DW_MMC_CARD_NEED_INIT, &slot->flags);
--

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