[PATCH 1/4] mmc: dw_mmc: add central watchdog and convert CTO onto it
Shawn Lin
shawn.lin at rock-chips.com
Mon Nov 30 18:22:38 PST 2026
在 2026/11/30 星期一 19:12, Francesco Saverio Pavone 写道:
> Hi Shawn,
>
>> The CRC error case may come from the abort command which didn't
>> disarm the watchdog. Could you help test the patch below:
>>
>> https://lore.kernel.org/linux-mmc/20261123191703.179283-12-lee@kernel.org/
>
> Tested on the ROCK 5B+: plain v7.4-rc4 against v7.4-rc4 plus that
> patch, five boots each, alternating.
>
> v7.4-rc4 "Data timeout, state 3" once in 5 of 5 boots
> v7.4-rc4 + patch "Data timeout, state 3" once in 5 of 5 boots
>
> Tuning succeeded in all ten (phase 59, 69 or 70), 36 to 70 ms after
> the switch to 198 MHz. The warning comes 0.4 to 2.5 ms before the
> "Successfully tuned" line, and there were no other mmc messages. So
> the patch does not change this warning here.
>
> The message points the same way in all ten boots. dw_mmc prints "Data
> timeout" only when the data events are the ones being watched, and
> state 3 is STATE_DATA_BUSY, so the request is still open and waiting
> for data-over.
drto timeout, 15ms, is safe enough for just one time tuning. So this
matches what you saw here, the requesting was still going, the MINTST
was empty, and watchdog fired out. The same event (a tuning command is
declared "data timeout", DRTO is synthesized, the transfer ends) while
in STATE_DATA_BUSY with an empty MINTSTS already existed before the
central watchdog series.
The old code synthesized DRTO on that branch silently (no print). The
series (strictly speaking, ec0db371236e which moved DTO onto the central
watchdog) only added a dev_warn, so it changed a silent recovery into a
visible warning.
static void dw_mci_dto_timer(struct timer_list *t)
{
...
switch (host->state) {
case STATE_SENDING_DATA:
case STATE_DATA_BUSY:
host->data_status = SDMMC_INT_DRTO;
set_bit(EVENT_DATA_ERROR, &host->pending_events);
set_bit(EVENT_DATA_COMPLETE, &host->pending_events);
queue_work(system_bh_wq, &host->bh_work);
break; /* <- no warning: DRTO synthesized silently */
...
}
So bascilly, I suggest to change this dev_warn to dev_dbg.
> Francesco
>
More information about the Linux-rockchip
mailing list