sdhci: add quirk for the Marvell CaFe's interrupt timeout
PATCH 2/2 sdhci: add quirk for the Marvell CaFe's interrupt timeout
[Note that this is against Pierre's mmc/next branch]
The CaFe chip has a hardware bug that ends up with us getting a timeout value that's too small, causing the following sorts of problems:
[ 60.525138] mmcblk0: error -110 transferring data [ 60.531477] end_request: I/O error, dev mmcblk0, sector 1484353 [ 60.533371] Buffer I/O error on device mmcblk0p2, logical block 181632 [ 60.533371] lost page write due to I/O error on mmcblk0p2
To play it safe, we simply set the timeout to the max possible value (0xE), and that works. It also breaks the timeout calculation logic out into a separate function.
Mitch verified that using 0xE instead of 0xC in OFW fixed timeout problems for a user with an 8GB card, as well.
Signed-off-by Andres Salomon <[email protected]>
--- drivers/mmc/host/sdhci-pci.c | 3 +- drivers/mmc/host/sdhci.c | 43 +++++++++++++++++++++++++++++------------ drivers/mmc/host/sdhci.h | 2 + 3 files changed, 34 insertions(+), 14 deletions(-)
drivers/mmc/host/sdhci-pci.c +2 -1
@@ -105,7 +105,8 @@ static const struct sdhci_pci_fixes sdhci_ene_714 = { };static const struct sdhci_pci_fixes sdhci_cafe = { - .quirks =SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER , + .quirks =SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER | +SDHCI_QUIRK_BROKEN_TIMEOUT_VAL , };static int jmicron_pmos (struct sdhci_pci_chip *chip,int on)
drivers/mmc/host/sdhci.c +30 -13
59 lines not on this page · raw message
drivers/mmc/host/sdhci.h +2 -0
@@ -178,6 +178,8 @@ struct sdhci_host {#define SDHCI_QUIRK_RESET_AFTER_REQUEST (1<<8)/* Controller needs voltage and power writes to happen separately */ #define SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER (1<<9) +/* Controller provides an incorrect timeout value for transfers */ +#define SDHCI_QUIRK_BROKEN_TIMEOUT_VAL (1<<10)int irq;/* Device IRQ */ void __iomem * ioaddr;/* Mapped address */
Signature · 1 line
1.5.5.3