Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ffce7f22 authored by Sahitya Tummala's avatar Sahitya Tummala Committed by Xiaonian Wang
Browse files

mmc: sdhci: Vote for new IRQ specific QoS request



The current vote applies to all CPUs and hence may have power
impact, especially when there are more number of CPUs. The new
IRQ specific QoS request shall update the vote only for one
CPU to which the IRQ's smp_affinity attribute is set to.

Change-Id: I55298f729949c39ebfa3eecd4746d77e40cb2e5c
Signed-off-by: default avatarSahitya Tummala <stummala@codeaurora.org>
[xiaonian@codeaurora.org: fix trivial merge conflict]
Signed-off-by: default avatarXiaonian Wang <xiaonian@codeaurora.org>
parent be406d93
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -3352,6 +3352,27 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev,

EXPORT_SYMBOL_GPL(sdhci_alloc_host);
	
#ifdef CONFIG_SMP
static void sdhci_set_pmqos_req_type(struct sdhci_host *host)
{

	/*
	 * The default request type PM_QOS_REQ_ALL_CORES is
	 * applicable to all CPU cores that are online and
	 * this would have a power impact when there are more
	 * number of CPUs. This new PM_QOS_REQ_AFFINE_IRQ request
	 * type shall update/apply the vote only to that CPU to
	 * which this IRQ's affinity is set to.
	 */
	host->pm_qos_req_dma.type = PM_QOS_REQ_AFFINE_IRQ;
	host->pm_qos_req_dma.irq = host->irq;
}
#else
static void sdhci_set_pmqos_req_type(struct sdhci_host *host)
{
}
#endif

static int sdhci_set_dma_mask(struct sdhci_host *host)
{
	struct mmc_host *mmc = host->mmc;
@@ -3951,6 +3972,7 @@ int __sdhci_add_host(struct sdhci_host *host)

	if (host->cpu_dma_latency_us) {
		host->pm_qos_timeout_us = 10000; /* default value */
		sdhci_set_pmqos_req_type(host);
		pm_qos_add_request(&host->pm_qos_req_dma,
				PM_QOS_CPU_DMA_LATENCY, PM_QOS_DEFAULT_VALUE);