Files
linux/drivers/mmc/host
Evgeniy Didin 192b050c35 UPSTREAM: mmc: dw_mmc: Fix the DTO/CTO timeout overflow calculation for 32-bit systems
The commit 9d9491a7da ("mmc: dw_mmc: Fix the DTO timeout calculation")
and commit 4c2357f57d ("mmc: dw_mmc: Fix the CTO timeout calculation")
made changes, which cause multiply overflow for 32-bit systems. The
broken
timeout calculations leads to unexpected ETIMEDOUT errors and causes
stacktrace splat (such as below) during normal data exchange with
SD-card.

| Running :  4M-check-reassembly-tcp-cmykw2-rotatew2.out -v0 -w1
| -  Info: Finished target initialization.
| mmcblk0: error -110 transferring data, sector 320544, nr 2048, cmd
| response 0x900, card status 0x0

DIV_ROUND_UP_ULL helps to escape usage of __udivdi3() from libgcc and so
code gets compiled on all 32-bit platforms as opposed to usage of
DIV_ROUND_UP when we may only compile stuff on a very few arches.

Lets cast this multiply to u64 type to prevent the overflow.

Change-Id: I45462bac22f946c5129eab0e0d5b22b3ed7ca19d
Fixes: 9d9491a7da ("mmc: dw_mmc: Fix the DTO timeout calculation")
Fixes: 4c2357f57d ("mmc: dw_mmc: Fix the CTO timeout calculation")
Tested-by: Vineet Gupta <Vineet.Gupta1@synopsys.com>
Reported-by: Vineet Gupta <Vineet.Gupta1@synopsys.com> # ARC STAR
9001306872 HSDK, sdio: board crashes when copying big files
Signed-off-by: Evgeniy Didin <Evgeniy.Didin@synopsys.com>
Cc: <stable@vger.kernel.org> # 4.14
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Reviewed-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
(cherry picked from c715160225)
2018-03-07 08:46:47 +08:00
..
2015-11-11 15:57:28 +08:00
2015-11-11 15:54:30 +08:00
2015-11-11 15:54:30 +08:00
2015-11-11 15:54:30 +08:00
2013-08-24 23:45:22 -04:00
2016-10-07 15:23:41 +02:00
2014-06-16 15:52:38 +08:00
2014-06-16 15:52:38 +08:00
2015-11-10 10:55:33 +08:00
2015-11-11 15:57:28 +08:00
2015-11-11 15:57:28 +08:00
2015-11-11 15:57:28 +08:00
2015-11-11 15:54:30 +08:00
2014-09-24 10:13:09 +02:00
2015-11-11 15:57:28 +08:00
2015-11-11 15:54:30 +08:00
2015-06-01 09:06:48 +02:00
2015-01-19 09:56:07 +01:00
2017-03-30 09:35:17 +02:00
2015-10-26 15:59:53 +01:00
2015-03-23 14:13:49 +01:00