Skip to content

Commit 16ae16c

Browse files
committed
Merge tag 'mmc-v4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
Pull MMC fixes from Ulf Hansson: "MMC host: - sdhci-of-esdhc: Fix card detection - dw_mmc: Fix DMA error path" * tag 'mmc-v4.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: dw_mmc: fix the error handling for dma operation mmc: sdhci-of-esdhc: fixup PRESENT_STATE read
2 parents bae73e8 + 647f80a commit 16ae16c

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

drivers/mmc/host/dw_mmc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,7 @@ static int dw_mci_submit_data_dma(struct dw_mci *host, struct mmc_data *data)
10581058
spin_unlock_irqrestore(&host->irq_lock, irqflags);
10591059

10601060
if (host->dma_ops->start(host, sg_len)) {
1061+
host->dma_ops->stop(host);
10611062
/* We can't do DMA, try PIO for this one */
10621063
dev_dbg(host->dev,
10631064
"%s: fall back to PIO mode for current transfer\n",

drivers/mmc/host/sdhci-of-esdhc.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,20 @@ static u32 esdhc_readl_fixup(struct sdhci_host *host,
6666
return ret;
6767
}
6868
}
69+
/*
70+
* The DAT[3:0] line signal levels and the CMD line signal level are
71+
* not compatible with standard SDHC register. The line signal levels
72+
* DAT[7:0] are at bits 31:24 and the command line signal level is at
73+
* bit 23. All other bits are the same as in the standard SDHC
74+
* register.
75+
*/
76+
if (spec_reg == SDHCI_PRESENT_STATE) {
77+
ret = value & 0x000fffff;
78+
ret |= (value >> 4) & SDHCI_DATA_LVL_MASK;
79+
ret |= (value << 1) & SDHCI_CMD_LVL;
80+
return ret;
81+
}
82+
6983
ret = value;
7084
return ret;
7185
}

drivers/mmc/host/sdhci.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
#define SDHCI_DATA_LVL_MASK 0x00F00000
7474
#define SDHCI_DATA_LVL_SHIFT 20
7575
#define SDHCI_DATA_0_LVL_MASK 0x00100000
76+
#define SDHCI_CMD_LVL 0x01000000
7677

7778
#define SDHCI_HOST_CONTROL 0x28
7879
#define SDHCI_CTRL_LED 0x01

0 commit comments

Comments
 (0)