]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: sdhci: Reduce maximum time under spinlock in sdhci_send_command()
authorAdrian Hunter <adrian.hunter@intel.com>
Sun, 12 Apr 2020 09:03:49 +0000 (12:03 +0300)
committerUlf Hansson <ulf.hansson@linaro.org>
Thu, 28 May 2020 09:20:59 +0000 (11:20 +0200)
commit1c3a585de886ac8ab3c10119c26e7906c18f9e12
treee79a4bd1046c0989ef265d2394377d163df510e8
parentcc0cc6689b0dd2f7467521be2f7d445eba8db7fd
mmc: sdhci: Reduce maximum time under spinlock in sdhci_send_command()

Spending time under spinlock increases IRQ latencies and also
response times because preemption is disabled.

sdhci_send_command() waits up to 10 ms under spinlock for inhibit bits
to clear. In general inhibit bits will not be set, but there may be
corner cases, especially in the face of errors, where waiting helps.
There might also be dysfunctional hardware that needs the waiting. So
retain the legacy behaviour but do not wait for inhibit bits while under
spinlock. Instead adjust the logic to enable waiting while not under
spinlock. That is mostly straight forward, but in the interrupt handler
it requires deferring an "inhibited" command to the IRQ thread where
sleeping is allowed.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Tested-by: Baolin Wang <baolin.wang7@gmail.com>
Link: https://lore.kernel.org/r/20200412090349.1607-6-adrian.hunter@intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci.c
drivers/mmc/host/sdhci.h