- There is no need to keep the tuning error and re-tuning interrupts

enabled (though, no interrupt generation enabled for them) all the
  time as soon as (re-)tuning is supported; only enable them and let
  them generate interrupts when actually using (re-)tuning.
- Also disable all interrupts except SDHCI_INT_DATA_AVAIL ones while
  executing tuning and not just their signaling.
This commit is contained in:
Marius Strobl 2017-12-29 12:48:19 +00:00
parent f813e520c2
commit cc22204bbc

View File

@ -301,7 +301,7 @@ sdhci_init(struct sdhci_slot *slot)
slot->intmask |= SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT;
}
WR4(slot, SDHCI_INT_ENABLE, slot->intmask | sdhci_tuning_intmask(slot));
WR4(slot, SDHCI_INT_ENABLE, slot->intmask);
WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask);
}
@ -654,6 +654,7 @@ sdhci_card_task(void *arg, int pending __unused)
xpt_rescan(ccb);
#else
slot->intmask &= ~sdhci_tuning_intmask(slot);
WR4(slot, SDHCI_INT_ENABLE, slot->intmask);
WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask);
slot->opt &= ~SDHCI_TUNING_ENABLED;
SDHCI_UNLOCK(slot);
@ -1338,6 +1339,7 @@ sdhci_generic_tune(device_t brdev __unused, device_t reqdev, bool hs400)
if (err == 0) {
slot->opt |= SDHCI_TUNING_ENABLED;
slot->intmask |= sdhci_tuning_intmask(slot);
WR4(slot, SDHCI_INT_ENABLE, slot->intmask);
WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask);
if (slot->retune_ticks) {
callout_reset(&slot->retune_callout, slot->retune_ticks,
@ -1406,6 +1408,7 @@ sdhci_exec_tuning(struct sdhci_slot *slot, bool reset)
*/
intmask = slot->intmask;
slot->intmask = SDHCI_INT_DATA_AVAIL;
WR4(slot, SDHCI_INT_ENABLE, SDHCI_INT_DATA_AVAIL);
WR4(slot, SDHCI_SIGNAL_ENABLE, SDHCI_INT_DATA_AVAIL);
hostctrl2 = RD2(slot, SDHCI_HOST_CONTROL2);
@ -1438,6 +1441,7 @@ sdhci_exec_tuning(struct sdhci_slot *slot, bool reset)
slot->opt = opt;
slot->intmask = intmask;
WR4(slot, SDHCI_INT_ENABLE, intmask);
WR4(slot, SDHCI_SIGNAL_ENABLE, intmask);
if ((hostctrl2 & (SDHCI_CTRL2_EXEC_TUNING |