Skip to content
  • Hai Pham's avatar
    mmc: Introduce mmc_send_stop_transmission() · 0ac2cca3
    Hai Pham authored and Jaehoon Chung's avatar Jaehoon Chung committed
    
    
    If a tuning command times out, the card could still be processing it,
    which will cause problems for recovery. The eMMC specification section
    6.6 Data transfer mode (cont’d) claims that CMD12 can be used to stop
    CMD21:
    "
    The relationship between the various data transfer modes is summarized (see Figure 27):
    - All data read commands can be aborted any time by the stop command (CMD12).
      The data transfer will terminate and the Device will return to the Transfer State.
      The read commands are: ... send tuning block (CMD21) ....
    "
    Add a function that does that.
    
    Based on Linux commit [1] and [2].
    
    [1] e711f0309109 ("mmc: mmc: Introduce mmc_abort_tuning()")
    [2] 21adc2e45f4e ("mmc: Improve function name when aborting a tuning
    cmd")
    
    Reviewed-by: default avatarTakeshi Kihara <takeshi.kihara.df@renesas.com>
    Reviewed-by: default avatarMarek Vasut <marek.vasut+renesas@mailbox.org>
    Signed-off-by: default avatarHai Pham <hai.pham.ud@renesas.com>
    Signed-off-by: default avatarMarek Vasut <marek.vasut+renesas@mailbox.org>
    [Marek: Update commit message, quote relevant part of the specification.
            Rename to mmc_send_stop_transmission().
    	Remove tuning opcode check, this is controller driver specific.
    	Deduplicate part of mmc_read_blocks() using this function.]
    Reviewed-by: Peng Fan's avatarPeng Fan <peng.fan@nxp.com>
    0ac2cca3