summaryrefslogtreecommitdiff
path: root/drivers/mmc/card/mmc_test.c
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2016-08-16 13:44:11 +0300
committerUlf Hansson <ulf.hansson@linaro.org>2016-09-26 22:31:28 +0300
commit5163af5a5e2e69c9a5a854b92ffa7e2f7672dbf7 (patch)
tree82872dec25095ab7a7dce194036edda4b3e7fcb1 /drivers/mmc/card/mmc_test.c
parent6a3d8ced09482bd5b0e831740d83ed722aa2c5e6 (diff)
downloadlinux-5163af5a5e2e69c9a5a854b92ffa7e2f7672dbf7.tar.xz
mmc: core: Add support for sending commands during data transfer
A host controller driver exposes its capability using caps flag MMC_CAP_CMD_DURING_TFR. A driver with that capability can accept requests that are marked mrq->cap_cmd_during_tfr = true. Then the driver informs the upper layers when the command line is available for further commands by calling mmc_command_done(). Because of that, the driver will not then automatically send STOP commands, and it is the responsibility of the upper layer to send a STOP command if it is required. For requests submitted through the mmc_wait_for_req() interface, the caller sets mrq->cap_cmd_during_tfr = true which causes mmc_wait_for_req() in fact not to wait. The caller can then send commands that do not use the data lines. Finally the caller can wait for the transfer to complete by calling mmc_wait_for_req_done() which is now exported. For requests submitted through the mmc_start_req() interface, the caller again sets mrq->cap_cmd_during_tfr = true, but mmc_start_req() anyway does not wait. The caller can then send commands that do not use the data lines. Finally the caller can wait for the transfer to complete in the normal way i.e. calling mmc_start_req() again. Irrespective of how a cap_cmd_during_tfr request is started, mmc_is_req_done() can be called if the upper layer needs to determine if the request is done. However the appropriate waiting function (either mmc_wait_for_req_done() or mmc_start_req()) must still be called. The implementation consists primarily of a new completion mrq->cmd_completion which notifies when the command line is available for further commands. That completion is completed by mmc_command_done(). When there is an ongoing data transfer, calls to mmc_wait_for_req() will automatically wait on that completion, so the caller does not have to do anything special. Note, in the case of errors, the driver may call mmc_request_done() without calling mmc_command_done() because mmc_request_done() always calls mmc_command_done(). Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/card/mmc_test.c')
0 files changed, 0 insertions, 0 deletions