Can we get 1f311c94aabdb419c28e3147bcc8ab89269f1a7e merged into the stable tree? I have some compatibility issues on Realtek chips because of the missing initialization clocks.
Thanks! Regards, Christian
From: Ulf Hansson ulf.hansson@linaro.org Sent: Monday, February 28, 2022 5:12 PM To: Ricky WU Cc: gregkh@linuxfoundation.org; kai.heng.feng@canonical.com; tommyhebb@gmail.com; linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org Subject: Re: [PATCH] mmc: rtsx: add 74 Clocks in power on flow On Tue, 22 Feb 2022 at 08:28, Ricky WU ricky_wu@realtek.com wrote:
After 1ms stabilizing the voltage time add "Host provides at least 74 Clocks before issuing first command" that is spec definition
Signed-off-by: Ricky Wu ricky_wu@realtek.com
drivers/mmc/host/rtsx_pci_sdmmc.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c index 2a3f14afe9f8..e016d720e453 100644 --- a/drivers/mmc/host/rtsx_pci_sdmmc.c +++ b/drivers/mmc/host/rtsx_pci_sdmmc.c @@ -940,10 +940,17 @@ static int sd_power_on(struct realtek_pci_sdmmc *host) if (err < 0) return err;
+ mdelay(1);
err = rtsx_pci_write_register(pcr, CARD_OE, SD_OUTPUT_EN, SD_OUTPUT_EN); if (err < 0) return err;
+ /* send init 74 clocks */ + rtsx_pci_write_register(pcr, SD_BUS_STAT, SD_CLK_TOGGLE_EN, SD_CLK_TOGGLE_EN); + mdelay(5); + rtsx_pci_write_register(pcr, SD_BUS_STAT, SD_CLK_TOGGLE_EN, 0);
if (PCI_PID(pcr) == PID_5261) { /* * If test mode is set switch to SD Express mandatorily,
As you probably are aware of, the mmc core uses three power states (MMC_POWER_ON, MMC_POWER_UP and MMC_POWER_OFF) to manage the initialization, while it invokes the ->set_ios() callback for the mmc host driver. During these steps the core also tries to manage the different delays that are needed according to the eMMC/SD specs. You may have a look at mmc_power_up() in drivers/mmc/core/core.c. In the rtsx case, MMC_POWER_ON and MMC_POWER_UP are treated as one single step.
Moreover, it has turned out that some mmc HWs are actually controlling these delays during the initialization themselves, which makes the delays in the core superfluous. Therefore we have made the delays configurable for host drivers. For DT based platforms, we have the DT property "post-power-on-delay-ms" and for others, it's perfectly fine to update host->power_delay_ms before calling mmc_add_host().
Would it be possible to take advantage of the above "features" from the core, to avoid hard coded and superfluous delays?
Kind regards Uffe = Hyperstone GmbH | Reichenaustr. 39a | 78467 Konstanz Managing Director: Dr. Jan Peter Berns. Commercial register of local courts: Freiburg HRB381782
A: http://en.wikipedia.org/wiki/Top_post Q: Were do I find info about this thing called top-posting? A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail?
A: No. Q: Should I include quotations after my reply?
http://daringfireball.net/2007/07/on_top
On Mon, May 09, 2022 at 09:35:25AM +0000, Christian Löhle wrote:
Can we get 1f311c94aabdb419c28e3147bcc8ab89269f1a7e merged into the stable tree?
Which stable branches do you want this added to?
thanks,
greg k-h
Can we get 1f311c94aabdb419c28e3147bcc8ab89269f1a7e merged into the stable tree?
Which stable branches do you want this added to?
thanks,
greg k-h
From what I can tell the issue is present since the addition of the driver in ff984e57d36e8 So I would suggest adding them to all? Maybe Ricky and Ulf could comment?
Regards, Christian= Hyperstone GmbH | Reichenaustr. 39a | 78467 Konstanz Managing Director: Dr. Jan Peter Berns. Commercial register of local courts: Freiburg HRB381782
On Mon, 9 May 2022 at 12:12, Christian Löhle CLoehle@hyperstone.com wrote:
Can we get 1f311c94aabdb419c28e3147bcc8ab89269f1a7e merged into the stable tree?
Which stable branches do you want this added to?
thanks,
greg k-h
From what I can tell the issue is present since the addition of the driver in ff984e57d36e8 So I would suggest adding them to all? Maybe Ricky and Ulf could comment?
That seems correct.
Although, it's likely that 1f311c94aabd doesn't apply to older stable trees, but I guess we can try and see how it goes.
Perhaps an even better option is that you submit a backported patch to Greg for those stable kernels you want it to be applied to.
Kind regards Uffe
On Tue, May 10, 2022 at 11:56:38AM +0200, Ulf Hansson wrote:
On Mon, 9 May 2022 at 12:12, Christian Löhle CLoehle@hyperstone.com wrote:
Can we get 1f311c94aabdb419c28e3147bcc8ab89269f1a7e merged into the stable tree?
Which stable branches do you want this added to?
thanks,
greg k-h
From what I can tell the issue is present since the addition of the driver in ff984e57d36e8 So I would suggest adding them to all? Maybe Ricky and Ulf could comment?
That seems correct.
Although, it's likely that 1f311c94aabd doesn't apply to older stable trees, but I guess we can try and see how it goes.
Perhaps an even better option is that you submit a backported patch to Greg for those stable kernels you want it to be applied to.
It only applies cleanly to 5.17.y and 5.15.y, so I've added it there. If anyone wants it to be added to older kernels, they need to provide working backports.
thanks,
greg k-h
linux-stable-mirror@lists.linaro.org