[PATCH] mmc: dw_mmc: Fix FIFO data transfer timeout

Jonas Karlman jonas at kwiboo.se
Tue Oct 8 10:20:54 CEST 2024


Hi,

On 2024-10-08 03:19, Peng Fan wrote:
>> Subject: [PATCH] mmc: dw_mmc: Fix FIFO data transfer timeout
>>
>> The commit 0252924ac6d4 ("mmc: dw_mmc: Extract FIFO data
>> transfer into a separate routine") unintentionally changed behavior of
>> the FIFO data transfer routine.
>>
>> When data is read and size reaches 0 the original loop would wait on
>> DWMCI_INTMSK_DTO or timeout. The remaining size to read is no
>> longer tracked across dwmci_data_transfer_fifo() calls and because of
>> this an extra call to fifo() and dwmci_fifo_ready() may now trigger a
>> FIFO underflow timeout.
>>
>>   Buswidth = 4, clock: 50000000
>>   Sending CMD16
>>   Sending CMD17
>>   dwmci_fifo_ready: FIFO underflow timeout
>>   Sending CMD16
>>   Sending CMD18
>>   dwmci_fifo_ready: FIFO underflow timeout
>>   Sending CMD12
>>   ## Checking hash(es) for config config-1 ... OK
>>
>> Restore old behavior and track remaining size to read across calls to fix
>> this.
>>
>> Fixes: 0252924ac6d4 ("mmc: dw_mmc: Extract FIFO data transfer into
>> a separate routine")
>> Signed-off-by: Jonas Karlman <jonas at kwiboo.se>
> 
> LGTM: Reviewed-by: Peng Fan <peng.fan at nxp.com>

Thanks, however after looking at this with fresh eyes a full revert of
the offending commit may instead be a better option.

The target/source buf is also not carried over and is reset for each
call to fifo(), not sure if resuming a read or write is even
needed/useful/wanted/possible.

I will send a v2 with a revert of the offending commit later after more
testing. Someone can then take a new look at refactoring FIFO handling.

Regards,
Jonas


More information about the U-Boot mailing list