lkml.org 
[lkml]   [2011]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRFC : mmc : Use wait_for_completion_timeout() instead of wait_for_completion in case of multiple write blocks.
From
Hi.

If card is infinitely holding pull down busy line(data 0) while
writing multiple blocks, write will be blocked in
mmc_wait_for_req_done().
I suggest to use wait_for_completion_timeout instread of
wait_for_completion like the below code.

How do you think about my suggestion ?

Thanks.

------------------------------------------------------------------------------------------------------------------
static void mmc_wait_for_req_done(struct mmc_host *host, struct
mmc_request *mrq)
{
unsigned int write_timeout = 0;

if(mrq->data != NULL && (mrq->data->flags & MMC_DATA_WRITE) &&
(mrq->cmd->opcode & MMC_WRITE_MULTIPLE_BLOCK)) {
write_timeout =
usecs_to_jiffies(mrq->data->timeout_ns/1000) * mrq->data->blocks;
wait_for_completion_timeout(&mrq->completion, write_timeout);
}
else wait_for_completion(&mrq->completion);
}


\
 
 \ /
  Last update: 2011-08-25 06:47    [W:0.103 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site