On Fri, May 24, 2024 at 01:07:18AM +0000, Lin Gui (桂林) wrote:
Dear @Greg KHmailto:gregkh@linuxfoundation.org,
Base : kernel-5.15.159
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index a569066..d656964 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1800,7 +1800,13 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, if (err) goto free_card;
} else if (!mmc_card_hs400es(card)) {
} else if (mmc_card_hs400es(card)){
if (host->ops->execute_hs400_tuning) {
err = host->ops->execute_hs400_tuning(host, card);
if (err)
goto free_card;
}
} else { /* Select the desired bus width optionally */ err = mmc_select_bus_width(card); if (err > 0 && mmc_card_hs(card)) {
Also, please read: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html for how to do this properly.
Dear gregkh@linuxfoundation.org,
Sorry, update the format: This patch has been tested on Mediatek Phone, the test passed, Thank you
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index a569066..d656964 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1800,7 +1800,13 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, if (err) goto free_card;
- } else if (!mmc_card_hs400es(card)) { + } else if (mmc_card_hs400es(card)){ + if (host->ops->execute_hs400_tuning) { + err = host->ops->execute_hs400_tuning(host, card); + if (err) + goto free_card; + } + } else { /* Select the desired bus width optionally */ err = mmc_select_bus_width(card); if (err > 0 && mmc_card_hs(card)) {
------------------------------------ Best Regards ! Guilin 桂林
发件人: Greg KH gregkh@linuxfoundation.org 发送时间: 2024年5月24日 12:09 收件人: Lin Gui (桂林) Lin.Gui@mediatek.com 抄送: stable@vger.kernel.org; Yongdong Zhang (张永东) Yongdong.Zhang@mediatek.com; Bo Ye (叶波) Bo.Ye@mediatek.com; Qilin Tan (谭麒麟) Qilin.Tan@mediatek.com; Wenbin Mei (梅文彬) Wenbin.Mei@mediatek.com; Mengqi Zhang (张梦琦) Mengqi.Zhang@mediatek.com 主题: Re: 回复: 回复: 回复: backport a patch for Linux kernel-5.15 kernel-6.1 kenrel-6.6 stable tree
External email : Please do not click links or open attachments until you have verified the sender or the content.
On Fri, May 24, 2024 at 01:07:18AM +0000, Lin Gui (桂林) wrote:
Dear @Greg KHmailto:gregkh@linuxfoundation.org,
Base : kernel-5.15.159
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index a569066..d656964 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1800,7 +1800,13 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, if (err) goto free_card;
} else if (!mmc_card_hs400es(card)) {
} else if (mmc_card_hs400es(card)){
if (host->ops->execute_hs400_tuning) {
err = host->ops->execute_hs400_tuning(host, card);
if (err)
goto free_card;
}
} else { /* Select the desired bus width optionally */ err = mmc_select_bus_width(card); if (err > 0 && mmc_card_hs(card)) {
Also, please read: https://urldefense.com/v3/__https://www.kernel.org/doc/html/latest/process/s... for how to do this properly.
On Fri, May 24, 2024 at 05:58:32AM +0000, Lin Gui (桂林) wrote:
Dear gregkh@linuxfoundation.org,
Sorry, update the format: This patch has been tested on Mediatek Phone, the test passed, Thank you
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index a569066..d656964 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1800,7 +1800,13 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, if (err) goto free_card;
- } else if (!mmc_card_hs400es(card)) {
- } else if (mmc_card_hs400es(card)){
if (host->ops->execute_hs400_tuning) {
err = host->ops->execute_hs400_tuning(host, card);
if (err)
goto free_card;
}
- } else { /* Select the desired bus width optionally */ err = mmc_select_bus_width(card); if (err > 0 && mmc_card_hs(card)) {
Again, please apply this to the latest 5.15.y kernel and see what happens. I do not know what kernel you are using, but you know what kernel we are using :)
thanks,
greg k-h
Dear gregkh@linuxfoundation.org,
I'm very sorry for the trouble, here's the update:
From f033ef0bfb29cd413d10aba860ce8d178cc314e2 Mon Sep 17 00:00:00 2001 From: Mengqi Zhang mailto:mengqi.zhang@mediatek.com Date: Mon, 25 Dec 2023 17:38:40 +0800 Subject: [PATCH] mmc: core: Add HS400 tuning in HS400es initialization
commit 77e01b49e35f24ebd1659096d5fc5c3b75975545 upstream
During the initialization to HS400es stage, add a HS400 tuning flow as an optional process. For Mediatek IP, the HS400es mode requires a specific tuning to ensure the correct HS400 timing setting.
Signed-off-by: Mengqi Zhang mailto:mengqi.zhang@mediatek.com Link: https://lore.kernel.org/r/20231225093839.22931-2-mengqi.zhang@mediatek.com Signed-off-by: Ulf Hansson mailto:ulf.hansson@linaro.org --- drivers/mmc/core/mmc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index a56906633ddf..c1eb22fd033b 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1799,8 +1799,13 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, if (err) goto free_card; - - } else if (!mmc_card_hs400es(card)) { + } else if (mmc_card_hs400es(card)) { + if (host->ops->execute_hs400_tuning) { + err = host->ops->execute_hs400_tuning(host, card); + if (err) + goto free_card; + } + } else { /* Select the desired bus width optionally */ err = mmc_select_bus_width(card); if (err > 0 && mmc_card_hs(card)) { --
------------------------------------ Best Regards ! Guilin 桂林
发件人: Greg KH gregkh@linuxfoundation.org 发送时间: 2024年5月24日 14:55 收件人: Lin Gui (桂林) Lin.Gui@mediatek.com 抄送: stable@vger.kernel.org; Yongdong Zhang (张永东) Yongdong.Zhang@mediatek.com; Bo Ye (叶波) Bo.Ye@mediatek.com; Qilin Tan (谭麒麟) Qilin.Tan@mediatek.com; Wenbin Mei (梅文彬) Wenbin.Mei@mediatek.com; Mengqi Zhang (张梦琦) Mengqi.Zhang@mediatek.com 主题: Re: 回复: 回复: 回复: 回复: backport a patch for Linux kernel-5.15 kernel-6.1 kenrel-6.6 stable tree
External email : Please do not click links or open attachments until you have verified the sender or the content.
On Fri, May 24, 2024 at 05:58:32AM +0000, Lin Gui (桂林) wrote:
Dear mailto:gregkh@linuxfoundation.org,
Sorry, update the format: This patch has been tested on Mediatek Phone, the test passed, Thank you
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index a569066..d656964 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1800,7 +1800,13 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, if (err) goto free_card; -} else if (!mmc_card_hs400es(card)) { +} else if (mmc_card_hs400es(card)){ +if (host->ops->execute_hs400_tuning) { +err = host->ops->execute_hs400_tuning(host, card); +if (err) +goto free_card; +} +} else { /* Select the desired bus width optionally */ err = mmc_select_bus_width(card); if (err > 0 && mmc_card_hs(card)) {
Again, please apply this to the latest 5.15.y kernel and see what happens. I do not know what kernel you are using, but you know what kernel we are using :)
thanks,
greg k-h
On Sun, May 26, 2024 at 02:51:42AM +0000, Lin Gui (桂林) wrote:
Dear gregkh@linuxfoundation.org,
I'm very sorry for the trouble, here's the update:
From f033ef0bfb29cd413d10aba860ce8d178cc314e2 Mon Sep 17 00:00:00 2001 From: Mengqi Zhang mailto:mengqi.zhang@mediatek.com Date: Mon, 25 Dec 2023 17:38:40 +0800 Subject: [PATCH] mmc: core: Add HS400 tuning in HS400es initialization
commit 77e01b49e35f24ebd1659096d5fc5c3b75975545 upstream
During the initialization to HS400es stage, add a HS400 tuning flow as an optional process. For Mediatek IP, the HS400es mode requires a specific tuning to ensure the correct HS400 timing setting.
Signed-off-by: Mengqi Zhang mailto:mengqi.zhang@mediatek.com Link: https://lore.kernel.org/r/20231225093839.22931-2-mengqi.zhang@mediatek.com Signed-off-by: Ulf Hansson mailto:ulf.hansson@linaro.org
drivers/mmc/core/mmc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index a56906633ddf..c1eb22fd033b 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1799,8 +1799,13 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, if (err) goto free_card;
- } else if (!mmc_card_hs400es(card)) {
- } else if (mmc_card_hs400es(card)) {
if (host->ops->execute_hs400_tuning) {
err = host->ops->execute_hs400_tuning(host, card);
if (err)
goto free_card;
}
- } else {
/* Select the desired bus width optionally */ err = mmc_select_bus_width(card); if (err > 0 && mmc_card_hs(card)) { --
Better, thanks, but your email client still did odd things to the email addresses.
I've fixed this up by hand, but please, be more careful next time...
greg k-h
On Wed, Jun 12, 2024 at 02:08:20PM +0200, Greg KH wrote:
On Sun, May 26, 2024 at 02:51:42AM +0000, Lin Gui (桂林) wrote:
Dear gregkh@linuxfoundation.org,
I'm very sorry for the trouble, here's the update:
From f033ef0bfb29cd413d10aba860ce8d178cc314e2 Mon Sep 17 00:00:00 2001 From: Mengqi Zhang mailto:mengqi.zhang@mediatek.com Date: Mon, 25 Dec 2023 17:38:40 +0800 Subject: [PATCH] mmc: core: Add HS400 tuning in HS400es initialization
commit 77e01b49e35f24ebd1659096d5fc5c3b75975545 upstream
During the initialization to HS400es stage, add a HS400 tuning flow as an optional process. For Mediatek IP, the HS400es mode requires a specific tuning to ensure the correct HS400 timing setting.
Signed-off-by: Mengqi Zhang mailto:mengqi.zhang@mediatek.com Link: https://lore.kernel.org/r/20231225093839.22931-2-mengqi.zhang@mediatek.com Signed-off-by: Ulf Hansson mailto:ulf.hansson@linaro.org
drivers/mmc/core/mmc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index a56906633ddf..c1eb22fd033b 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1799,8 +1799,13 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, if (err) goto free_card;
- } else if (!mmc_card_hs400es(card)) {
- } else if (mmc_card_hs400es(card)) {
if (host->ops->execute_hs400_tuning) {
err = host->ops->execute_hs400_tuning(host, card);
if (err)
goto free_card;
}
- } else {
/* Select the desired bus width optionally */ err = mmc_select_bus_width(card); if (err > 0 && mmc_card_hs(card)) { --
Better, thanks, but your email client still did odd things to the email addresses.
I've fixed this up by hand, but please, be more careful next time...
Wait, again, NO! This patch does NOT even build at all!
How was this tested?
Here's a hint, this is the build error I get when applying it to the 5.15.y tree. I tried to say this in a nice way before, but now I will be specific:
CC [M] drivers/mmc/core/mmc.o drivers/mmc/core/mmc.c: In function ‘mmc_init_card’: drivers/mmc/core/mmc.c:1803:32: error: ‘const struct mmc_host_ops’ has no member named ‘execute_hs400_tuning’; did you mean ‘prepare_hs400_tuning’? 1803 | if (host->ops->execute_hs400_tuning) { | ^~~~~~~~~~~~~~~~~~~~ | prepare_hs400_tuning drivers/mmc/core/mmc.c:1804:42: error: ‘const struct mmc_host_ops’ has no member named ‘execute_hs400_tuning’; did you mean ‘prepare_hs400_tuning’? 1804 | err = host->ops->execute_hs400_tuning(host, card); | ^~~~~~~~~~~~~~~~~~~~ | prepare_hs400_tuning
Please properly test your submissions before sending them and asking someone else to apply them, otherwise it just wastes our time and we get very grumpy, as would you.
greg k-h
linux-stable-mirror@lists.linaro.org