* [PATCH V1 1/1] mmc:sdhci:Fix the SD tuning CMD parameter issue that the SDHCI_TRANSFER_MODE is cleared from read direction to write direction incorrectly
@ 2022-07-20 12:37 Charl Liu
2022-07-24 7:21 ` Adrian Hunter
0 siblings, 1 reply; 4+ messages in thread
From: Charl Liu @ 2022-07-20 12:37 UTC (permalink / raw)
To: adrian.hunter, ulf.hansson, linux-mmc, linux-kernel
Cc: shaper.liu, chevron.li, thomas.hu, xiaoguang.yu, shirley.her
When cmd->opcode == MMC_SEND_TUNING_BLOCK, the SDHCI_TRANSFER_MODE
should also be kept
Signed-off-by: Charl Liu <charl.liu@bayhubtech.com>
---
Change in V1:
Keeping the SDHCI_TRANSFER_MODE when cmd->opcode == MMC_END_TUNING_
BLOCK
---
drivers/mmc/host/sdhci.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 22152029e14c..6a0f6725dadb 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1430,7 +1430,8 @@ static void sdhci_set_transfer_mode(struct sdhci_host *host,
if (host->quirks2 &
SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD) {
/* must not clear SDHCI_TRANSFER_MODE when tuning */
- if (cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200)
+ if ((cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200) &&
+ (cmd->opcode != MMC_SEND_TUNING_BLOCK))
sdhci_writew(host, 0x0, SDHCI_TRANSFER_MODE);
} else {
/* clear Auto CMD settings for no data CMDs */
--
2.32.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH V1 1/1] mmc:sdhci:Fix the SD tuning CMD parameter issue that the SDHCI_TRANSFER_MODE is cleared from read direction to write direction incorrectly
2022-07-20 12:37 [PATCH V1 1/1] mmc:sdhci:Fix the SD tuning CMD parameter issue that the SDHCI_TRANSFER_MODE is cleared from read direction to write direction incorrectly Charl Liu
@ 2022-07-24 7:21 ` Adrian Hunter
2022-08-31 12:04 ` 回复: " Chevron Li (WH)
0 siblings, 1 reply; 4+ messages in thread
From: Adrian Hunter @ 2022-07-24 7:21 UTC (permalink / raw)
To: Charl Liu, ulf.hansson, linux-mmc, linux-kernel
Cc: shaper.liu, chevron.li, thomas.hu, xiaoguang.yu, shirley.her
On 20/07/22 15:37, Charl Liu wrote:
> When cmd->opcode == MMC_SEND_TUNING_BLOCK, the SDHCI_TRANSFER_MODE
> should also be kept
>
> Signed-off-by: Charl Liu <charl.liu@bayhubtech.com>
> ---
> Change in V1:
> Keeping the SDHCI_TRANSFER_MODE when cmd->opcode == MMC_END_TUNING_
> BLOCK
> ---
> drivers/mmc/host/sdhci.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 22152029e14c..6a0f6725dadb 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -1430,7 +1430,8 @@ static void sdhci_set_transfer_mode(struct sdhci_host *host,
> if (host->quirks2 &
> SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD) {
> /* must not clear SDHCI_TRANSFER_MODE when tuning */
> - if (cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200)
> + if ((cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200) &&
> + (cmd->opcode != MMC_SEND_TUNING_BLOCK))
mmc_op_tuning() could be used here
> sdhci_writew(host, 0x0, SDHCI_TRANSFER_MODE);
> } else {
> /* clear Auto CMD settings for no data CMDs */
^ permalink raw reply [flat|nested] 4+ messages in thread
* 回复: [PATCH V1 1/1] mmc:sdhci:Fix the SD tuning CMD parameter issue that the SDHCI_TRANSFER_MODE is cleared from read direction to write direction incorrectly
2022-07-24 7:21 ` Adrian Hunter
@ 2022-08-31 12:04 ` Chevron Li (WH)
2022-08-31 13:49 ` Adrian Hunter
0 siblings, 1 reply; 4+ messages in thread
From: Chevron Li (WH) @ 2022-08-31 12:04 UTC (permalink / raw)
To: Adrian Hunter, Charl Liu (WH), ulf.hansson, linux-mmc, linux-kernel
Cc: Shaper Liu (WH), Thomas Hu(WH), XiaoGuang Yu (WH), Shirley Her(SC)
Hi, Adrian,
Sorry response you so late.
Does your comment "mmc_op_tuning() could be used here" means that we should use mmc_send_tuning() instead of sdhci_send_tuning?
If yes, I think we need add below patch commit by Charl Liu for those reasons:
1.Bayhub host tuning command does not have a data payload and our hardware does it automatically, so mmc_send_tuning() will return -EIO.
2.Bayhub host can be used for both SD and eMMC cards.
3.Both MMC_SEND_TUNING_BLOCK and MMC_SEND_TUNING_BLOCK_HS200 are tuning command opcode, maybe the same logical at here is better?
BR,
Chevron
-----邮件原件-----
发件人: Adrian Hunter <adrian.hunter@intel.com>
发送时间: Sunday, July 24, 2022 15:22
收件人: Charl Liu (WH) <charl.liu@bayhubtech.com>; ulf.hansson@linaro.org; linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org
抄送: Shaper Liu (WH) <shaper.liu@bayhubtech.com>; Chevron Li (WH) <chevron.li@bayhubtech.com>; Thomas Hu(WH) <thomas.hu@bayhubtech.com>; XiaoGuang Yu (WH) <xiaoguang.yu@bayhubtech.com>; Shirley Her(SC) <shirley.her@bayhubtech.com>
主题: Re: [PATCH V1 1/1] mmc:sdhci:Fix the SD tuning CMD parameter issue that the SDHCI_TRANSFER_MODE is cleared from read direction to write direction incorrectly
On 20/07/22 15:37, Charl Liu wrote:
> When cmd->opcode == MMC_SEND_TUNING_BLOCK, the SDHCI_TRANSFER_MODE
> should also be kept
>
> Signed-off-by: Charl Liu <charl.liu@bayhubtech.com>
> ---
> Change in V1:
> Keeping the SDHCI_TRANSFER_MODE when cmd->opcode == MMC_END_TUNING_
> BLOCK
> ---
> drivers/mmc/host/sdhci.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index
> 22152029e14c..6a0f6725dadb 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -1430,7 +1430,8 @@ static void sdhci_set_transfer_mode(struct sdhci_host *host,
> if (host->quirks2 &
> SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD) {
> /* must not clear SDHCI_TRANSFER_MODE when tuning */
> - if (cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200)
> + if ((cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200) &&
> + (cmd->opcode != MMC_SEND_TUNING_BLOCK))
mmc_op_tuning() could be used here
> sdhci_writew(host, 0x0, SDHCI_TRANSFER_MODE);
> } else {
> /* clear Auto CMD settings for no data CMDs */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: 回复: [PATCH V1 1/1] mmc:sdhci:Fix the SD tuning CMD parameter issue that the SDHCI_TRANSFER_MODE is cleared from read direction to write direction incorrectly
2022-08-31 12:04 ` 回复: " Chevron Li (WH)
@ 2022-08-31 13:49 ` Adrian Hunter
0 siblings, 0 replies; 4+ messages in thread
From: Adrian Hunter @ 2022-08-31 13:49 UTC (permalink / raw)
To: Chevron Li (WH), Charl Liu (WH), ulf.hansson, linux-mmc, linux-kernel
Cc: Shaper Liu (WH), Thomas Hu(WH), XiaoGuang Yu (WH), Shirley Her(SC)
On 31/08/22 15:04, Chevron Li (WH) wrote:
> Hi, Adrian,
>
> Sorry response you so late.
>
> Does your comment "mmc_op_tuning() could be used here" means that we should use mmc_send_tuning() instead of sdhci_send_tuning?
I just meant, instead of:
- if (cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200)
+ if ((cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200) &&
+ (cmd->opcode != MMC_SEND_TUNING_BLOCK))
this is simpler:
- if (cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200)
+ if (!mmc_op_tuning(cmd->opcode))
>
> If yes, I think we need add below patch commit by Charl Liu for those reasons:
> 1.Bayhub host tuning command does not have a data payload and our hardware does it automatically, so mmc_send_tuning() will return -EIO.
> 2.Bayhub host can be used for both SD and eMMC cards.
> 3.Both MMC_SEND_TUNING_BLOCK and MMC_SEND_TUNING_BLOCK_HS200 are tuning command opcode, maybe the same logical at here is better?
>
> BR,
> Chevron
>
> -----邮件原件-----
> 发件人: Adrian Hunter <adrian.hunter@intel.com>
> 发送时间: Sunday, July 24, 2022 15:22
> 收件人: Charl Liu (WH) <charl.liu@bayhubtech.com>; ulf.hansson@linaro.org; linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org
> 抄送: Shaper Liu (WH) <shaper.liu@bayhubtech.com>; Chevron Li (WH) <chevron.li@bayhubtech.com>; Thomas Hu(WH) <thomas.hu@bayhubtech.com>; XiaoGuang Yu (WH) <xiaoguang.yu@bayhubtech.com>; Shirley Her(SC) <shirley.her@bayhubtech.com>
> 主题: Re: [PATCH V1 1/1] mmc:sdhci:Fix the SD tuning CMD parameter issue that the SDHCI_TRANSFER_MODE is cleared from read direction to write direction incorrectly
>
> On 20/07/22 15:37, Charl Liu wrote:
>> When cmd->opcode == MMC_SEND_TUNING_BLOCK, the SDHCI_TRANSFER_MODE
>> should also be kept
>>
>> Signed-off-by: Charl Liu <charl.liu@bayhubtech.com>
>> ---
>> Change in V1:
>> Keeping the SDHCI_TRANSFER_MODE when cmd->opcode == MMC_END_TUNING_
>> BLOCK
>> ---
>> drivers/mmc/host/sdhci.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index
>> 22152029e14c..6a0f6725dadb 100644
>> --- a/drivers/mmc/host/sdhci.c
>> +++ b/drivers/mmc/host/sdhci.c
>> @@ -1430,7 +1430,8 @@ static void sdhci_set_transfer_mode(struct sdhci_host *host,
>> if (host->quirks2 &
>> SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD) {
>> /* must not clear SDHCI_TRANSFER_MODE when tuning */
>> - if (cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200)
>> + if ((cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200) &&
>> + (cmd->opcode != MMC_SEND_TUNING_BLOCK))
>
> mmc_op_tuning() could be used here
>
>> sdhci_writew(host, 0x0, SDHCI_TRANSFER_MODE);
>> } else {
>> /* clear Auto CMD settings for no data CMDs */
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-08-31 13:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-20 12:37 [PATCH V1 1/1] mmc:sdhci:Fix the SD tuning CMD parameter issue that the SDHCI_TRANSFER_MODE is cleared from read direction to write direction incorrectly Charl Liu
2022-07-24 7:21 ` Adrian Hunter
2022-08-31 12:04 ` 回复: " Chevron Li (WH)
2022-08-31 13:49 ` Adrian Hunter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.