]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: dw-mmc-rockchip: Fix handling invalid clock rates
authorPeter Geis <pgwipeout@gmail.com>
Sat, 5 Mar 2022 21:58:35 +0000 (16:58 -0500)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 7 Mar 2022 11:56:48 +0000 (12:56 +0100)
commit274259686d8d890d208fae6409b0af96baf240d6
tree906e7a07330f594bfcbf3b7c3f646aac2ab55da5
parent0a907a3259802d80c99d4dcdc21f483b854ccc11
mmc: dw-mmc-rockchip: Fix handling invalid clock rates

The Rockchip rk356x ciu clock cannot be set as low as the dw-mmc
hardware supports. This leads to a situation during card initialization
where the clock is set lower than the clock driver can support. The
dw-mmc-rockchip driver spews errors when this happens.
For normal operation this only happens a few times during boot, but when
cd-broken is enabled (in cases such as the SoQuartz module) this fires
multiple times each poll cycle.

Fix this by testing the lowest possible frequency that the clock driver
can support which is within the mmc specification. Divide that rate by
the internal divider and set f_min to this.

Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Link: https://lore.kernel.org/r/20220305215835.2210388-3-pgwipeout@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/dw_mmc-rockchip.c