linux-stable/drivers/mmc/core
Adrian Hunter 5163af5a5e 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>
2016-09-26 21:31:28 +02:00
..
bus.c mmc: core: implement enhanced strobe support 2016-07-25 10:34:05 +02:00
bus.h mmc: rename dev_to_mmc_card() to mmc_dev_to_card() 2010-10-23 21:11:12 +08:00
core.c mmc: core: Add support for sending commands during data transfer 2016-09-26 21:31:28 +02:00
core.h mmc: fix mmc_{un,}register_pm_notifier prototypes 2015-12-22 11:32:09 +01:00
debugfs.c mmc: debugfs: add HS400 enhanced strobe description 2016-07-25 10:34:06 +02:00
host.c mmc: core: expose MMC_CAP2_NO_* to dt 2016-07-25 10:34:49 +02:00
host.h mmc: host: Add facility to support re-tuning 2015-06-01 09:06:53 +02:00
Kconfig mmc: pwrseq: convert to proper platform device 2016-05-02 10:33:30 +02:00
Makefile mmc: pwrseq: convert to proper platform device 2016-05-02 10:33:30 +02:00
mmc.c mmc: core: Add error message when switching fails in mmc_select_hs() 2016-09-26 21:31:14 +02:00
mmc_ops.c mmc: mmc: fix switch timeout issue caused by jiffies precision 2016-07-25 10:34:09 +02:00
mmc_ops.h mmc: core: Convert __mmc_switch() into an internal core function 2015-10-26 15:59:54 +01:00
pwrseq.c mmc: pwrseq: convert to proper platform device 2016-05-02 10:33:30 +02:00
pwrseq.h mmc: pwrseq: convert to proper platform device 2016-05-02 10:33:30 +02:00
pwrseq_emmc.c mmc: pwrseq: convert to proper platform device 2016-05-02 10:33:30 +02:00
pwrseq_simple.c mmc: pwrseq-simple: Add an optional post-power-on-delay 2016-09-26 21:31:07 +02:00
quirks.c mmc: core: Disable HPI for certain Hynix eMMC cards 2016-07-25 10:34:12 +02:00
sd.c mmc: sd: Export SD Status via “ssr” device attribute 2016-09-26 21:31:09 +02:00
sd.h mmc: drop the speed mode of card's state 2014-05-12 18:05:53 -04:00
sd_ops.c mmc: remove unnecessary assignment statements before return 2016-02-29 11:02:47 +01:00
sd_ops.h mmc: add erase, secure erase, trim and secure trim operations 2010-08-12 08:43:30 -07:00
sdio.c mmc: core: remove redundant memset of sdio_read_cccr 2016-03-17 14:54:41 +01:00
sdio_bus.c mmc: enable MMC/SD/SDIO device to suspend/resume asynchronously 2015-12-22 11:32:16 +01:00
sdio_bus.h
sdio_cis.c mmc: sdio: fall back to SDIO 1.0 for broken 1.1 cards 2016-05-16 11:31:27 +02:00
sdio_cis.h
sdio_io.c mmc: sdio: deploy error handling instead of triggering BUG_ON 2016-09-26 21:31:15 +02:00
sdio_irq.c mmc: core: Remove MMC_CLKGATE 2015-10-26 16:00:09 +01:00
sdio_ops.c mmc: sdio: deploy error handling instead of triggering BUG_ON 2016-09-26 21:31:15 +02:00
sdio_ops.h mmc: Add mmc_is_io_op helper function 2015-10-26 16:00:01 +01:00
slot-gpio.c mmc: slot-gpio: Allow host driver to provide isr for card-detect interrupts 2015-01-19 09:56:29 +01:00
slot-gpio.h mmc: slot-gpio: Make mmc_gpio_alloc() available for MMC core 2015-01-19 09:56:17 +01:00