Send CMD12 to terminate the mmc writing request?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am a fresher to linux kernel and now trying to add some features to
mmc driver.

One of the features is that terminate a long time writing request(e.x.
lasts 50ms or more), and make the following reading request run.

I read the JEDEC STANDARD and found that a writing operation could be
terminated with sending a STOP_TRANSMISSION(CMD12).
But I am not quite sure how I can send the command.

Here is the working flow I am working in:

1) In the function mmc_blk_issue_rq() @ drivers/mmc/card/block.c
 before mmc_wait_for_req() is called, check if the request to be
issued is WRITE.
 If it is a WRITE request, add a timer of 50ms to check whether it
is a long time writing operation.
2) In the timeout callback function, get the next request in the queue
and check whether it is a READ request.
 If it is a READ request, send a STOP_TRANSMISSION command with
mmc_wait_for_cmd() to terminate the request.

But I got some fault messages when I sent the STOP_TRANSMISSION
command.

It seems that without completing the WRITE request sent by
mmc_wait_for_req(), the STOP_TRANSMISSION command(sent with
mmc_wait_for_cmd() ) could not be accepted, because in the function of
mmc_wait_for_cmd(), mmc_wait_for_req() is called.
And that is why I got the fault messages.

So my question is,
How to send a STOP_TRANSMISSION command to terminate the writing
request in my case.


Thanks!
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux