mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
drivers: mmc: sdhci: add SPURIOUS_INT_RESP quirk
Certain controllers (dwc-mshc) generate timeout conditions separately to command-completion conditions, where the end result is interrupts are separated in time depending on the current SDCLK frequency. This causes spurious interrupts if SDCLK is slow compared to the CPU's ability to process and return from interrupt. This occurs during card probe with an empty slot where all commands that would generate a response time out. Add a quirk to squelch command response interrupts when a command timeout interrupt is received. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
This commit is contained in:
committed by
Dom Cobley
parent
63181fb711
commit
a22bff27ff
@@ -1736,6 +1736,12 @@ static bool sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd)
|
||||
if (host->use_external_dma)
|
||||
sdhci_external_dma_pre_transfer(host, cmd);
|
||||
|
||||
if (host->quirks2 & SDHCI_QUIRK2_SPURIOUS_INT_RESP) {
|
||||
host->ier |= SDHCI_INT_RESPONSE;
|
||||
sdhci_writel(host, host->ier, SDHCI_INT_ENABLE);
|
||||
sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE);
|
||||
}
|
||||
|
||||
sdhci_writew(host, SDHCI_MAKE_CMD(cmd->opcode, flags), SDHCI_COMMAND);
|
||||
|
||||
return true;
|
||||
@@ -3342,6 +3348,11 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask, u32 *intmask_p)
|
||||
if (intmask & SDHCI_INT_TIMEOUT) {
|
||||
host->cmd->error = -ETIMEDOUT;
|
||||
sdhci_err_stats_inc(host, CMD_TIMEOUT);
|
||||
if (host->quirks2 & SDHCI_QUIRK2_SPURIOUS_INT_RESP) {
|
||||
host->ier &= ~SDHCI_INT_RESPONSE;
|
||||
sdhci_writel(host, host->ier, SDHCI_INT_ENABLE);
|
||||
sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE);
|
||||
}
|
||||
} else {
|
||||
host->cmd->error = -EILSEQ;
|
||||
if (!mmc_op_tuning(host->cmd->opcode))
|
||||
|
||||
@@ -542,6 +542,9 @@ struct sdhci_host {
|
||||
#define SDHCI_QUIRK2_NO_SDR50 (1<<20)
|
||||
#define SDHCI_QUIRK2_NO_SDR104 (1<<21)
|
||||
|
||||
/* Command timeouts may generate a trailing INT_RESPONSE later */
|
||||
#define SDHCI_QUIRK2_SPURIOUS_INT_RESP (1<<31)
|
||||
|
||||
int irq; /* Device IRQ */
|
||||
void __iomem *ioaddr; /* Mapped address */
|
||||
phys_addr_t mapbase; /* physical address base */
|
||||
|
||||
Reference in New Issue
Block a user