Thanks Matthias. I cloud reproduce the issue on device without SDcard.
On 7/11/2020 5:49 AM, Matthias Kaehlcke wrote:
Hi,Yes. I have verified with system suspend-resume scenario.
On Fri, Jul 10, 2020 at 04:28:36PM +0530, Veerabhadrarao Badiganti wrote:Hi Mathias,Did you test system suspend too? At least in the Chrome OS kernel tree system
On 7/10/2020 6:22 AM, Matthias Kaehlcke wrote:
Hi,I have verified this on couple of sc7180 targets (on Chrome platform with
On Wed, Jul 08, 2020 at 06:41:20PM +0530, Veerabhadrarao Badiganti wrote:Configure SDHC IO pins with low power configuration when the driverI happened to have a debug patch in my tree which logs when regulators
is in suspend state.
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@xxxxxxxxxxxxxx>
---
ÂÂ drivers/mmc/host/sdhci-msm.c | 17 +++++++++++++++++
ÂÂ 1 file changed, 17 insertions(+)
diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index 392d41d57a6e..efd2bae1430c 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -15,6 +15,7 @@
ÂÂ #include <linux/iopoll.h>
ÂÂ #include <linux/regulator/consumer.h>
ÂÂ #include <linux/interconnect.h>
+#include <linux/pinctrl/consumer.h>
ÂÂ #include "sdhci-pltfm.h"
ÂÂ #include "cqhci.h"
@@ -1352,6 +1353,19 @@ static void sdhci_msm_set_uhs_signaling(struct sdhci_host *host,
ÂÂÂÂÂÂÂÂÂÂ sdhci_msm_hs400(host, &mmc->ios);
ÂÂ }
+static int sdhci_msm_set_pincfg(struct sdhci_msm_host *msm_host, bool level)
+{
+ÂÂÂ struct platform_device *pdev = msm_host->pdev;
+ÂÂÂ int ret;
+
+ÂÂÂ if (level)
+ÂÂÂÂÂÂÂ ret = pinctrl_pm_select_default_state(&pdev->dev);
+ÂÂÂ else
+ÂÂÂÂÂÂÂ ret = pinctrl_pm_select_sleep_state(&pdev->dev);
+
+ÂÂÂ return ret;
+}
+
ÂÂ static int sdhci_msm_set_vmmc(struct mmc_host *mmc)
ÂÂ {
ÂÂÂÂÂÂ if (IS_ERR(mmc->supply.vmmc))
@@ -1596,6 +1610,9 @@ static void sdhci_msm_handle_pwr_irq(struct sdhci_host *host, int irq)
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ ret = sdhci_msm_set_vqmmc(msm_host, mmc,
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ pwr_state & REQ_BUS_ON);
ÂÂÂÂÂÂÂÂÂÂ if (!ret)
+ÂÂÂÂÂÂÂÂÂÂÂ ret = sdhci_msm_set_pincfg(msm_host,
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ pwr_state & REQ_BUS_ON);
+ÂÂÂÂÂÂÂ if (!ret)
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ irq_ack |= CORE_PWRCTL_BUS_SUCCESS;
ÂÂÂÂÂÂÂÂÂÂ else
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ irq_ack |= CORE_PWRCTL_BUS_FAIL;
are enabled/disabled, with this patch I see the SD card regulator
toggling constantly after returning from the first system suspend.
I added more logs:
[ 1156.085819] DBG: sdhci_msm_set_pincfg: level = 0 (ret: 0)
[ 1156.248936] DBG: sdhci_msm_set_pincfg: level = 1 (ret: 0)
[ 1156.301989] DBG: sdhci_msm_set_pincfg: level = 0 (ret: 0)
[ 1156.462383] DBG: sdhci_msm_set_pincfg: level = 1 (ret: 0)
[ 1156.525988] DBG: sdhci_msm_set_pincfg: level = 0 (ret: 0)
[ 1156.670372] DBG: sdhci_msm_set_pincfg: level = 1 (ret: 0)
[ 1156.717935] DBG: sdhci_msm_set_pincfg: level = 0 (ret: 0)
[ 1156.878122] DBG: sdhci_msm_set_pincfg: level = 1 (ret: 0)
[ 1156.928134] DBG: sdhci_msm_set_pincfg: level = 0 (ret: 0)
This is on an SC7180 platform. It doesn't run an upstream kernel though,
but v5.4 with plenty of upstream patches.
Chrome kernel).
But didn't see any issue. Its working as expected.
suspend is not supported yet in the main branch, you'd need a pile of 30+
extra patches to get it to work. This is expected to change soon though :)
Sorry forgot to mention this point explicitly in last response.
I believe all the needed patches were present on qcom internal tree.
Suspend-resume is working fine on sc7180 qcom chrome tree.
Let me know if you are observing this issue constantly on multiple boards, II currently have only one board with the SD card slot populated, I might
will share you
a debug patch to check it further.
get another one next week.
The toggling occurs only when no SD card is inserted.