EMMC读写操作的调用栈
mmc_queue_thread ->
mmc_blk_issue_rq ->
mmc_blk_issue_rw_rq ->
mmc_start_req ->
__mmc_start_data_req ->
mmc_start_request ->
omap_hsmmc_request
mmc_queue_thread
49 static int mmc_queue_thread(void *d)
50 {
51 struct mmc_queue *mq = d;
52 struct request_queue *q = mq->queue;
53
54 current->flags |= PF_MEMALLOC;
55
56 down(&mq->thread_sem);
57 do {
58 struct request *req = NULL;
59 struct mmc_queue_req *tmp;
60 unsigned int cmd_flags = 0;
61
62 spin_lock_irq(q->queue_lock);
63 set_current_state(TASK_INTERRUPTIBLE);
64 req = blk_fetch_request(q);
65 mq->mqrq_cur->req = req;
66 spin_unlock_irq(q->queue_lock);
67
68 if (req || mq->mqrq_prev->req) {
69 set_current_state(TASK_RUNNING);
70 cmd_flags = req ? req->cmd_flags : 0;
71 mq->issue_fn(mq, req);
72 if (mq->flags & MMC_QUEUE_NEW_REQUEST) {
73 mq->flags &= ~MMC_QUEUE_NEW_REQUEST;
74 continue; /* fetch again */
75 }
76
77 /*
78 * Current request be