Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / mmc / host / mmc_hsq.h
blobdd352a6ac32acd115122a771daf0dcbc65225def
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
8 /*
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
19 struct hsq_slot {
20 struct mmc_request *mrq;
23 struct mmc_hsq {
24 struct mmc_host *mmc;
25 struct mmc_request *mrq;
26 wait_queue_head_t wait_queue;
27 struct hsq_slot *slot;
28 spinlock_t lock;
29 struct work_struct retry_work;
31 int next_tag;
32 int num_slots;
33 int qcnt;
34 int tail_tag;
35 int tag_slot[HSQ_NUM_SLOTS];
37 bool enabled;
38 bool waiting_for_idle;
39 bool recovery_halt;
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);
47 #endif