Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-mmc

* 'devel' of master.kernel.org:/home/rmk/linux-2.6-mmc:
[MMC] sdhci: remove duplicate error message
[MMC] sdhci: force DMA on some controllers
[MMC] sdhci: quirk for broken reset
[MMC] sdhci: Add SDHCI controller ids

+51 -6
+49 -6
drivers/mmc/sdhci.c
··· 32 static unsigned int debug_forcedma = 0; 33 static unsigned int debug_quirks = 0; 34 35 static const struct pci_device_id pci_ids[] __devinitdata = { 36 - /* handle any SD host controller */ 37 - {PCI_DEVICE_CLASS((PCI_CLASS_SYSTEM_SDHCI << 8), 0xFFFF00)}, 38 { /* end: all zeroes */ }, 39 }; 40 ··· 470 "though there were blocks left. Please report this " 471 "to " BUGMAIL ".\n", mmc_hostname(host->mmc)); 472 data->error = MMC_ERR_FAILED; 473 - } 474 - 475 - if (host->size != 0) { 476 printk(KERN_ERR "%s: %d bytes were left untransferred. " 477 "Please report this to " BUGMAIL ".\n", 478 mmc_hostname(host->mmc), host->size); ··· 836 if ((mrq->cmd->error != MMC_ERR_NONE) || 837 (mrq->data && ((mrq->data->error != MMC_ERR_NONE) || 838 (mrq->data->stop && (mrq->data->stop->error != MMC_ERR_NONE))))) { 839 sdhci_reset(host, SDHCI_RESET_CMD); 840 sdhci_reset(host, SDHCI_RESET_DATA); 841 } ··· 1206 else if (debug_forcedma) { 1207 DBG("DMA forced on\n"); 1208 host->flags |= SDHCI_USE_DMA; 1209 - } else if ((pdev->class & 0x0000FF) != PCI_SDHCI_IFDMA) 1210 DBG("Controller doesn't have DMA interface\n"); 1211 else if (!(caps & SDHCI_CAN_DO_DMA)) 1212 DBG("Controller doesn't have DMA capability\n");
··· 32 static unsigned int debug_forcedma = 0; 33 static unsigned int debug_quirks = 0; 34 35 + #define SDHCI_QUIRK_CLOCK_BEFORE_RESET (1<<0) 36 + #define SDHCI_QUIRK_FORCE_DMA (1<<1) 37 + 38 static const struct pci_device_id pci_ids[] __devinitdata = { 39 + { 40 + .vendor = PCI_VENDOR_ID_RICOH, 41 + .device = PCI_DEVICE_ID_RICOH_R5C822, 42 + .subvendor = PCI_VENDOR_ID_IBM, 43 + .subdevice = PCI_ANY_ID, 44 + .driver_data = SDHCI_QUIRK_CLOCK_BEFORE_RESET | 45 + SDHCI_QUIRK_FORCE_DMA, 46 + }, 47 + 48 + { 49 + .vendor = PCI_VENDOR_ID_RICOH, 50 + .device = PCI_DEVICE_ID_RICOH_R5C822, 51 + .subvendor = PCI_ANY_ID, 52 + .subdevice = PCI_ANY_ID, 53 + .driver_data = SDHCI_QUIRK_FORCE_DMA, 54 + }, 55 + 56 + { 57 + .vendor = PCI_VENDOR_ID_TI, 58 + .device = PCI_DEVICE_ID_TI_XX21_XX11_SD, 59 + .subvendor = PCI_ANY_ID, 60 + .subdevice = PCI_ANY_ID, 61 + .driver_data = SDHCI_QUIRK_FORCE_DMA, 62 + }, 63 + 64 + { /* Generic SD host controller */ 65 + PCI_DEVICE_CLASS((PCI_CLASS_SYSTEM_SDHCI << 8), 0xFFFF00) 66 + }, 67 + 68 { /* end: all zeroes */ }, 69 }; 70 ··· 440 "though there were blocks left. Please report this " 441 "to " BUGMAIL ".\n", mmc_hostname(host->mmc)); 442 data->error = MMC_ERR_FAILED; 443 + } else if (host->size != 0) { 444 printk(KERN_ERR "%s: %d bytes were left untransferred. " 445 "Please report this to " BUGMAIL ".\n", 446 mmc_hostname(host->mmc), host->size); ··· 808 if ((mrq->cmd->error != MMC_ERR_NONE) || 809 (mrq->data && ((mrq->data->error != MMC_ERR_NONE) || 810 (mrq->data->stop && (mrq->data->stop->error != MMC_ERR_NONE))))) { 811 + 812 + /* Some controllers need this kick or reset won't work here */ 813 + if (host->chip->quirks & SDHCI_QUIRK_CLOCK_BEFORE_RESET) { 814 + unsigned int clock; 815 + 816 + /* This is to force an update */ 817 + clock = host->clock; 818 + host->clock = 0; 819 + sdhci_set_clock(host, clock); 820 + } 821 + 822 + /* Spec says we should do both at the same time, but Ricoh 823 + controllers do not like that. */ 824 sdhci_reset(host, SDHCI_RESET_CMD); 825 sdhci_reset(host, SDHCI_RESET_DATA); 826 } ··· 1165 else if (debug_forcedma) { 1166 DBG("DMA forced on\n"); 1167 host->flags |= SDHCI_USE_DMA; 1168 + } else if (chip->quirks & SDHCI_QUIRK_FORCE_DMA) 1169 + host->flags |= SDHCI_USE_DMA; 1170 + else if ((pdev->class & 0x0000FF) != PCI_SDHCI_IFDMA) 1171 DBG("Controller doesn't have DMA interface\n"); 1172 else if (!(caps & SDHCI_CAN_DO_DMA)) 1173 DBG("Controller doesn't have DMA capability\n");
+2
include/linux/pci_ids.h
··· 728 #define PCI_DEVICE_ID_TI_TVP4020 0x3d07 729 #define PCI_DEVICE_ID_TI_4450 0x8011 730 #define PCI_DEVICE_ID_TI_XX21_XX11 0x8031 731 #define PCI_DEVICE_ID_TI_X515 0x8036 732 #define PCI_DEVICE_ID_TI_XX12 0x8039 733 #define PCI_DEVICE_ID_TI_1130 0xac12 ··· 1443 #define PCI_DEVICE_ID_RICOH_RL5C475 0x0475 1444 #define PCI_DEVICE_ID_RICOH_RL5C476 0x0476 1445 #define PCI_DEVICE_ID_RICOH_RL5C478 0x0478 1446 1447 #define PCI_VENDOR_ID_DLINK 0x1186 1448 #define PCI_DEVICE_ID_DLINK_DGE510T 0x4c00
··· 728 #define PCI_DEVICE_ID_TI_TVP4020 0x3d07 729 #define PCI_DEVICE_ID_TI_4450 0x8011 730 #define PCI_DEVICE_ID_TI_XX21_XX11 0x8031 731 + #define PCI_DEVICE_ID_TI_XX21_XX11_SD 0x8034 732 #define PCI_DEVICE_ID_TI_X515 0x8036 733 #define PCI_DEVICE_ID_TI_XX12 0x8039 734 #define PCI_DEVICE_ID_TI_1130 0xac12 ··· 1442 #define PCI_DEVICE_ID_RICOH_RL5C475 0x0475 1443 #define PCI_DEVICE_ID_RICOH_RL5C476 0x0476 1444 #define PCI_DEVICE_ID_RICOH_RL5C478 0x0478 1445 + #define PCI_DEVICE_ID_RICOH_R5C822 0x0822 1446 1447 #define PCI_VENDOR_ID_DLINK 0x1186 1448 #define PCI_DEVICE_ID_DLINK_DGE510T 0x4c00