[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220305215835.2210388-1-pgwipeout@gmail.com>
Date: Sat, 5 Mar 2022 16:58:33 -0500
From: Peter Geis <pgwipeout@...il.com>
To: unlisted-recipients:; (no To-header on input)
Cc: robin.murphy@....com, linux-rockchip@...ts.infradead.org,
Peter Geis <pgwipeout@...il.com>,
Jaehoon Chung <jh80.chung@...sung.com>,
Ulf Hansson <ulf.hansson@...aro.org>,
Heiko Stuebner <heiko@...ech.de>, linux-mmc@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH v3 0/2] fix dw-mmc-rockchip rk356x clock rates
cc: Jaehoon Chung <jh80.chung@...sung.com>
cc: Ulf Hansson <ulf.hansson@...aro.org>
cc: Heiko Stuebner <heiko@...ech.de>
cc: linux-mmc@...r.kernel.org
cc: linux-arm-kernel@...ts.infradead.org
cc: linux-rockchip@...ts.infradead.org
cc: linux-kernel@...r.kernel.org
While lighting off support for the SoQuartz module, it was discoved the
dw-mmc-rockchip driver has tremendous log spam when the cd-broken flag
is enabled and no card is inserted.
The SoQuart requires the cd-broken flag as the CM4 module pinout it
follows has no card-detect pin.
These errors occur during card initialization on all rk356x chips, but
are amplified by cd-broken as the function is called multiple times each
poll cycle.
It was discovered the lowest possible clock rate the rk356x cru can
provide for the ciu clock in the default configuration is 750khz. There
is an internal clock divider that makes the final minimum clock 375khz.
We could hardcode this, but it is possible it could change if the
default clock configuration changes.
To fix this, we must make two changes:
First, the dw-mmc core needs to be updated to allow a host driver to
save its requested minimum frequency. This is necessary as the mmc_host
struct isn't available when the host drivers initialization code is
called. The dw-mmc core can then apply the f_min later when the struct
is available.
Second, the dw-mmc-rockchip driver is extended to test the frequencies
mmc core will use during card initialization. It finds the lowest
supported frequency from the cru and saves it for later use by dw-mmc
core.
Changelog:
v3:
- add support in dw_mmc core for saving the minimum frequency (fixes
setting f_min)
- add test for the lowest supported frequency to avoid clamping configs
that don't have an error
v2:
- change from muting the error to attempting to fix the underlying issue
by setting f_min in driver initialization
Peter Geis (2):
mmc: host: dw_mmc: support setting f_min from host drivers
mmc: host: dw-mmc-rockchip: fix handling invalid clock rates
drivers/mmc/host/dw_mmc-rockchip.c | 27 +++++++++++++++++++++++----
drivers/mmc/host/dw_mmc.c | 7 ++++++-
drivers/mmc/host/dw_mmc.h | 2 ++
3 files changed, 31 insertions(+), 5 deletions(-)
--
2.25.1
Powered by blists - more mailing lists