The patch titled mmc: more DMA capabilities tests has been added to the -mm tree. Its filename is mmc-more-dma-capabilities-tests.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: mmc: more DMA capabilities tests From: Pierre Ossman <drzeus@xxxxxxxxx> Properly test for controller interface to see if it's DMA capable. As many controllers are misconfigured in this regard, also add debug parameters to force DMA support either way. Signed-off-by: Pierre Ossman <drzeus@xxxxxxxxx> Cc: Russell King <rmk@xxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/mmc/sdhci.c | 30 +++++++++++++++++++++++++++++- drivers/mmc/sdhci.h | 4 ++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff -puN drivers/mmc/sdhci.c~mmc-more-dma-capabilities-tests drivers/mmc/sdhci.c --- 25/drivers/mmc/sdhci.c~mmc-more-dma-capabilities-tests Tue Jun 27 14:28:49 2006 +++ 25-akpm/drivers/mmc/sdhci.c Tue Jun 27 14:28:49 2006 @@ -28,6 +28,9 @@ #define DBG(f, x...) \ pr_debug(DRIVER_NAME " [%s()]: " f, __func__,## x) +static unsigned int debug_nodma = 0; +static unsigned int debug_forcedma = 0; + static const struct pci_device_id pci_ids[] __devinitdata = { /* handle any SD host controller */ {PCI_DEVICE_CLASS((PCI_CLASS_SYSTEM_SDHCI << 8), 0xFFFF00)}, @@ -1105,6 +1108,16 @@ static int __devinit sdhci_probe_slot(st return -ENODEV; } + if ((pdev->class & 0x0000FF) == PCI_SDHCI_IFVENDOR) { + printk(KERN_ERR DRIVER_NAME ": Vendor specific interface. Aborting.\n"); + return -ENODEV; + } + + if ((pdev->class & 0x0000FF) > PCI_SDHCI_IFVENDOR) { + printk(KERN_ERR DRIVER_NAME ": Unknown interface. Aborting.\n"); + return -ENODEV; + } + mmc = mmc_alloc_host(sizeof(struct sdhci_host), &pdev->dev); if (!mmc) return -ENOMEM; @@ -1146,7 +1159,16 @@ static int __devinit sdhci_probe_slot(st caps = readl(host->ioaddr + SDHCI_CAPABILITIES); - if ((caps & SDHCI_CAN_DO_DMA) && ((pdev->class & 0x0000FF) == 0x01)) + if (debug_nodma) + DBG("DMA forced off\n"); + else if (debug_forcedma) { + DBG("DMA forced on\n"); + host->flags |= SDHCI_USE_DMA; + } else if ((pdev->class & 0x0000FF) != PCI_SDHCI_IFDMA) + DBG("Controller doesn't have DMA interface\n"); + else if (!(caps & SDHCI_CAN_DO_DMA)) + DBG("Controller doesn't have DMA capability\n"); + else host->flags |= SDHCI_USE_DMA; if (host->flags & SDHCI_USE_DMA) { @@ -1429,7 +1451,13 @@ static void __exit sdhci_drv_exit(void) module_init(sdhci_drv_init); module_exit(sdhci_drv_exit); +module_param(debug_nodma, uint, 0444); +module_param(debug_forcedma, uint, 0444); + MODULE_AUTHOR("Pierre Ossman <drzeus@xxxxxxxxx>"); MODULE_DESCRIPTION("Secure Digital Host Controller Interface driver"); MODULE_VERSION(DRIVER_VERSION); MODULE_LICENSE("GPL"); + +MODULE_PARM_DESC(debug_nodma, "Forcefully disable DMA transfers. (default 0)"); +MODULE_PARM_DESC(debug_forcedma, "Forcefully enable DMA transfers. (default 0)"); diff -puN drivers/mmc/sdhci.h~mmc-more-dma-capabilities-tests drivers/mmc/sdhci.h --- 25/drivers/mmc/sdhci.h~mmc-more-dma-capabilities-tests Tue Jun 27 14:28:49 2006 +++ 25-akpm/drivers/mmc/sdhci.h Tue Jun 27 14:28:49 2006 @@ -12,6 +12,10 @@ * PCI registers */ +#define PCI_SDHCI_IFPIO 0x00 +#define PCI_SDHCI_IFDMA 0x01 +#define PCI_SDHCI_IFVENDOR 0x02 + #define PCI_SLOT_INFO 0x40 /* 8 bits */ #define PCI_SLOT_INFO_SLOTS(x) ((x >> 4) & 7) #define PCI_SLOT_INFO_FIRST_BAR_MASK 0x07 _ Patches currently in -mm which might be from drzeus@xxxxxxxxx are mmc-check-sdhci-base-clock.patch mmc-print-device-id.patch mmc-support-for-multiple-voltages.patch mmc-fix-timeout-loops-in-sdhci.patch mmc-fix-sdhci-reset-timeout.patch mmc-proper-timeout-handling.patch mmc-correct-register-order.patch mmc-fix-interrupt-handling.patch mmc-fix-sdhci-pio-routines.patch mmc-avoid-sdhci-dma-boundaries.patch mmc-test-for-invalid-block-size.patch mmc-check-only-relevant-inhibit-bits.patch mmc-check-controller-version.patch mmc-reset-sdhci-controller-early.patch mmc-more-dma-capabilities-tests.patch mmc-support-controller-specific-quirks.patch mmc-version-bump-sdhci.patch mmc-add-sdhci-controller-ids.patch mmc-quirk-for-broken-reset.patch mmc-force-dma-on-some-controllers.patch mmc-remove-duplicate-error-message.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html