mmc: cb710: Inform the mmc core about the maximum busy timeout
authorUlf Hansson <ulf.hansson@linaro.org>
Tue, 14 Apr 2020 16:14:00 +0000 (18:14 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Thu, 28 May 2020 09:22:13 +0000 (11:22 +0200)
commit85a3f77c1be5ee143615e47f98f653d65806b8ae
treef49f05a56a80ab5520b55fc33bd194e0b5536441
parentf4f20d6897b1c047c5d38b2cfc50928e83d8fd83
mmc: cb710: Inform the mmc core about the maximum busy timeout

Some commands uses R1B responses, which means the card may assert the DAT0
line to signal busy for a period of time, after it has received the
command. The mmc core normally specifies the busy period for the command in
the cmd->busy_timeout. Ideally the driver should respect it, but that
requires quite some update of the code, so let's defer that to someone with
the HW at hand.

Instead, let's inform the mmc core about the maximum supported busy timeout
in ->max_busy_timeout during ->probe(). This value corresponds to the fixed
~2s timeout of the polling loop, implemented in cb710_wait_for_event(). In
this way, we let the mmc core validate the needed timeout, which may lead
to that it converts from a R1B into a R1 response and then use CMD13 to
poll for busy completion.

In other words, this change enables support for commands with longer busy
periods than 2s, like erase (CMD38) for example.

Cc: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20200414161413.3036-7-ulf.hansson@linaro.org
drivers/mmc/host/cb710-mmc.c