Loading...
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef LINUX_MMC_HSQ_H
3#define LINUX_MMC_HSQ_H
4
5#define HSQ_NUM_SLOTS 64
6#define HSQ_INVALID_TAG HSQ_NUM_SLOTS
7
8struct hsq_slot {
9 struct mmc_request *mrq;
10};
11
12struct mmc_hsq {
13 struct mmc_host *mmc;
14 struct mmc_request *mrq;
15 wait_queue_head_t wait_queue;
16 struct hsq_slot *slot;
17 spinlock_t lock;
18 struct work_struct retry_work;
19
20 int next_tag;
21 int num_slots;
22 int qcnt;
23 int tail_tag;
24 int tag_slot[HSQ_NUM_SLOTS];
25
26 bool enabled;
27 bool waiting_for_idle;
28 bool recovery_halt;
29};
30
31int mmc_hsq_init(struct mmc_hsq *hsq, struct mmc_host *mmc);
32void mmc_hsq_suspend(struct mmc_host *mmc);
33int mmc_hsq_resume(struct mmc_host *mmc);
34bool mmc_hsq_finalize_request(struct mmc_host *mmc, struct mmc_request *mrq);
35
36#endif
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef LINUX_MMC_HSQ_H
3#define LINUX_MMC_HSQ_H
4
5struct hsq_slot {
6 struct mmc_request *mrq;
7};
8
9struct mmc_hsq {
10 struct mmc_host *mmc;
11 struct mmc_request *mrq;
12 wait_queue_head_t wait_queue;
13 struct hsq_slot *slot;
14 spinlock_t lock;
15 struct work_struct retry_work;
16
17 int next_tag;
18 int num_slots;
19 int qcnt;
20
21 bool enabled;
22 bool waiting_for_idle;
23 bool recovery_halt;
24};
25
26int mmc_hsq_init(struct mmc_hsq *hsq, struct mmc_host *mmc);
27void mmc_hsq_suspend(struct mmc_host *mmc);
28int mmc_hsq_resume(struct mmc_host *mmc);
29bool mmc_hsq_finalize_request(struct mmc_host *mmc, struct mmc_request *mrq);
30
31#endif