Skip to content

Commit

Permalink
sdhci: add SDHCI_QUIRK_BROKEN_DMA quirk
Browse files Browse the repository at this point in the history
Some controllers like ENE712 can't work properly with DMA mode,
add this quirk to force these kinds of HW work with PIO mode

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
  • Loading branch information
Feng Tang authored and Pierre Ossman committed Oct 3, 2007
1 parent 56e71ef commit 7c168e3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions drivers/mmc/host/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ static unsigned int debug_quirks = 0;
#define SDHCI_QUIRK_NO_CARD_NO_RESET (1<<2)
#define SDHCI_QUIRK_SINGLE_POWER_WRITE (1<<3)
#define SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS (1<<4)
#define SDHCI_QUIRK_BROKEN_DMA (1<<5)

static const struct pci_device_id pci_ids[] __devinitdata = {
{
Expand Down Expand Up @@ -68,15 +69,17 @@ static const struct pci_device_id pci_ids[] __devinitdata = {
.device = PCI_DEVICE_ID_ENE_CB712_SD,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
.driver_data = SDHCI_QUIRK_SINGLE_POWER_WRITE,
.driver_data = SDHCI_QUIRK_SINGLE_POWER_WRITE |
SDHCI_QUIRK_BROKEN_DMA,
},

{
.vendor = PCI_VENDOR_ID_ENE,
.device = PCI_DEVICE_ID_ENE_CB712_SD_2,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
.driver_data = SDHCI_QUIRK_SINGLE_POWER_WRITE,
.driver_data = SDHCI_QUIRK_SINGLE_POWER_WRITE |
SDHCI_QUIRK_BROKEN_DMA,
},

{
Expand Down Expand Up @@ -1304,6 +1307,12 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
else
host->flags |= SDHCI_USE_DMA;

if ((chip->quirks & SDHCI_QUIRK_BROKEN_DMA) &&
(host->flags & SDHCI_USE_DMA)) {
DBG("Disabling DMA as it is marked broken");
host->flags &= ~SDHCI_USE_DMA;
}

if (((pdev->class & 0x0000FF) != PCI_SDHCI_IFDMA) &&
(host->flags & SDHCI_USE_DMA)) {
printk(KERN_WARNING "%s: Will use DMA "
Expand Down

0 comments on commit 7c168e3

Please sign in to comment.