Skip to contentSkip to conversation

Revert "mmc: sdhci: set to INT_DATA_END when there are data"

PATCH New Yuezhang.Mo at sony.com 5 participants 14 messages Mar 17, 2021 – Sep 6, 2021 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "mmc: sdhci: set to INT_DATA_END when there are data"

This reverts commit 17ea3c862865c0d704646f67dbf8412f9ff54f59.

In eMMC specification, for the response-with-busy(R1b, R5b) command, the DAT0 will driven to LOW as BUSY status, and in sdhci specification, the transfer complete bit should be wait for BUSY status de-assert.

All response-with-busy commands don't contain data, the data judgement is no need.

---
 drivers/mmc/sdhci.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/sdhci.c +1 -2
index d9ab6a0a83..8568f65b18 100644
@@ -258,8 +258,7 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
 		flags = SDHCI_CMD_RESP_LONG;
 	else if (cmd->resp_type & MMC_RSP_BUSY) {
 		flags = SDHCI_CMD_RESP_SHORT_BUSY;
-		if (data)
-			mask |= SDHCI_INT_DATA_END;
+		mask |= SDHCI_INT_DATA_END;
 	} else
 		flags = SDHCI_CMD_RESP_SHORT;
 
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Best Regards
Andy Wu

Quoted 40 lines

-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Yuezhang.Mo at sony.com
Sent: Wednesday, March 17, 2021 2:45 PM
To: u-boot at lists.denx.de
Cc: peng.fan at nxp.com; panto at antoniou-consulting.com
Subject: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

This reverts commit 17ea3c862865c0d704646f67dbf8412f9ff54f59.

In eMMC specification, for the response-with-busy(R1b, R5b) command, the DAT0 will driven to LOW as BUSY status, and in sdhci specification, the transfer complete bit should be wait for BUSY status de-assert.

All response-with-busy commands don't contain data, the data judgement is no need.

---
 drivers/mmc/sdhci.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/sdhci.c index renamed from drivers/mmc/sdhci.c +0 -0

d9ab6a0a83..8568f65b18 100644

