diff mbox series

[V2,2/2] mmc: sdhci-msm: Enable MMC_CAP2_SLEEP_AWAKE for Qualcomm controllers

Message ID 20230929102831.9702-3-quic_sartgarg@quicinc.com (mailing list archive)
State Not Applicable
Headers show
Series Add partial initialization support | expand

Commit Message

Sarthak Garg Sept. 29, 2023, 10:28 a.m. UTC
Enable MMC_CAP2_SLEEP_AWAKE for Qualcomm controllers to let them use
sleep/awake functionality for faster eMMC resume instead of
doing full initialization.

Signed-off-by: Sarthak Garg <quic_sartgarg@quicinc.com>
---
 drivers/mmc/host/sdhci-msm.c | 1 +
 1 file changed, 1 insertion(+)

--
2.17.1

Comments

Konrad Dybcio Sept. 29, 2023, 11:47 a.m. UTC | #1
On 29.09.2023 12:28, Sarthak Garg wrote:
> Enable MMC_CAP2_SLEEP_AWAKE for Qualcomm controllers to let them use
> sleep/awake functionality for faster eMMC resume instead of
> doing full initialization.
> 
> Signed-off-by: Sarthak Garg <quic_sartgarg@quicinc.com>
> ---
Will this work on all SoCs from MSM8974 to SM8550 inclusive?

Such changes affect all users of this driver.

Konrad
Sarthak Garg Oct. 4, 2023, 10:53 a.m. UTC | #2
On 9/29/2023 5:17 PM, Konrad Dybcio wrote:
> On 29.09.2023 12:28, Sarthak Garg wrote:
>> Enable MMC_CAP2_SLEEP_AWAKE for Qualcomm controllers to let them use
>> sleep/awake functionality for faster eMMC resume instead of
>> doing full initialization.
>>
>> Signed-off-by: Sarthak Garg <quic_sartgarg@quicinc.com>
>> ---
> Will this work on all SoCs from MSM8974 to SM8550 inclusive?
>
> Such changes affect all users of this driver.
>
> Konrad


Yes it will work on all SOC's as its an eMMC card specific feature and 
where the underlying eMMC card supports sleep/awake commands.
Wenchao Chen Oct. 8, 2023, 2:22 a.m. UTC | #3
On Fri, 29 Sept 2023 at 22:44, Sarthak Garg <quic_sartgarg@quicinc.com> wrote:
>
> Enable MMC_CAP2_SLEEP_AWAKE for Qualcomm controllers to let them use
> sleep/awake functionality for faster eMMC resume instead of
> doing full initialization.
>
> Signed-off-by: Sarthak Garg <quic_sartgarg@quicinc.com>
> ---
>  drivers/mmc/host/sdhci-msm.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
> index 668e0aceeeba..be44a6851fc9 100644
> --- a/drivers/mmc/host/sdhci-msm.c
> +++ b/drivers/mmc/host/sdhci-msm.c
> @@ -2627,6 +2627,7 @@ static int sdhci_msm_probe(struct platform_device *pdev)
>         }
>
>         msm_host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY | MMC_CAP_NEED_RSP_BUSY;
> +       msm_host->mmc->caps2 |= MMC_CAP2_SLEEP_AWAKE;
>

Need "MMC_CAP_AGGRESSIVE_PM"?
/*
 * Callback for runtime_suspend.
 */
static int mmc_runtime_suspend(struct mmc_host *host)
{
int err;

if (!(host->caps & MMC_CAP_AGGRESSIVE_PM))
return 0;

err = _mmc_suspend(host, true);
if (err)
pr_err("%s: error %d doing aggressive suspend\n",
mmc_hostname(host), err);

return err;
}



>         /* Set the timeout value to max possible */
>         host->max_timeout_count = 0xF;
> --
> 2.17.1
>
Sarthak Garg Oct. 16, 2023, 9:56 a.m. UTC | #4
On 10/8/2023 7:52 AM, Wenchao Chen wrote:
> On Fri, 29 Sept 2023 at 22:44, Sarthak Garg <quic_sartgarg@quicinc.com> wrote:
>>
>> Enable MMC_CAP2_SLEEP_AWAKE for Qualcomm controllers to let them use
>> sleep/awake functionality for faster eMMC resume instead of
>> doing full initialization.
>>
>> Signed-off-by: Sarthak Garg <quic_sartgarg@quicinc.com>
>> ---
>>   drivers/mmc/host/sdhci-msm.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
>> index 668e0aceeeba..be44a6851fc9 100644
>> --- a/drivers/mmc/host/sdhci-msm.c
>> +++ b/drivers/mmc/host/sdhci-msm.c
>> @@ -2627,6 +2627,7 @@ static int sdhci_msm_probe(struct platform_device *pdev)
>>          }
>>
>>          msm_host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY | MMC_CAP_NEED_RSP_BUSY;
>> +       msm_host->mmc->caps2 |= MMC_CAP2_SLEEP_AWAKE;
>>
> 
> Need "MMC_CAP_AGGRESSIVE_PM"?
> /*
>   * Callback for runtime_suspend.
>   */
> static int mmc_runtime_suspend(struct mmc_host *host)
> {
> int err;
> 
> if (!(host->caps & MMC_CAP_AGGRESSIVE_PM))
> return 0;
> 
> err = _mmc_suspend(host, true);
> if (err)
> pr_err("%s: error %d doing aggressive suspend\n",
> mmc_hostname(host), err);
> 
> return err;
> }
> 
> 
>


Thanks for pointing .. yes this is needed and missed to push this. Will 
push in V3.

Thanks,
Sarthak


>>          /* Set the timeout value to max possible */
>>          host->max_timeout_count = 0xF;
>> --
>> 2.17.1
>>
diff mbox series

Patch

diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index 668e0aceeeba..be44a6851fc9 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -2627,6 +2627,7 @@  static int sdhci_msm_probe(struct platform_device *pdev)
 	}

 	msm_host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY | MMC_CAP_NEED_RSP_BUSY;
+	msm_host->mmc->caps2 |= MMC_CAP2_SLEEP_AWAKE;

 	/* Set the timeout value to max possible */
 	host->max_timeout_count = 0xF;