Author: marius
Date: Fri Dec 29 12:48:19 2017
New Revision: 327339
URL: https://svnweb.freebsd.org/changeset/base/327339

Log:
  - 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.

Modified:
  head/sys/dev/sdhci/sdhci.c

Modified: head/sys/dev/sdhci/sdhci.c
==============================================================================
--- head/sys/dev/sdhci/sdhci.c  Fri Dec 29 12:47:23 2017        (r327338)
+++ head/sys/dev/sdhci/sdhci.c  Fri Dec 29 12:48:19 2017        (r327339)
@@ -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 r
        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 |
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to