1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef LINUX_MMC_HSQ_H
3 #define LINUX_MMC_HSQ_H
5 #define HSQ_NUM_SLOTS 64
6 #define HSQ_INVALID_TAG HSQ_NUM_SLOTS
9 * For MMC host software queue, we only allow 2 requests in
10 * flight to avoid a long latency.
12 #define HSQ_NORMAL_DEPTH 2
14 * For 4k random writes, we allow hsq_depth to increase to 5
15 * for better performance.
17 #define HSQ_PERFORMANCE_DEPTH 5
20 struct mmc_request *mrq;
25 struct mmc_request *mrq;
26 wait_queue_head_t wait_queue;
27 struct hsq_slot *slot;
29 struct work_struct retry_work;
35 int tag_slot[HSQ_NUM_SLOTS];
38 bool waiting_for_idle;
42 int mmc_hsq_init(struct mmc_hsq *hsq, struct mmc_host *mmc);
43 void mmc_hsq_suspend(struct mmc_host *mmc);
44 int mmc_hsq_resume(struct mmc_host *mmc);
45 bool mmc_hsq_finalize_request(struct mmc_host *mmc, struct mmc_request *mrq);