drivers/mmc/sdhci.c +1 -3
@@ -258,8 +258,7 @@ static int sdhci_send_command(struct mmc *mmc,
 struct mmc_cmd *cmd,
 		flags = SDHCI_CMD_RESP_LONG;
 	else if (cmd->resp_type & MMC_RSP_BUSY) {
 		flags = SDHCI_CMD_RESP_SHORT_BUSY;
-		if (data)
-			mask |= SDHCI_INT_DATA_END;
+		mask |= SDHCI_INT_DATA_END;
 	} else
 		flags = SDHCI_CMD_RESP_SHORT;
 
--

2.25.1

#2 lore raw

PATCH 1/1 Revert "mmc: sdhci: set to INT_DATA_END when there are data"

In reply to Yuezhang.Mo at sony.com

Hi

Quoted 9 lines · Yuezhang.Mo at sony.com

This reverts commit 17ea3c862865c0d704646f67dbf8412f9ff54f59.

In eMMC specification, for the response-with-busy(R1b, R5b) command, the DAT0 will driven to LOW as BUSY status, and in sdhci specification, the transfer complete bit should be wait for BUSY status de-assert.

All response-with-busy commands don't contain data, the data judgement is no need.

I don't want to revert this commit. Is there any issue without this? Without this patch, some SoCs have timeout error with stop command.

To prevent it, it needs to increase timeout value at that time. (Timeout value can't fix each boards, waste time to find proper value, and be performance degradation.)

I didn't test without this patch on latest U-boot. But if there is no critical issue, keep it, plz.

Best Regards,
Jaehoon Chung

Quoted 21 lines
---
 drivers/mmc/sdhci.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/sdhci.c +1 -2
index d9ab6a0a83..8568f65b18 100644
@@ -258,8 +258,7 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
 		flags = SDHCI_CMD_RESP_LONG;
 	else if (cmd->resp_type & MMC_RSP_BUSY) {
 		flags = SDHCI_CMD_RESP_SHORT_BUSY;
-		if (data)
-			mask |= SDHCI_INT_DATA_END;
+		mask |= SDHCI_INT_DATA_END;
 	} else
 		flags = SDHCI_CMD_RESP_SHORT;
 
#3 lore raw

PATCH 1/1 Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi

Quoted 1 line

I don't want to revert this commit. Is there any issue without this?

Without revert commit 17ea3c86, Some board, like Dragonboard 410c will meet transfer data timeout error (we used v2018.01):

U-Boot 2018.01 (Nov 26 2020 - 03:31:09 +0000)
Qualcomm-DragonBoard 410C

DRAM:  986 MiB
MMC:   sdhci at 07824000: 0, sdhci at 07864000: 1
sdhci_transfer_data: Transfer data timeout
mmc_init: -70, time 10645

*** Warning - No block device, using default environment

And it seems the 17ea3c86 not followed the sdhci specification as transfer complete bit should be wait for the BUSY status de-assert.

Kernel side code also wait the transfer complete bit for response-with-busy command.

Quoted 1 line

Without this patch, some SoCs have timeout error with stop command.

Sorry, we didn't meet this stop command timeout issue, but I guess it maybe another issue, and can be fixed with modification limited to stop command, not for all response-with-busy command.

Does the SDHCI_QUIRK_BROKEN_R1B can be used for this case?

Best Regards
Andy Wu

Quoted 58 lines

-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Jaehoon Chung
Sent: Thursday, March 18, 2021 6:44 AM
To: Mo, Yuezhang <[email protected]>; u-boot at lists.denx.de
Cc: peng.fan at nxp.com; cpgs at samsung.com
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi

Quoted 9 lines · Yuezhang.Mo at sony.com

This reverts commit 17ea3c862865c0d704646f67dbf8412f9ff54f59.

In eMMC specification, for the response-with-busy(R1b, R5b) command, the DAT0 will driven to LOW as BUSY status, and in sdhci specification, the transfer complete bit should be wait for BUSY status de-assert.

All response-with-busy commands don't contain data, the data judgement is no need.

I don't want to revert this commit. Is there any issue without this? Without this patch, some SoCs have timeout error with stop command.

To prevent it, it needs to increase timeout value at that time. (Timeout value can't fix each boards, waste time to find proper value, and be performance degradation.)

I didn't test without this patch on latest U-boot. But if there is no critical issue, keep it, plz.

Best Regards,
Jaehoon Chung

drivers/mmc/sdhci.c static int sdhci_send_command(struct mmc *mmc,

Quoted 11 lines
---
 drivers/mmc/sdhci.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/sdhci.c index renamed from drivers/mmc/sdhci.c +0 -0

d9ab6a0a83..8568f65b18 100644

drivers/mmc/sdhci.c +0 -0
@@ -258,8 +258,7 @@ static int sdhci_send_command(struct mmc *mmc,

struct mmc_cmd *cmd,

Quoted 10 lines
drivers/mmc/sdhci.c +1 -2
 		flags = SDHCI_CMD_RESP_LONG;
 	else if (cmd->resp_type & MMC_RSP_BUSY) {
 		flags = SDHCI_CMD_RESP_SHORT_BUSY;
-		if (data)
-			mask |= SDHCI_INT_DATA_END;
+		mask |= SDHCI_INT_DATA_END;
 	} else
 		flags = SDHCI_CMD_RESP_SHORT;
 
#4 lore raw

PATCH 1/1 Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Andy,

Quoted 13 lines · Andy.Wu at sony.com

Hi

Quoted 1 line

I don't want to revert this commit. Is there any issue without this?

Without revert commit 17ea3c86, Some board, like Dragonboard 410c will meet transfer data timeout error (we used v2018.01):

U-Boot 2018.01 (Nov 26 2020 - 03:31:09 +0000)
Qualcomm-DragonBoard 410C

DRAM:  986 MiB
MMC:   sdhci at 07824000: 0, sdhci at 07864000: 1
sdhci_transfer_data: Transfer data timeout
mmc_init: -70, time 10645
Quoted 7 lines

*** Warning - No block device, using default environment

And it seems the 17ea3c86 not followed the sdhci specification as transfer complete bit should be wait for the BUSY status de-assert.

Kernel side code also wait the transfer complete bit for response-with-busy command.

Did you test on latest u-boot?? v2018.01 was too old version.

And if my understanding is right, INT_DATA_END needs to set when there is a data.

If there is no data, it doesn't need to set to it. Logically, there is no problem, isn't?

I will check with QC 410C board for clarifying this problem.

Quoted 7 lines
Quoted 2 lines

Without this patch, some SoCs have timeout error with stop command.

Sorry, we didn't meet this stop command timeout issue, but I guess it maybe another issue, and can be fixed with modification limited to stop command, not for all response-with-busy command.

Does the SDHCI_QUIRK_BROKEN_R1B can be used for this case?

Well, it can be used.

Best Regards,

Jaehoon Chung

Quoted 59 lines

Best Regards
Andy Wu

Quoted 55 lines

-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Jaehoon Chung
Sent: Thursday, March 18, 2021 6:44 AM
To: Mo, Yuezhang <[email protected]>; u-boot at lists.denx.de
Cc: peng.fan at nxp.com; cpgs at samsung.com
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi

Quoted 9 lines · Yuezhang.Mo at sony.com

This reverts commit 17ea3c862865c0d704646f67dbf8412f9ff54f59.

In eMMC specification, for the response-with-busy(R1b, R5b) command, the DAT0 will driven to LOW as BUSY status, and in sdhci specification, the transfer complete bit should be wait for BUSY status de-assert.

All response-with-busy commands don't contain data, the data judgement is no need.

I don't want to revert this commit. Is there any issue without this? Without this patch, some SoCs have timeout error with stop command.

To prevent it, it needs to increase timeout value at that time. (Timeout value can't fix each boards, waste time to find proper value, and be performance degradation.)

I didn't test without this patch on latest U-boot. But if there is no critical issue, keep it, plz.

Best Regards,
Jaehoon Chung

drivers/mmc/sdhci.c static int sdhci_send_command(struct mmc *mmc,

Quoted 10 lines
---
  drivers/mmc/sdhci.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/sdhci.c index renamed from drivers/mmc/sdhci.c +0 -0

d9ab6a0a83..8568f65b18 100644

drivers/mmc/sdhci.c +0 -0
@@ -258,8 +258,7 @@ static int sdhci_send_command(struct mmc *mmc,

struct mmc_cmd *cmd,

Quoted 10 lines
drivers/mmc/sdhci.c +1 -2
  		flags = SDHCI_CMD_RESP_LONG;
  	else if (cmd->resp_type & MMC_RSP_BUSY) {
  		flags = SDHCI_CMD_RESP_SHORT_BUSY;
-		if (data)
-			mask |= SDHCI_INT_DATA_END;
+		mask |= SDHCI_INT_DATA_END;
  	} else
  		flags = SDHCI_CMD_RESP_SHORT;
 
#5 lore raw

PATCH 1/1 Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Jaehoon

Quoted 2 lines

Did you test on latest u-boot? v2018.01 was too old version.

Yes, we tested on v2020.04, although there is no such issue, but I think it just depends on call sequence timing.

Quoted 3 lines

And if my understanding is right, INT_DATA_END needs to set when there is a data. If there is no data, it doesn't need to set to it. Logically, there is no problem, isn't?

If there is no data, but current command is RESPONSE-WITH-BUSY (like CMD6) type, the INT_DATA_END needs set also, refer sdhci spec explanation for INT_DATA_END bit:

Transfer Complete
This bit indicates stop of transaction on three cases:
...
(2) Completion of a command pairing with response-with-busy (R1b, R5b)

So, our modification just within if (cmd->resp_type & MMC_RSP_BUSY) judgment.

Best Regards
Andy Wu

Quoted 116 lines

-----Original Message-----
From: Jaehoon Chung <[email protected]>
Sent: Monday, March 22, 2021 6:03 PM
To: Wu, Andy <[email protected]>; jh80.chung at samsung.com; Mo, Yuezhang <[email protected]>; u-boot at lists.denx.de
Cc: peng.fan at nxp.com; cpgs at samsung.com
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Andy,

Quoted 13 lines · Andy.Wu at sony.com

Hi

Quoted 1 line

I don't want to revert this commit. Is there any issue without this?

Without revert commit 17ea3c86, Some board, like Dragonboard 410c will meet transfer data timeout error (we used v2018.01):

U-Boot 2018.01 (Nov 26 2020 - 03:31:09 +0000) Qualcomm-DragonBoard 410C

DRAM:  986 MiB
MMC:   sdhci at 07824000: 0, sdhci at 07864000: 1
sdhci_transfer_data: Transfer data timeout
mmc_init: -70, time 10645
Quoted 7 lines

*** Warning - No block device, using default environment

And it seems the 17ea3c86 not followed the sdhci specification as transfer complete bit should be wait for the BUSY status de-assert.

Kernel side code also wait the transfer complete bit for response-with-busy command.

Did you test on latest u-boot?? v2018.01 was too old version.

And if my understanding is right, INT_DATA_END needs to set when there is a data.

If there is no data, it doesn't need to set to it. Logically, there is no problem, isn't?

I will check with QC 410C board for clarifying this problem.

Quoted 7 lines
Quoted 2 lines

Without this patch, some SoCs have timeout error with stop command.

Sorry, we didn't meet this stop command timeout issue, but I guess it maybe another issue, and can be fixed with modification limited to stop command, not for all response-with-busy command.

Does the SDHCI_QUIRK_BROKEN_R1B can be used for this case?

Well, it can be used.

Best Regards,

Jaehoon Chung

Quoted 60 lines

Best Regards
Andy Wu

Quoted 56 lines

-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Jaehoon Chung
Sent: Thursday, March 18, 2021 6:44 AM
To: Mo, Yuezhang <[email protected]>; u-boot at lists.denx.de
Cc: peng.fan at nxp.com; cpgs at samsung.com
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi

Quoted 9 lines · Yuezhang.Mo at sony.com

This reverts commit 17ea3c862865c0d704646f67dbf8412f9ff54f59.

In eMMC specification, for the response-with-busy(R1b, R5b) command, the DAT0 will driven to LOW as BUSY status, and in sdhci specification, the transfer complete bit should be wait for BUSY status de-assert.

All response-with-busy commands don't contain data, the data judgement is no need.

I don't want to revert this commit. Is there any issue without this? Without this patch, some SoCs have timeout error with stop command.

To prevent it, it needs to increase timeout value at that time. (Timeout value can't fix each boards, waste time to find proper value, and be performance degradation.)

I didn't test without this patch on latest U-boot. But if there is no critical issue, keep it, plz.

Best Regards,
Jaehoon Chung

drivers/mmc/sdhci.c static int sdhci_send_command(struct mmc *mmc,

Quoted 10 lines
---
  drivers/mmc/sdhci.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/sdhci.c index renamed from drivers/mmc/sdhci.c +0 -0

d9ab6a0a83..8568f65b18 100644

drivers/mmc/sdhci.c +0 -0
@@ -258,8 +258,7 @@ static int sdhci_send_command(struct mmc *mmc,

struct mmc_cmd *cmd,

Quoted 10 lines
drivers/mmc/sdhci.c +1 -2
  		flags = SDHCI_CMD_RESP_LONG;
  	else if (cmd->resp_type & MMC_RSP_BUSY) {
  		flags = SDHCI_CMD_RESP_SHORT_BUSY;
-		if (data)
-			mask |= SDHCI_INT_DATA_END;
+		mask |= SDHCI_INT_DATA_END;
  	} else
  		flags = SDHCI_CMD_RESP_SHORT;
 
#6 lore raw

PATCH 1/1 Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Quoted 18 lines

Subject: RE: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Jaehoon

Quoted 2 lines

Did you test on latest u-boot? v2018.01 was too old version.

Yes, we tested on v2020.04, although there is no such issue, but I think it just depends on call sequence timing.

Quoted 2 lines

And if my understanding is right, INT_DATA_END needs to set when there is a data. If there is no data, it doesn't need to set to it. Logically, there is no

problem, isn't?

Quoted 1 line

If there is no data, but current command is RESPONSE-WITH-BUSY (like CMD6) type, the INT_DATA_END needs set also, refer sdhci spec explanation for INT_DATA_END bit:

Quoted 7 lines

Transfer Complete
This bit indicates stop of transaction on three cases:
...
(2) Completion of a command pairing with response-with-busy (R1b, R5b)

So, our modification just within if (cmd->resp_type & MMC_RSP_BUSY) judgment.

Jaehoon,

Do you see any issue if revert the patch?

Thanks,
Peng.

Quoted 123 lines

Best Regards
Andy Wu

Quoted 4 lines

-----Original Message-----
From: Jaehoon Chung <[email protected]>
Sent: Monday, March 22, 2021 6:03 PM
To: Wu, Andy <[email protected]>; jh80.chung at samsung.com; Mo,

Yuezhang

Quoted 29 lines

<[email protected]>; u-boot at lists.denx.de
Cc: peng.fan at nxp.com; cpgs at samsung.com
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Andy,

Quoted 13 lines · Andy.Wu at sony.com

Hi

Quoted 1 line

I don't want to revert this commit. Is there any issue without this?

Without revert commit 17ea3c86, Some board, like Dragonboard 410c will meet transfer data timeout error (we used v2018.01):

U-Boot 2018.01 (Nov 26 2020 - 03:31:09 +0000) Qualcomm-DragonBoard 410C

DRAM:  986 MiB
MMC:   sdhci at 07824000: 0, sdhci at 07864000: 1
sdhci_transfer_data: Transfer data timeout
mmc_init: -70, time 10645
Quoted 7 lines

*** Warning - No block device, using default environment

And it seems the 17ea3c86 not followed the sdhci specification as transfer complete bit should be wait for the BUSY status de-assert.

Kernel side code also wait the transfer complete bit for response-with-busy command.

Quoted 6 lines

Did you test on latest u-boot?? v2018.01 was too old version.

And if my understanding is right, INT_DATA_END needs to set when there is a data.

If there is no data, it doesn't need to set to it. Logically, there is no problem,

isn't?

Quoted 61 lines

I will check with QC 410C board for clarifying this problem.

Quoted 7 lines
Quoted 2 lines

Without this patch, some SoCs have timeout error with stop command.

Sorry, we didn't meet this stop command timeout issue, but I guess it maybe another issue, and can be fixed with modification limited to stop command, not for all response-with-busy command.

Does the SDHCI_QUIRK_BROKEN_R1B can be used for this case?

Well, it can be used.

Best Regards,

Jaehoon Chung

Quoted 44 lines

Best Regards
Andy Wu

Quoted 40 lines

-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Jaehoon Chung
Sent: Thursday, March 18, 2021 6:44 AM
To: Mo, Yuezhang <[email protected]>; u-boot at lists.denx.de
Cc: peng.fan at nxp.com; cpgs at samsung.com
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi

Quoted 9 lines · Yuezhang.Mo at sony.com

This reverts commit 17ea3c862865c0d704646f67dbf8412f9ff54f59.

In eMMC specification, for the response-with-busy(R1b, R5b) command, the DAT0 will driven to LOW as BUSY status, and in sdhci specification, the transfer complete bit should be wait for BUSY status de-assert.

All response-with-busy commands don't contain data, the data judgement is no need.

I don't want to revert this commit. Is there any issue without this? Without this patch, some SoCs have timeout error with stop command.

To prevent it, it needs to increase timeout value at that time. (Timeout value can't fix each boards, waste time to find proper value, and be performance degradation.)

I didn't test without this patch on latest U-boot. But if there is no critical issue, keep it, plz.

Best Regards,
Jaehoon Chung

Quoted 5 lines
---
  drivers/mmc/sdhci.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

drivers/mmc/sdhci.c static int sdhci_send_command(struct mmc

Quoted 5 lines
drivers/mmc/sdhci.c index renamed from drivers/mmc/sdhci.c +0 -0

d9ab6a0a83..8568f65b18 100644

drivers/mmc/sdhci.c +0 -0
@@ -258,8 +258,7 @@ static int sdhci_send_command(struct mmc

*mmc,

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

struct mmc_cmd *cmd,

Quoted 10 lines
drivers/mmc/sdhci.c +1 -2
  		flags = SDHCI_CMD_RESP_LONG;
  	else if (cmd->resp_type & MMC_RSP_BUSY) {
  		flags = SDHCI_CMD_RESP_SHORT_BUSY;
-		if (data)
-			mask |= SDHCI_INT_DATA_END;
+		mask |= SDHCI_INT_DATA_END;
  	} else
  		flags = SDHCI_CMD_RESP_SHORT;
 
#7 lore raw

PATCH 1/1 Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Peng,

Quoted 23 lines · Peng Fan
Quoted 23 lines

Subject: RE: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Jaehoon

Quoted 2 lines

Did you test on latest u-boot? v2018.01 was too old version.

Yes, we tested on v2020.04, although there is no such issue, but I think it just depends on call sequence timing.

Quoted 2 lines

And if my understanding is right, INT_DATA_END needs to set when there is a data. If there is no data, it doesn't need to set to it. Logically, there is no

problem, isn't?

Quoted 1 line

If there is no data, but current command is RESPONSE-WITH-BUSY (like CMD6) type, the INT_DATA_END needs set also, refer sdhci spec explanation for INT_DATA_END bit:

Transfer Complete
This bit indicates stop of transaction on three cases:
...
(2) Completion of a command pairing with response-with-busy (R1b, R5b)

Quoted 6 lines
Quoted 2 lines

So, our modification just within if (cmd->resp_type & MMC_RSP_BUSY) judgment.

Jaehoon,

Do you see any issue if revert the patch?

If you're ok, I will test after reverted the patch on tomorrow, and I will share result. Or I will try to reproduce timeout issue on 410c board.

Best Regards,
Jaehoon Chung

Quoted 127 lines

Thanks,
Peng.

Quoted 123 lines

Best Regards
Andy Wu

Quoted 4 lines

-----Original Message-----
From: Jaehoon Chung <[email protected]>
Sent: Monday, March 22, 2021 6:03 PM
To: Wu, Andy <[email protected]>; jh80.chung at samsung.com; Mo,

Yuezhang

Quoted 29 lines

<[email protected]>; u-boot at lists.denx.de
Cc: peng.fan at nxp.com; cpgs at samsung.com
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Andy,

Quoted 13 lines · Andy.Wu at sony.com

Hi

Quoted 1 line

I don't want to revert this commit. Is there any issue without this?

Without revert commit 17ea3c86, Some board, like Dragonboard 410c will meet transfer data timeout error (we used v2018.01):

U-Boot 2018.01 (Nov 26 2020 - 03:31:09 +0000) Qualcomm-DragonBoard 410C

DRAM:  986 MiB
MMC:   sdhci at 07824000: 0, sdhci at 07864000: 1
sdhci_transfer_data: Transfer data timeout
mmc_init: -70, time 10645
Quoted 7 lines

*** Warning - No block device, using default environment

And it seems the 17ea3c86 not followed the sdhci specification as transfer complete bit should be wait for the BUSY status de-assert.

Kernel side code also wait the transfer complete bit for response-with-busy command.

Quoted 6 lines

Did you test on latest u-boot?? v2018.01 was too old version.

And if my understanding is right, INT_DATA_END needs to set when there is a data.

If there is no data, it doesn't need to set to it. Logically, there is no problem,

isn't?

Quoted 61 lines

I will check with QC 410C board for clarifying this problem.

Quoted 7 lines
Quoted 2 lines

Without this patch, some SoCs have timeout error with stop command.

Sorry, we didn't meet this stop command timeout issue, but I guess it maybe another issue, and can be fixed with modification limited to stop command, not for all response-with-busy command.

Does the SDHCI_QUIRK_BROKEN_R1B can be used for this case?

Well, it can be used.

Best Regards,

Jaehoon Chung

Quoted 44 lines

Best Regards
Andy Wu

Quoted 40 lines

-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Jaehoon Chung
Sent: Thursday, March 18, 2021 6:44 AM
To: Mo, Yuezhang <[email protected]>; u-boot at lists.denx.de
Cc: peng.fan at nxp.com; cpgs at samsung.com
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi

Quoted 9 lines · Yuezhang.Mo at sony.com

This reverts commit 17ea3c862865c0d704646f67dbf8412f9ff54f59.

In eMMC specification, for the response-with-busy(R1b, R5b) command, the DAT0 will driven to LOW as BUSY status, and in sdhci specification, the transfer complete bit should be wait for BUSY status de-assert.

All response-with-busy commands don't contain data, the data judgement is no need.

I don't want to revert this commit. Is there any issue without this? Without this patch, some SoCs have timeout error with stop command.

To prevent it, it needs to increase timeout value at that time. (Timeout value can't fix each boards, waste time to find proper value, and be performance degradation.)

I didn't test without this patch on latest U-boot. But if there is no critical issue, keep it, plz.

Best Regards,
Jaehoon Chung

Quoted 5 lines
---
  drivers/mmc/sdhci.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

drivers/mmc/sdhci.c static int sdhci_send_command(struct mmc

Quoted 5 lines
drivers/mmc/sdhci.c index renamed from drivers/mmc/sdhci.c +0 -0

d9ab6a0a83..8568f65b18 100644

drivers/mmc/sdhci.c +0 -0
@@ -258,8 +258,7 @@ static int sdhci_send_command(struct mmc

*mmc,

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

struct mmc_cmd *cmd,

Quoted 10 lines
drivers/mmc/sdhci.c +1 -2
  		flags = SDHCI_CMD_RESP_LONG;
  	else if (cmd->resp_type & MMC_RSP_BUSY) {
  		flags = SDHCI_CMD_RESP_SHORT_BUSY;
-		if (data)
-			mask |= SDHCI_INT_DATA_END;
+		mask |= SDHCI_INT_DATA_END;
  	} else
  		flags = SDHCI_CMD_RESP_SHORT;
 
#8 lore raw

PATCH 1/1 Revert "mmc: sdhci: set to INT_DATA_END when there are data"

In reply to Peng Fan

Hi Peng,

Quoted 23 lines · Peng Fan
Quoted 23 lines

Subject: RE: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Jaehoon

Quoted 2 lines

Did you test on latest u-boot? v2018.01 was too old version.

Yes, we tested on v2020.04, although there is no such issue, but I think it just depends on call sequence timing.

Quoted 2 lines

And if my understanding is right, INT_DATA_END needs to set when there is a data. If there is no data, it doesn't need to set to it. Logically, there is no

problem, isn't?

Quoted 1 line

If there is no data, but current command is RESPONSE-WITH-BUSY (like CMD6) type, the INT_DATA_END needs set also, refer sdhci spec explanation for INT_DATA_END bit:

Transfer Complete
This bit indicates stop of transaction on three cases:
...
(2) Completion of a command pairing with response-with-busy (R1b, R5b)

Quoted 6 lines
Quoted 2 lines

So, our modification just within if (cmd->resp_type & MMC_RSP_BUSY) judgment.

Jaehoon,

Do you see any issue if revert the patch?

If you're ok, I will test after reverted the patch on tomorrow, and I will share result. Or I will try to reproduce timeout issue on 410c board.

Best Regards,
Jaehoon Chung

Quoted 127 lines

Thanks,
Peng.

Quoted 123 lines

Best Regards
Andy Wu

Quoted 4 lines

-----Original Message-----
From: Jaehoon Chung <[email protected]>
Sent: Monday, March 22, 2021 6:03 PM
To: Wu, Andy <[email protected]>; jh80.chung at samsung.com; Mo,

Yuezhang

Quoted 29 lines

<[email protected]>; u-boot at lists.denx.de
Cc: peng.fan at nxp.com; cpgs at samsung.com
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Andy,

Quoted 13 lines · Andy.Wu at sony.com

Hi

Quoted 1 line

I don't want to revert this commit. Is there any issue without this?

Without revert commit 17ea3c86, Some board, like Dragonboard 410c will meet transfer data timeout error (we used v2018.01):

U-Boot 2018.01 (Nov 26 2020 - 03:31:09 +0000) Qualcomm-DragonBoard 410C

DRAM:  986 MiB
MMC:   sdhci at 07824000: 0, sdhci at 07864000: 1
sdhci_transfer_data: Transfer data timeout
mmc_init: -70, time 10645
Quoted 7 lines

*** Warning - No block device, using default environment

And it seems the 17ea3c86 not followed the sdhci specification as transfer complete bit should be wait for the BUSY status de-assert.

Kernel side code also wait the transfer complete bit for response-with-busy command.

Quoted 6 lines

Did you test on latest u-boot?? v2018.01 was too old version.

And if my understanding is right, INT_DATA_END needs to set when there is a data.

If there is no data, it doesn't need to set to it. Logically, there is no problem,

isn't?

Quoted 61 lines

I will check with QC 410C board for clarifying this problem.

Quoted 7 lines
Quoted 2 lines

Without this patch, some SoCs have timeout error with stop command.

Sorry, we didn't meet this stop command timeout issue, but I guess it maybe another issue, and can be fixed with modification limited to stop command, not for all response-with-busy command.

Does the SDHCI_QUIRK_BROKEN_R1B can be used for this case?

Well, it can be used.

Best Regards,

Jaehoon Chung

Quoted 44 lines

Best Regards
Andy Wu

Quoted 40 lines

-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Jaehoon Chung
Sent: Thursday, March 18, 2021 6:44 AM
To: Mo, Yuezhang <[email protected]>; u-boot at lists.denx.de
Cc: peng.fan at nxp.com; cpgs at samsung.com
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi

Quoted 9 lines · Yuezhang.Mo at sony.com

This reverts commit 17ea3c862865c0d704646f67dbf8412f9ff54f59.

In eMMC specification, for the response-with-busy(R1b, R5b) command, the DAT0 will driven to LOW as BUSY status, and in sdhci specification, the transfer complete bit should be wait for BUSY status de-assert.

All response-with-busy commands don't contain data, the data judgement is no need.

I don't want to revert this commit. Is there any issue without this? Without this patch, some SoCs have timeout error with stop command.

To prevent it, it needs to increase timeout value at that time. (Timeout value can't fix each boards, waste time to find proper value, and be performance degradation.)

I didn't test without this patch on latest U-boot. But if there is no critical issue, keep it, plz.

Best Regards,
Jaehoon Chung

Quoted 5 lines
---
  drivers/mmc/sdhci.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

drivers/mmc/sdhci.c static int sdhci_send_command(struct mmc

Quoted 5 lines
drivers/mmc/sdhci.c index renamed from drivers/mmc/sdhci.c +0 -0

d9ab6a0a83..8568f65b18 100644

drivers/mmc/sdhci.c +0 -0
@@ -258,8 +258,7 @@ static int sdhci_send_command(struct mmc

*mmc,

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

struct mmc_cmd *cmd,

Quoted 10 lines
drivers/mmc/sdhci.c +1 -2
  		flags = SDHCI_CMD_RESP_LONG;
  	else if (cmd->resp_type & MMC_RSP_BUSY) {
  		flags = SDHCI_CMD_RESP_SHORT_BUSY;
-		if (data)
-			mask |= SDHCI_INT_DATA_END;
+		mask |= SDHCI_INT_DATA_END;
  	} else
  		flags = SDHCI_CMD_RESP_SHORT;
 
#9 lore raw

PATCH 1/1 Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Jaehoon

Quoted 3 lines

If you're ok, I will test after reverted the patch on tomorrow, and I will share result.
Or I will try to reproduce timeout issue on 410c board.

Sorry, but is there any update for this comments?

Best Regards
Andy Wu

Quoted 177 lines

-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Jaehoon Chung
Sent: Tuesday, April 6, 2021 7:13 PM
To: Peng Fan <[email protected]>; jh80.chung at gmail.com; u-boot at lists.denx.de
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Peng,

Quoted 25 lines · Peng Fan
Quoted 25 lines

Subject: RE: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Jaehoon

Quoted 2 lines

Did you test on latest u-boot? v2018.01 was too old version.

Yes, we tested on v2020.04, although there is no such issue, but I think it just depends on call sequence timing.

Quoted 3 lines

And if my understanding is right, INT_DATA_END needs to set when there is a data. If there is no data, it doesn't need to set to it. Logically, there is no

problem, isn't?

Quoted 1 line

If there is no data, but current command is RESPONSE-WITH-BUSY (like CMD6) type, the INT_DATA_END needs set also, refer sdhci spec explanation for INT_DATA_END bit:

Transfer Complete
This bit indicates stop of transaction on three cases:
...
(2) Completion of a command pairing with response-with-busy (R1b, R5b)

Quoted 6 lines
Quoted 2 lines

So, our modification just within if (cmd->resp_type & MMC_RSP_BUSY) judgment.

Jaehoon,

Do you see any issue if revert the patch?

If you're ok, I will test after reverted the patch on tomorrow, and I will share result.
Or I will try to reproduce timeout issue on 410c board.

Best Regards,
Jaehoon Chung

Quoted 128 lines

Thanks,
Peng.

Quoted 124 lines

Best Regards
Andy Wu

Quoted 4 lines

-----Original Message-----
From: Jaehoon Chung <[email protected]>
Sent: Monday, March 22, 2021 6:03 PM
To: Wu, Andy <[email protected]>; jh80.chung at samsung.com; Mo,

Yuezhang

Quoted 29 lines

<[email protected]>; u-boot at lists.denx.de
Cc: peng.fan at nxp.com; cpgs at samsung.com
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Andy,

Quoted 13 lines · Andy.Wu at sony.com

Hi

Quoted 1 line

I don't want to revert this commit. Is there any issue without this?

Without revert commit 17ea3c86, Some board, like Dragonboard 410c will meet transfer data timeout error (we used v2018.01):

U-Boot 2018.01 (Nov 26 2020 - 03:31:09 +0000) Qualcomm-DragonBoard 410C

DRAM:  986 MiB
MMC:   sdhci at 07824000: 0, sdhci at 07864000: 1
sdhci_transfer_data: Transfer data timeout
mmc_init: -70, time 10645
Quoted 7 lines

*** Warning - No block device, using default environment

And it seems the 17ea3c86 not followed the sdhci specification as transfer complete bit should be wait for the BUSY status de-assert.

Kernel side code also wait the transfer complete bit for response-with-busy command.

Quoted 7 lines

Did you test on latest u-boot?? v2018.01 was too old version.

And if my understanding is right, INT_DATA_END needs to set when there is a data.

If there is no data, it doesn't need to set to it. Logically, there is no problem,

isn't?

Quoted 61 lines

I will check with QC 410C board for clarifying this problem.

Quoted 7 lines
Quoted 2 lines

Without this patch, some SoCs have timeout error with stop command.

Sorry, we didn't meet this stop command timeout issue, but I guess it maybe another issue, and can be fixed with modification limited to stop command, not for all response-with-busy command.

Does the SDHCI_QUIRK_BROKEN_R1B can be used for this case?

Well, it can be used.

Best Regards,

Jaehoon Chung

Quoted 44 lines

Best Regards
Andy Wu

Quoted 40 lines

-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Jaehoon Chung
Sent: Thursday, March 18, 2021 6:44 AM
To: Mo, Yuezhang <[email protected]>; u-boot at lists.denx.de
Cc: peng.fan at nxp.com; cpgs at samsung.com
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi

Quoted 9 lines · Yuezhang.Mo at sony.com

This reverts commit 17ea3c862865c0d704646f67dbf8412f9ff54f59.

In eMMC specification, for the response-with-busy(R1b, R5b) command, the DAT0 will driven to LOW as BUSY status, and in sdhci specification, the transfer complete bit should be wait for BUSY status de-assert.

All response-with-busy commands don't contain data, the data judgement is no need.

I don't want to revert this commit. Is there any issue without this? Without this patch, some SoCs have timeout error with stop command.

To prevent it, it needs to increase timeout value at that time. (Timeout value can't fix each boards, waste time to find proper value, and be performance degradation.)

I didn't test without this patch on latest U-boot. But if there is no critical issue, keep it, plz.

Best Regards,
Jaehoon Chung

Quoted 5 lines
---
  drivers/mmc/sdhci.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

drivers/mmc/sdhci.c static int sdhci_send_command(struct mmc

Quoted 5 lines
drivers/mmc/sdhci.c index renamed from drivers/mmc/sdhci.c +0 -0

d9ab6a0a83..8568f65b18 100644

drivers/mmc/sdhci.c +0 -0
@@ -258,8 +258,7 @@ static int sdhci_send_command(struct mmc

*mmc,

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

struct mmc_cmd *cmd,

Quoted 10 lines
drivers/mmc/sdhci.c +1 -2
  		flags = SDHCI_CMD_RESP_LONG;
  	else if (cmd->resp_type & MMC_RSP_BUSY) {
  		flags = SDHCI_CMD_RESP_SHORT_BUSY;
-		if (data)
-			mask |= SDHCI_INT_DATA_END;
+		mask |= SDHCI_INT_DATA_END;
  	} else
  		flags = SDHCI_CMD_RESP_SHORT;
 
#10 lore raw

PATCH 1/1 Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Dear Andy

Quoted 7 lines · Andy.Wu at sony.com

Hi Jaehoon

Quoted 3 lines

If you're ok, I will test after reverted the patch on tomorrow, and I will share result.
Or I will try to reproduce timeout issue on 410c board.

Sorry, but is there any update for this comments?

Sorry for replying too late. I had been doing other things.
So if you're ok, i will test on my own boards with your patch until this weekend. (If possible, i will also check 410c board.)

Best Regards,
Jaehoon Chung

Quoted 182 lines

Best Regards
Andy Wu

Quoted 177 lines

-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Jaehoon Chung
Sent: Tuesday, April 6, 2021 7:13 PM
To: Peng Fan <[email protected]>; jh80.chung at gmail.com; u-boot at lists.denx.de
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Peng,

Quoted 25 lines · Peng Fan
Quoted 25 lines

Subject: RE: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Jaehoon

Quoted 2 lines

Did you test on latest u-boot? v2018.01 was too old version.

Yes, we tested on v2020.04, although there is no such issue, but I think it just depends on call sequence timing.

Quoted 3 lines

And if my understanding is right, INT_DATA_END needs to set when there is a data. If there is no data, it doesn't need to set to it. Logically, there is no

problem, isn't?

Quoted 1 line

If there is no data, but current command is RESPONSE-WITH-BUSY (like CMD6) type, the INT_DATA_END needs set also, refer sdhci spec explanation for INT_DATA_END bit:

Transfer Complete
This bit indicates stop of transaction on three cases:
...
(2) Completion of a command pairing with response-with-busy (R1b, R5b)

Quoted 6 lines
Quoted 2 lines

So, our modification just within if (cmd->resp_type & MMC_RSP_BUSY) judgment.

Jaehoon,

Do you see any issue if revert the patch?

If you're ok, I will test after reverted the patch on tomorrow, and I will share result.
Or I will try to reproduce timeout issue on 410c board.

Best Regards,
Jaehoon Chung

Quoted 128 lines

Thanks,
Peng.

Quoted 124 lines

Best Regards
Andy Wu

Quoted 4 lines

-----Original Message-----
From: Jaehoon Chung <[email protected]>
Sent: Monday, March 22, 2021 6:03 PM
To: Wu, Andy <[email protected]>; jh80.chung at samsung.com; Mo,

Yuezhang

Quoted 29 lines

<[email protected]>; u-boot at lists.denx.de
Cc: peng.fan at nxp.com; cpgs at samsung.com
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Andy,

Quoted 13 lines · Andy.Wu at sony.com

Hi

Quoted 1 line

I don't want to revert this commit. Is there any issue without this?

Without revert commit 17ea3c86, Some board, like Dragonboard 410c will meet transfer data timeout error (we used v2018.01):

U-Boot 2018.01 (Nov 26 2020 - 03:31:09 +0000) Qualcomm-DragonBoard 410C

DRAM:  986 MiB
MMC:   sdhci at 07824000: 0, sdhci at 07864000: 1
sdhci_transfer_data: Transfer data timeout
mmc_init: -70, time 10645
Quoted 7 lines

*** Warning - No block device, using default environment

And it seems the 17ea3c86 not followed the sdhci specification as transfer complete bit should be wait for the BUSY status de-assert.

Kernel side code also wait the transfer complete bit for response-with-busy command.

Quoted 7 lines

Did you test on latest u-boot?? v2018.01 was too old version.

And if my understanding is right, INT_DATA_END needs to set when there is a data.

If there is no data, it doesn't need to set to it. Logically, there is no problem,

isn't?

Quoted 61 lines

I will check with QC 410C board for clarifying this problem.

Quoted 7 lines
Quoted 2 lines

Without this patch, some SoCs have timeout error with stop command.

Sorry, we didn't meet this stop command timeout issue, but I guess it maybe another issue, and can be fixed with modification limited to stop command, not for all response-with-busy command.

Does the SDHCI_QUIRK_BROKEN_R1B can be used for this case?

Well, it can be used.

Best Regards,

Jaehoon Chung

Quoted 44 lines

Best Regards
Andy Wu

Quoted 40 lines

-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Jaehoon Chung
Sent: Thursday, March 18, 2021 6:44 AM
To: Mo, Yuezhang <[email protected]>; u-boot at lists.denx.de
Cc: peng.fan at nxp.com; cpgs at samsung.com
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi

Quoted 9 lines · Yuezhang.Mo at sony.com

This reverts commit 17ea3c862865c0d704646f67dbf8412f9ff54f59.

In eMMC specification, for the response-with-busy(R1b, R5b) command, the DAT0 will driven to LOW as BUSY status, and in sdhci specification, the transfer complete bit should be wait for BUSY status de-assert.

All response-with-busy commands don't contain data, the data judgement is no need.

I don't want to revert this commit. Is there any issue without this? Without this patch, some SoCs have timeout error with stop command.

To prevent it, it needs to increase timeout value at that time. (Timeout value can't fix each boards, waste time to find proper value, and be performance degradation.)

I didn't test without this patch on latest U-boot. But if there is no critical issue, keep it, plz.

Best Regards,
Jaehoon Chung

Quoted 5 lines
---
  drivers/mmc/sdhci.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

drivers/mmc/sdhci.c static int sdhci_send_command(struct mmc

Quoted 5 lines
drivers/mmc/sdhci.c index renamed from drivers/mmc/sdhci.c +0 -0

d9ab6a0a83..8568f65b18 100644

drivers/mmc/sdhci.c +0 -0
@@ -258,8 +258,7 @@ static int sdhci_send_command(struct mmc

*mmc,

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

struct mmc_cmd *cmd,

Quoted 10 lines
drivers/mmc/sdhci.c +1 -2
  		flags = SDHCI_CMD_RESP_LONG;
  	else if (cmd->resp_type & MMC_RSP_BUSY) {
  		flags = SDHCI_CMD_RESP_SHORT_BUSY;
-		if (data)
-			mask |= SDHCI_INT_DATA_END;
+		mask |= SDHCI_INT_DATA_END;
  	} else
  		flags = SDHCI_CMD_RESP_SHORT;
 
#11 lore raw

PATCH 1/1 Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Dear Andy,

Quoted 9 lines · Jaehoon Chung

Dear Andy

Quoted 6 lines · Andy.Wu at sony.com

Hi Jaehoon

Quoted 3 lines

If you're ok, I will test after reverted the patch on tomorrow, and I will share result.
Or I will try to reproduce timeout issue on 410c board.

Quoted 5 lines
Quoted 1 line

Sorry, but is there any update for this comments?

Sorry for replying too late. I had been doing other things.
So if you're ok, i will test on my own boards with your patch until this weekend. (If possible, i will also check 410c board.)

If a problem is occurred again, I will fix again.

Best Regards,
Jaehoon Chung

Quoted 189 lines

Best Regards,
Jaehoon Chung

Quoted 182 lines

Best Regards
Andy Wu

Quoted 177 lines

-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Jaehoon Chung
Sent: Tuesday, April 6, 2021 7:13 PM
To: Peng Fan <[email protected]>; jh80.chung at gmail.com; u-boot at lists.denx.de
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Peng,

Quoted 25 lines · Peng Fan
Quoted 25 lines

Subject: RE: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Jaehoon

Quoted 2 lines

Did you test on latest u-boot? v2018.01 was too old version.

Yes, we tested on v2020.04, although there is no such issue, but I think it just depends on call sequence timing.

Quoted 3 lines

And if my understanding is right, INT_DATA_END needs to set when there is a data. If there is no data, it doesn't need to set to it. Logically, there is no

problem, isn't?

Quoted 1 line

If there is no data, but current command is RESPONSE-WITH-BUSY (like CMD6) type, the INT_DATA_END needs set also, refer sdhci spec explanation for INT_DATA_END bit:

Transfer Complete
This bit indicates stop of transaction on three cases:
...
(2) Completion of a command pairing with response-with-busy (R1b, R5b)

Quoted 6 lines
Quoted 2 lines

So, our modification just within if (cmd->resp_type & MMC_RSP_BUSY) judgment.

Jaehoon,

Do you see any issue if revert the patch?

If you're ok, I will test after reverted the patch on tomorrow, and I will share result.
Or I will try to reproduce timeout issue on 410c board.

Best Regards,
Jaehoon Chung

Quoted 128 lines

Thanks,
Peng.

Quoted 124 lines

Best Regards
Andy Wu

Quoted 4 lines

-----Original Message-----
From: Jaehoon Chung <[email protected]>
Sent: Monday, March 22, 2021 6:03 PM
To: Wu, Andy <[email protected]>; jh80.chung at samsung.com; Mo,

Yuezhang

Quoted 29 lines

<[email protected]>; u-boot at lists.denx.de
Cc: peng.fan at nxp.com; cpgs at samsung.com
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Andy,

Quoted 13 lines · Andy.Wu at sony.com

Hi

Quoted 1 line

I don't want to revert this commit. Is there any issue without this?

Without revert commit 17ea3c86, Some board, like Dragonboard 410c will meet transfer data timeout error (we used v2018.01):

U-Boot 2018.01 (Nov 26 2020 - 03:31:09 +0000) Qualcomm-DragonBoard 410C

DRAM:  986 MiB
MMC:   sdhci at 07824000: 0, sdhci at 07864000: 1
sdhci_transfer_data: Transfer data timeout
mmc_init: -70, time 10645
Quoted 7 lines

*** Warning - No block device, using default environment

And it seems the 17ea3c86 not followed the sdhci specification as transfer complete bit should be wait for the BUSY status de-assert.

Kernel side code also wait the transfer complete bit for response-with-busy command.

Quoted 7 lines

Did you test on latest u-boot?? v2018.01 was too old version.

And if my understanding is right, INT_DATA_END needs to set when there is a data.

If there is no data, it doesn't need to set to it. Logically, there is no problem,

isn't?

Quoted 61 lines

I will check with QC 410C board for clarifying this problem.

Quoted 7 lines
Quoted 2 lines

Without this patch, some SoCs have timeout error with stop command.

Sorry, we didn't meet this stop command timeout issue, but I guess it maybe another issue, and can be fixed with modification limited to stop command, not for all response-with-busy command.

Does the SDHCI_QUIRK_BROKEN_R1B can be used for this case?

Well, it can be used.

Best Regards,

Jaehoon Chung

Quoted 44 lines

Best Regards
Andy Wu

Quoted 40 lines

-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Jaehoon Chung
Sent: Thursday, March 18, 2021 6:44 AM
To: Mo, Yuezhang <[email protected]>; u-boot at lists.denx.de
Cc: peng.fan at nxp.com; cpgs at samsung.com
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi

Quoted 9 lines · Yuezhang.Mo at sony.com

This reverts commit 17ea3c862865c0d704646f67dbf8412f9ff54f59.

In eMMC specification, for the response-with-busy(R1b, R5b) command, the DAT0 will driven to LOW as BUSY status, and in sdhci specification, the transfer complete bit should be wait for BUSY status de-assert.

All response-with-busy commands don't contain data, the data judgement is no need.

I don't want to revert this commit. Is there any issue without this? Without this patch, some SoCs have timeout error with stop command.

To prevent it, it needs to increase timeout value at that time. (Timeout value can't fix each boards, waste time to find proper value, and be performance degradation.)

I didn't test without this patch on latest U-boot. But if there is no critical issue, keep it, plz.

Best Regards,
Jaehoon Chung

Quoted 5 lines
---
  drivers/mmc/sdhci.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

drivers/mmc/sdhci.c static int sdhci_send_command(struct mmc

Quoted 5 lines
drivers/mmc/sdhci.c index renamed from drivers/mmc/sdhci.c +0 -0

d9ab6a0a83..8568f65b18 100644

drivers/mmc/sdhci.c +0 -0
@@ -258,8 +258,7 @@ static int sdhci_send_command(struct mmc

*mmc,

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

struct mmc_cmd *cmd,

Quoted 10 lines
drivers/mmc/sdhci.c +1 -2
  		flags = SDHCI_CMD_RESP_LONG;
  	else if (cmd->resp_type & MMC_RSP_BUSY) {
  		flags = SDHCI_CMD_RESP_SHORT_BUSY;
-		if (data)
-			mask |= SDHCI_INT_DATA_END;
+		mask |= SDHCI_INT_DATA_END;
  	} else
  		flags = SDHCI_CMD_RESP_SHORT;
 
#12 lore raw

Hi All

Since patch also reviewed by Jaehoon, how about merge it into mainline?

Best Regards
Andy Wu

Quoted 226 lines

-----Original Message-----
From: Jaehoon Chung <[email protected]>
Sent: Thursday, May 20, 2021 6:03 AM
To: Wu, Andy <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: CPGS <[email protected]>
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Dear Andy,

Quoted 9 lines · Jaehoon Chung

Dear Andy

Quoted 6 lines · On 5/11/21 4:39 PM, [email protected] wrote:

Hi Jaehoon

Quoted 3 lines

If you're ok, I will test after reverted the patch on tomorrow, and I will share result.
Or I will try to reproduce timeout issue on 410c board.

Quoted 5 lines
Quoted 1 line

Sorry, but is there any update for this comments?

Sorry for replying too late. I had been doing other things.
So if you're ok, i will test on my own boards with your patch until this weekend. (If possible, i will also check 410c board.)

If a problem is occurred again, I will fix again.

Best Regards,
Jaehoon Chung

Quoted 191 lines

Best Regards,
Jaehoon Chung

Quoted 184 lines

Best Regards
Andy Wu

Quoted 179 lines

-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Jaehoon Chung
Sent: Tuesday, April 6, 2021 7:13 PM
To: Peng Fan <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Peng,

Quoted 26 lines · Peng Fan
Quoted 26 lines

Subject: RE: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Jaehoon

Quoted 2 lines

Did you test on latest u-boot? v2018.01 was too old version.

Yes, we tested on v2020.04, although there is no such issue, but I think it just depends on call sequence timing.

Quoted 3 lines

And if my understanding is right, INT_DATA_END needs to set when there is a data. If there is no data, it doesn't need to set to it. Logically, there is no

problem, isn't?

Quoted 1 line

If there is no data, but current command is RESPONSE-WITH-BUSY (like
CMD6) type, the INT_DATA_END needs set also, refer sdhci spec explanation for INT_DATA_END bit:

Transfer Complete
This bit indicates stop of transaction on three cases:
...
(2) Completion of a command pairing with response-with-busy (R1b, R5b)

Quoted 6 lines
Quoted 2 lines

So, our modification just within if (cmd->resp_type & MMC_RSP_BUSY) judgment.

Jaehoon,

Do you see any issue if revert the patch?

If you're ok, I will test after reverted the patch on tomorrow, and I will share result.
Or I will try to reproduce timeout issue on 410c board.

Best Regards,
Jaehoon Chung

Quoted 128 lines

Thanks,
Peng.

Quoted 124 lines

Best Regards
Andy Wu

Quoted 4 lines

-----Original Message-----
From: Jaehoon Chung <[email protected]>
Sent: Monday, March 22, 2021 6:03 PM
To: Wu, Andy <[email protected]>; [email protected]; Mo,

Yuezhang

Quoted 29 lines

<[email protected]>; [email protected]
Cc: [email protected]; [email protected]
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Andy,

Quoted 13 lines · On 3/18/21 10:59 AM, [email protected] wrote:

Hi

Quoted 1 line

I don't want to revert this commit. Is there any issue without this?

Without revert commit 17ea3c86, Some board, like Dragonboard 410c will meet transfer data timeout error (we used v2018.01):

U-Boot 2018.01 (Nov 26 2020 - 03:31:09 +0000)
Qualcomm-DragonBoard 410C

DRAM:  986 MiB
MMC:   sdhci@07824000: 0, sdhci@07864000: 1
sdhci_transfer_data: Transfer data timeout
mmc_init: -70, time 10645
Quoted 7 lines

*** Warning - No block device, using default environment

And it seems the 17ea3c86 not followed the sdhci specification as transfer complete bit should be wait for the BUSY status de-assert.

Kernel side code also wait the transfer complete bit for response-with-busy command.

Quoted 7 lines

Did you test on latest u-boot?  v2018.01 was too old version.

And if my understanding is right, INT_DATA_END needs to set when there is a data.

If there is no data, it doesn't need to set to it. Logically, there is no problem,

isn't?

Quoted 61 lines

I will check with QC 410C board for clarifying this problem.

Quoted 7 lines
Quoted 2 lines

Without this patch, some SoCs have timeout error with stop command.

Sorry, we didn't meet this stop command timeout issue, but I guess it maybe another issue, and can be fixed with modification limited to stop command, not for all response-with-busy command.

Does the SDHCI_QUIRK_BROKEN_R1B can be used for this case?

Well, it can be used.

Best Regards,

Jaehoon Chung

Quoted 44 lines

Best Regards
Andy Wu

Quoted 40 lines

-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Jaehoon Chung
Sent: Thursday, March 18, 2021 6:44 AM
To: Mo, Yuezhang <[email protected]>; [email protected]
Cc: [email protected]; [email protected]
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi

Quoted 9 lines · On 3/17/21 3:44 PM, [email protected] wrote:

This reverts commit 17ea3c862865c0d704646f67dbf8412f9ff54f59.

In eMMC specification, for the response-with-busy(R1b, R5b) command, the DAT0 will driven to LOW as BUSY status, and in sdhci specification, the transfer complete bit should be wait for BUSY status de-assert.

All response-with-busy commands don't contain data, the data judgement is no need.

I don't want to revert this commit. Is there any issue without this? Without this patch, some SoCs have timeout error with stop command.

To prevent it, it needs to increase timeout value at that time. (Timeout value can't fix each boards, waste time to find proper value, and be performance degradation.)

I didn't test without this patch on latest U-boot. But if there is no critical issue, keep it, plz.

Best Regards,
Jaehoon Chung

Quoted 5 lines
---
  drivers/mmc/sdhci.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

drivers/mmc/sdhci.c static int sdhci_send_command(struct mmc

Quoted 5 lines
drivers/mmc/sdhci.c index renamed from drivers/mmc/sdhci.c +0 -0

d9ab6a0a83..8568f65b18 100644

drivers/mmc/sdhci.c +0 -0
@@ -258,8 +258,7 @@ static int sdhci_send_command(struct mmc

*mmc,

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

struct mmc_cmd *cmd,

Quoted 10 lines
drivers/mmc/sdhci.c +1 -2
  		flags = SDHCI_CMD_RESP_LONG;
  	else if (cmd->resp_type & MMC_RSP_BUSY) {
  		flags = SDHCI_CMD_RESP_SHORT_BUSY;
-		if (data)
-			mask |= SDHCI_INT_DATA_END;
+		mask |= SDHCI_INT_DATA_END;
  	} else
  		flags = SDHCI_CMD_RESP_SHORT;
 
#13 lore raw
In reply to Peng Fan

Hi Peng Fan,

Jaehoon approved this patch.
Do you have more comment for merging?

-----Original Message-----
From: Peng Fan <[email protected]>
Sent: Tuesday, April 6, 2021 6:03 PM
To: Wu, Andy <[email protected]>; [email protected]; [email protected]; Mo, Yuezhang <[email protected]>; [email protected]
Cc: [email protected]
Subject: RE: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Quoted 19 lines

Subject: RE: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Jaehoon

Quoted 2 lines

Did you test on latest u-boot? v2018.01 was too old version.

Yes, we tested on v2020.04, although there is no such issue, but I think it just depends on call sequence timing.

Quoted 3 lines

And if my understanding is right, INT_DATA_END needs to set when there is a data. If there is no data, it doesn't need to set to it. Logically, there is no

problem, isn't?

Quoted 1 line

If there is no data, but current command is RESPONSE-WITH-BUSY (like CMD6) type, the INT_DATA_END needs set also, refer sdhci spec explanation for INT_DATA_END bit:

Quoted 7 lines

Transfer Complete
This bit indicates stop of transaction on three cases:
...
(2) Completion of a command pairing with response-with-busy (R1b, R5b)

So, our modification just within if (cmd->resp_type & MMC_RSP_BUSY) judgment.

Jaehoon,

Do you see any issue if revert the patch?

Thanks,
Peng.

Quoted 124 lines

Best Regards
Andy Wu

Quoted 4 lines

-----Original Message-----
From: Jaehoon Chung <[email protected]>
Sent: Monday, March 22, 2021 6:03 PM
To: Wu, Andy <[email protected]>; [email protected]; Mo,

Yuezhang

Quoted 29 lines

<[email protected]>; [email protected]
Cc: [email protected]; [email protected]
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi Andy,

Quoted 13 lines · On 3/18/21 10:59 AM, [email protected] wrote:

Hi

Quoted 1 line

I don't want to revert this commit. Is there any issue without this?

Without revert commit 17ea3c86, Some board, like Dragonboard 410c will meet transfer data timeout error (we used v2018.01):

U-Boot 2018.01 (Nov 26 2020 - 03:31:09 +0000) Qualcomm-DragonBoard 410C

DRAM:  986 MiB
MMC:   sdhci@07824000: 0, sdhci@07864000: 1
sdhci_transfer_data: Transfer data timeout
mmc_init: -70, time 10645
Quoted 7 lines

*** Warning - No block device, using default environment

And it seems the 17ea3c86 not followed the sdhci specification as transfer complete bit should be wait for the BUSY status de-assert.

Kernel side code also wait the transfer complete bit for response-with-busy command.

Quoted 7 lines

Did you test on latest u-boot?  v2018.01 was too old version.

And if my understanding is right, INT_DATA_END needs to set when there is a data.

If there is no data, it doesn't need to set to it. Logically, there is no problem,

isn't?

Quoted 61 lines

I will check with QC 410C board for clarifying this problem.

Quoted 7 lines
Quoted 2 lines

Without this patch, some SoCs have timeout error with stop command.

Sorry, we didn't meet this stop command timeout issue, but I guess it maybe another issue, and can be fixed with modification limited to stop command, not for all response-with-busy command.

Does the SDHCI_QUIRK_BROKEN_R1B can be used for this case?

Well, it can be used.

Best Regards,

Jaehoon Chung

Quoted 44 lines

Best Regards
Andy Wu

Quoted 40 lines

-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Jaehoon Chung
Sent: Thursday, March 18, 2021 6:44 AM
To: Mo, Yuezhang <[email protected]>; [email protected]
Cc: [email protected]; [email protected]
Subject: Re: [PATCH] Revert "mmc: sdhci: set to INT_DATA_END when there are data"

Hi

Quoted 9 lines · On 3/17/21 3:44 PM, [email protected] wrote:

This reverts commit 17ea3c862865c0d704646f67dbf8412f9ff54f59.

In eMMC specification, for the response-with-busy(R1b, R5b) command, the DAT0 will driven to LOW as BUSY status, and in sdhci specification, the transfer complete bit should be wait for BUSY status de-assert.

All response-with-busy commands don't contain data, the data judgement is no need.

I don't want to revert this commit. Is there any issue without this? Without this patch, some SoCs have timeout error with stop command.

To prevent it, it needs to increase timeout value at that time. (Timeout value can't fix each boards, waste time to find proper value, and be performance degradation.)

I didn't test without this patch on latest U-boot. But if there is no critical issue, keep it, plz.

Best Regards,
Jaehoon Chung

Quoted 5 lines
---
  drivers/mmc/sdhci.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

drivers/mmc/sdhci.c static int sdhci_send_command(struct mmc

Quoted 5 lines
drivers/mmc/sdhci.c index renamed from drivers/mmc/sdhci.c +0 -0

d9ab6a0a83..8568f65b18 100644

drivers/mmc/sdhci.c +0 -0
@@ -258,8 +258,7 @@ static int sdhci_send_command(struct mmc

*mmc,

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

struct mmc_cmd *cmd,

Quoted 10 lines
drivers/mmc/sdhci.c +1 -2
  		flags = SDHCI_CMD_RESP_LONG;
  	else if (cmd->resp_type & MMC_RSP_BUSY) {
  		flags = SDHCI_CMD_RESP_SHORT_BUSY;
-		if (data)
-			mask |= SDHCI_INT_DATA_END;
+		mask |= SDHCI_INT_DATA_END;
  	} else
  		flags = SDHCI_CMD_RESP_SHORT;