diff options
author | Olof Johansson <olof@lixom.net> | 2011-01-01 19:37:32 -0500 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-01-08 23:52:23 -0500 |
commit | 30652aa36b58d57fcc1a0acce51e391bbb6edf5e (patch) | |
tree | 80743c840e0456381b4e1aea223661eb694a976e | |
parent | c288b85554097a3d1271f935c48b442280b2db9e (diff) |
mmc: sdhci: add quirk for max len ADMA descriptors
Some controllers misparse segment length 0 as being 0, not 65536. Add
a quirk to deal with it.
Signed-off-by: Olof Johansson <olof@lixom.net>
Reviewed-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r-- | drivers/mmc/host/sdhci.c | 10 | ||||
-rw-r--r-- | include/linux/mmc/sdhci.h | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index d5febe584b0..9e15f41f87b 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -1949,10 +1949,14 @@ int sdhci_add_host(struct sdhci_host *host) | |||
1949 | * of bytes. When doing hardware scatter/gather, each entry cannot | 1949 | * of bytes. When doing hardware scatter/gather, each entry cannot |
1950 | * be larger than 64 KiB though. | 1950 | * be larger than 64 KiB though. |
1951 | */ | 1951 | */ |
1952 | if (host->flags & SDHCI_USE_ADMA) | 1952 | if (host->flags & SDHCI_USE_ADMA) { |
1953 | mmc->max_seg_size = 65536; | 1953 | if (host->quirks & SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC) |
1954 | else | 1954 | mmc->max_seg_size = 65535; |
1955 | else | ||
1956 | mmc->max_seg_size = 65536; | ||
1957 | } else { | ||
1955 | mmc->max_seg_size = mmc->max_req_size; | 1958 | mmc->max_seg_size = mmc->max_req_size; |
1959 | } | ||
1956 | 1960 | ||
1957 | /* | 1961 | /* |
1958 | * Maximum block size. This varies from controller to controller and | 1962 | * Maximum block size. This varies from controller to controller and |
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index 0d953f513d8..83bd9f76709 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h | |||
@@ -83,6 +83,8 @@ struct sdhci_host { | |||
83 | #define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 (1<<28) | 83 | #define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 (1<<28) |
84 | /* Controller doesn't have HISPD bit field in HI-SPEED SD card */ | 84 | /* Controller doesn't have HISPD bit field in HI-SPEED SD card */ |
85 | #define SDHCI_QUIRK_NO_HISPD_BIT (1<<29) | 85 | #define SDHCI_QUIRK_NO_HISPD_BIT (1<<29) |
86 | /* Controller treats ADMA descriptors with length 0000h incorrectly */ | ||
87 | #define SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC (1<<30) | ||
86 | 88 | ||
87 | int irq; /* Device IRQ */ | 89 | int irq; /* Device IRQ */ |
88 | void __iomem *ioaddr; /* Mapped address */ | 90 | void __iomem *ioaddr; /* Mapped address */ |