summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTalel Shenhar <tatias@codeaurora.org>2015-06-29 10:50:19 +0300
committerSubhash Jadavani <subhashj@codeaurora.org>2016-05-31 15:26:51 -0700
commita9c940c044ad74de4d0fe3fdb41432703e61e23a (patch)
treeefb3425a1c2e2d59278cb91871a5a19f2d038a59 /include
parentb98e6c2fa1dd4f4d3ec89f7a9674174b539f83c2 (diff)
mmc: cmdq: add clock scaling for CMDQ mode
This change adds clock scaling ability to command-queueing mode, it does so by adding next logic: * Statistics collection for CMDQ data path * Empty the queue and Halt it before frequency change * Scale from data path in case host claiming is not possible Change-Id: I53a323b55df4d7c27e3ee3426ee4e856e533522c Signed-off-by: Talel Shenhar <tatias@codeaurora.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mmc/core.h6
-rw-r--r--include/linux/mmc/host.h5
2 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 9a3e44f993c2..014eb7e272c6 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -210,6 +210,12 @@ extern int mmc_detect_card_removed(struct mmc_host *host);
extern void mmc_blk_init_bkops_statistics(struct mmc_card *card);
+extern void mmc_deferred_scaling(struct mmc_host *host);
+extern void mmc_cmdq_clk_scaling_start_busy(struct mmc_host *host,
+ bool lock_needed);
+extern void mmc_cmdq_clk_scaling_stop_busy(struct mmc_host *host,
+ bool lock_needed, bool is_cmdq_dcmd);
+
/**
* mmc_claim_host - exclusively claim a host
* @host: mmc host to claim
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index cb46cdf8dcf3..a0b472ba414a 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -237,19 +237,24 @@ struct mmc_slot {
/**
* mmc_cmdq_context_info - describes the contexts of cmdq
* @active_reqs requests being processed
+ * @data_active_reqs data requests being processed
* @curr_state state of cmdq engine
* @req_starved completion should invoke the request_fn since
* no tags were available
* @cmdq_ctx_lock acquire this before accessing this structure
+ * @queue_empty_wq workqueue for waiting for all
+ * the outstanding requests to be completed
*/
struct mmc_cmdq_context_info {
unsigned long active_reqs; /* in-flight requests */
+ unsigned long data_active_reqs; /* in-flight data requests */
unsigned long curr_state;
#define CMDQ_STATE_ERR 0
#define CMDQ_STATE_DCMD_ACTIVE 1
#define CMDQ_STATE_HALT 2
/* no free tag available */
unsigned long req_starved;
+ wait_queue_head_t queue_empty_wq;
};
/**