aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/card/queue.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/card/queue.h')
-rw-r--r--drivers/mmc/card/queue.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/mmc/card/queue.h b/drivers/mmc/card/queue.h
index be58b3c..f1ba6df 100644
--- a/drivers/mmc/card/queue.h
+++ b/drivers/mmc/card/queue.h
@@ -46,6 +46,8 @@ struct mmc_queue {
struct mmc_queue_req mqrq[2];
struct mmc_queue_req *mqrq_cur;
struct mmc_queue_req *mqrq_prev;
+ /* Jiffies until which disable packed command. */
+ unsigned long nopacked_period;
};
extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *,
@@ -59,4 +61,20 @@ extern unsigned int mmc_queue_map_sg(struct mmc_queue *,
extern void mmc_queue_bounce_pre(struct mmc_queue_req *);
extern void mmc_queue_bounce_post(struct mmc_queue_req *);
+#define IS_RT_CLASS_REQ(x) \
+ (IOPRIO_PRIO_CLASS(req_get_ioprio(x)) == IOPRIO_CLASS_RT)
+
+static inline void mmc_set_nopacked_period(struct mmc_queue *mq,
+ unsigned long nopacked_jiffies)
+{
+ mq->nopacked_period = jiffies + nopacked_jiffies;
+ smp_wmb();
+}
+
+static inline int mmc_is_nopacked_period(struct mmc_queue *mq)
+{
+ smp_rmb();
+ return (int)time_is_after_jiffies(mq->nopacked_period);
+}
+
#endif