• Addy Ke's avatar
    mmc: dw_mmc: add quirk for broken data transfer over scheme · 57e10486
    Addy Ke authored
    This patch add a new quirk to add a s/w timer to notify the driver
    to terminate current transfer and report a data timeout to the core,
    if DTO interrupt does NOT come within the given time.
    
    dw_mmc call mmc_request_done func to finish transfer depends on
    DTO interrupt. If DTO interrupt does not come in sending data state,
    the current transfer will be blocked.
    
    We got the reply from synopsys:
    There are two counters but both use the same value of [31:8] bits.
    Data timeout counter doesn't wait for stop clock and you should get
    DRTO even when the clock is not stopped.
    Host Starvation timeout counter is triggered with stop clock condition.
    
    This means that host should get DRTO and DTO interrupt.
    
    But this case really exists, when driver reads tuning data from
    card on RK3288-pink2 board. I measured waveforms by oscilloscope
    and found that card clock was always on and data lines were always
    holded high level in sending data state.
    
    There are two possibility that data over interrupt doesn't come in
    reading data state on RK3X SoCs:
    - get command done interrupt, but doesn't get any data-related interrupt.
    - get data error interrupt, but doesn't get data over interrupt.
    Signed-off-by: default avatarAddy Ke <addy.ke@rock-chips.com>
    Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
    Signed-off-by: default avatarJaehoon Chung <jh80.chung@samsung.com>
    57e10486
dw_mmc.c 77.8 KB