Skip to content

Commit bc6e99f

Browse files
committed
mmc: dw_mmc: Fix the CTO timeout overflow calculation for 32-bit systems
Just follow the convention of fixing for DTO timeout. Change-Id: I753b5a6f2ab409e58c83a59212592f3b430b018a Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
1 parent 9c8f6bb commit bc6e99f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/mmc/host/dw_mmc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,8 @@ static inline void dw_mci_set_cto(struct dw_mci *host)
376376
cto_div = (mci_readl(host, CLKDIV) & 0xff) * 2;
377377
if (cto_div == 0)
378378
cto_div = 1;
379-
cto_ms = DIV_ROUND_UP(MSEC_PER_SEC * cto_clks * cto_div, host->bus_hz);
379+
cto_ms = DIV_ROUND_UP_ULL(MSEC_PER_SEC * cto_clks * cto_div,
380+
host->bus_hz);
380381

381382
/* add a bit spare time */
382383
cto_ms += 10;

0 commit comments

Comments
 (0)