Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc:
mmc: remove unused "ddr" parameter in struct mmc_ios
mmc: dw_mmc: Fix DDR mode support.
mmc: core: use defined R1_STATE_PRG macro for card status
mmc: sdhci: use f_max instead of host->clock for timeouts
mmc: sdhci: move timeout_clk calculation farther down
mmc: sdhci: check host->clock before using it as a denominator
mmc: Revert "mmc: sdhci: Fix SDHCI_QUIRK_TIMEOUT_USES_SDCLK"
mmc: tmio: eliminate unused variable 'mmc' warning
mmc: esdhc-imx: fix card interrupt loss on freescale eSDHC
mmc: sdhci-s3c: Fix build for header change
mmc: dw_mmc: Fix mask in IDMAC_SET_BUFFER1_SIZE macro
mmc: cb710: fix possible pci_dev leak in cb710_pci_configure()
mmc: core: Detect eMMC v4.5 ext_csd entries
mmc: mmc_test: avoid stalled file in debugfs
mmc: sdhci-s3c: add BROKEN_ADMA_ZEROLEN_DESC quirk
mmc: sdhci: pxav3: controller needs 32 bit ADMA addressing
mmc: sdhci: fix retuning timer wrongly deleted in sdhci_tasklet_finish

+99 -76
+2 -1
drivers/misc/cb710/core.c
··· 33 33 static int __devinit cb710_pci_configure(struct pci_dev *pdev) 34 34 { 35 35 unsigned int devfn = PCI_DEVFN(PCI_SLOT(pdev->devfn), 0); 36 - struct pci_dev *pdev0 = pci_get_slot(pdev->bus, devfn); 36 + struct pci_dev *pdev0; 37 37 u32 val; 38 38 39 39 cb710_pci_update_config_reg(pdev, 0x48, ··· 43 43 if (val & 0x80000000) 44 44 return 0; 45 45 46 + pdev0 = pci_get_slot(pdev->bus, devfn); 46 47 if (!pdev0) 47 48 return -ENODEV; 48 49
+31 -27
drivers/mmc/card/mmc_test.c
··· 224 224 static int mmc_test_busy(struct mmc_command *cmd) 225 225 { 226 226 return !(cmd->resp[0] & R1_READY_FOR_DATA) || 227 - (R1_CURRENT_STATE(cmd->resp[0]) == 7); 227 + (R1_CURRENT_STATE(cmd->resp[0]) == R1_STATE_PRG); 228 228 } 229 229 230 230 /* ··· 2900 2900 .release = single_release, 2901 2901 }; 2902 2902 2903 - static void mmc_test_free_file_test(struct mmc_card *card) 2903 + static void mmc_test_free_dbgfs_file(struct mmc_card *card) 2904 2904 { 2905 2905 struct mmc_test_dbgfs_file *df, *dfs; 2906 2906 ··· 2917 2917 mutex_unlock(&mmc_test_lock); 2918 2918 } 2919 2919 2920 - static int mmc_test_register_file_test(struct mmc_card *card) 2920 + static int __mmc_test_register_dbgfs_file(struct mmc_card *card, 2921 + const char *name, mode_t mode, const struct file_operations *fops) 2921 2922 { 2922 2923 struct dentry *file = NULL; 2923 2924 struct mmc_test_dbgfs_file *df; 2924 - int ret = 0; 2925 - 2926 - mutex_lock(&mmc_test_lock); 2927 2925 2928 2926 if (card->debugfs_root) 2929 - file = debugfs_create_file("test", S_IWUSR | S_IRUGO, 2930 - card->debugfs_root, card, &mmc_test_fops_test); 2927 + file = debugfs_create_file(name, mode, card->debugfs_root, 2928 + card, fops); 2931 2929 2932 2930 if (IS_ERR_OR_NULL(file)) { 2933 2931 dev_err(&card->dev, 2934 - "Can't create test. Perhaps debugfs is disabled.\n"); 2935 - ret = -ENODEV; 2936 - goto err; 2937 - } 2938 - 2939 - if (card->debugfs_root) 2940 - file = debugfs_create_file("testlist", S_IRUGO, 2941 - card->debugfs_root, card, &mmc_test_fops_testlist); 2942 - 2943 - if (IS_ERR_OR_NULL(file)) { 2944 - dev_err(&card->dev, 2945 - "Can't create testlist. Perhaps debugfs is disabled.\n"); 2946 - ret = -ENODEV; 2947 - goto err; 2932 + "Can't create %s. Perhaps debugfs is disabled.\n", 2933 + name); 2934 + return -ENODEV; 2948 2935 } 2949 2936 2950 2937 df = kmalloc(sizeof(struct mmc_test_dbgfs_file), GFP_KERNEL); ··· 2939 2952 debugfs_remove(file); 2940 2953 dev_err(&card->dev, 2941 2954 "Can't allocate memory for internal usage.\n"); 2942 - ret = -ENOMEM; 2943 - goto err; 2955 + return -ENOMEM; 2944 2956 } 2945 2957 2946 2958 df->card = card; 2947 2959 df->file = file; 2948 2960 2949 2961 list_add(&df->link, &mmc_test_file_test); 2962 + return 0; 2963 + } 2964 + 2965 + static int mmc_test_register_dbgfs_file(struct mmc_card *card) 2966 + { 2967 + int ret; 2968 + 2969 + mutex_lock(&mmc_test_lock); 2970 + 2971 + ret = __mmc_test_register_dbgfs_file(card, "test", S_IWUSR | S_IRUGO, 2972 + &mmc_test_fops_test); 2973 + if (ret) 2974 + goto err; 2975 + 2976 + ret = __mmc_test_register_dbgfs_file(card, "testlist", S_IRUGO, 2977 + &mmc_test_fops_testlist); 2978 + if (ret) 2979 + goto err; 2950 2980 2951 2981 err: 2952 2982 mutex_unlock(&mmc_test_lock); ··· 2978 2974 if (!mmc_card_mmc(card) && !mmc_card_sd(card)) 2979 2975 return -ENODEV; 2980 2976 2981 - ret = mmc_test_register_file_test(card); 2977 + ret = mmc_test_register_dbgfs_file(card); 2982 2978 if (ret) 2983 2979 return ret; 2984 2980 ··· 2990 2986 static void mmc_test_remove(struct mmc_card *card) 2991 2987 { 2992 2988 mmc_test_free_result(card); 2993 - mmc_test_free_file_test(card); 2989 + mmc_test_free_dbgfs_file(card); 2994 2990 } 2995 2991 2996 2992 static struct mmc_driver mmc_driver = { ··· 3010 3006 { 3011 3007 /* Clear stalled data if card is still plugged */ 3012 3008 mmc_test_free_result(NULL); 3013 - mmc_test_free_file_test(NULL); 3009 + mmc_test_free_dbgfs_file(NULL); 3014 3010 3015 3011 mmc_unregister_driver(&mmc_driver); 3016 3012 }
+1 -1
drivers/mmc/core/core.c
··· 1502 1502 goto out; 1503 1503 } 1504 1504 } while (!(cmd.resp[0] & R1_READY_FOR_DATA) || 1505 - R1_CURRENT_STATE(cmd.resp[0]) == 7); 1505 + R1_CURRENT_STATE(cmd.resp[0]) == R1_STATE_PRG); 1506 1506 out: 1507 1507 return err; 1508 1508 }
+1 -1
drivers/mmc/core/mmc.c
··· 259 259 } 260 260 261 261 card->ext_csd.rev = ext_csd[EXT_CSD_REV]; 262 - if (card->ext_csd.rev > 5) { 262 + if (card->ext_csd.rev > 6) { 263 263 printk(KERN_ERR "%s: unrecognised EXT_CSD revision %d\n", 264 264 mmc_hostname(card->host), card->ext_csd.rev); 265 265 err = -EINVAL;
+1 -1
drivers/mmc/core/mmc_ops.c
··· 407 407 break; 408 408 if (mmc_host_is_spi(card->host)) 409 409 break; 410 - } while (R1_CURRENT_STATE(status) == 7); 410 + } while (R1_CURRENT_STATE(status) == R1_STATE_PRG); 411 411 412 412 if (mmc_host_is_spi(card->host)) { 413 413 if (status & R1_SPI_ILLEGAL_COMMAND)
+3 -3
drivers/mmc/host/dw_mmc.c
··· 62 62 63 63 u32 des1; /* Buffer sizes */ 64 64 #define IDMAC_SET_BUFFER1_SIZE(d, s) \ 65 - ((d)->des1 = ((d)->des1 & 0x03ffc000) | ((s) & 0x3fff)) 65 + ((d)->des1 = ((d)->des1 & 0x03ffe000) | ((s) & 0x1fff)) 66 66 67 67 u32 des2; /* buffer 1 physical address */ 68 68 ··· 699 699 } 700 700 701 701 /* DDR mode set */ 702 - if (ios->ddr) { 702 + if (ios->timing == MMC_TIMING_UHS_DDR50) { 703 703 regs = mci_readl(slot->host, UHS_REG); 704 704 regs |= (0x1 << slot->id) << 16; 705 705 mci_writel(slot->host, UHS_REG, regs); ··· 1646 1646 mmc->caps |= MMC_CAP_4_BIT_DATA; 1647 1647 1648 1648 if (host->pdata->quirks & DW_MCI_QUIRK_HIGHSPEED) 1649 - mmc->caps |= MMC_CAP_SD_HIGHSPEED; 1649 + mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED; 1650 1650 1651 1651 #ifdef CONFIG_MMC_DW_IDMAC 1652 1652 mmc->max_segs = host->ring_size;
+30 -8
drivers/mmc/host/sdhci-esdhc-imx.c
··· 27 27 #include "sdhci-pltfm.h" 28 28 #include "sdhci-esdhc.h" 29 29 30 + #define SDHCI_CTRL_D3CD 0x08 30 31 /* VENDOR SPEC register */ 31 32 #define SDHCI_VENDOR_SPEC 0xC0 32 33 #define SDHCI_VENDOR_SPEC_SDIO_QUIRK 0x00000002 ··· 142 141 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); 143 142 struct pltfm_imx_data *imx_data = pltfm_host->priv; 144 143 struct esdhc_platform_data *boarddata = &imx_data->boarddata; 144 + u32 data; 145 145 146 - if (unlikely((reg == SDHCI_INT_ENABLE || reg == SDHCI_SIGNAL_ENABLE) 147 - && (boarddata->cd_type == ESDHC_CD_GPIO))) 148 - /* 149 - * these interrupts won't work with a custom card_detect gpio 150 - */ 151 - val &= ~(SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT); 146 + if (unlikely(reg == SDHCI_INT_ENABLE || reg == SDHCI_SIGNAL_ENABLE)) { 147 + if (boarddata->cd_type == ESDHC_CD_GPIO) 148 + /* 149 + * These interrupts won't work with a custom 150 + * card_detect gpio (only applied to mx25/35) 151 + */ 152 + val &= ~(SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT); 153 + 154 + if (val & SDHCI_INT_CARD_INT) { 155 + /* 156 + * Clear and then set D3CD bit to avoid missing the 157 + * card interrupt. This is a eSDHC controller problem 158 + * so we need to apply the following workaround: clear 159 + * and set D3CD bit will make eSDHC re-sample the card 160 + * interrupt. In case a card interrupt was lost, 161 + * re-sample it by the following steps. 162 + */ 163 + data = readl(host->ioaddr + SDHCI_HOST_CONTROL); 164 + data &= ~SDHCI_CTRL_D3CD; 165 + writel(data, host->ioaddr + SDHCI_HOST_CONTROL); 166 + data |= SDHCI_CTRL_D3CD; 167 + writel(data, host->ioaddr + SDHCI_HOST_CONTROL); 168 + } 169 + } 152 170 153 171 if (unlikely((imx_data->flags & ESDHC_FLAG_MULTIBLK_NO_INT) 154 172 && (reg == SDHCI_INT_STATUS) ··· 237 217 */ 238 218 return; 239 219 case SDHCI_HOST_CONTROL: 240 - /* FSL messed up here, so we can just keep those two */ 241 - new_val = val & (SDHCI_CTRL_LED | SDHCI_CTRL_4BITBUS); 220 + /* FSL messed up here, so we can just keep those three */ 221 + new_val = val & (SDHCI_CTRL_LED | \ 222 + SDHCI_CTRL_4BITBUS | \ 223 + SDHCI_CTRL_D3CD); 242 224 /* ensure the endianess */ 243 225 new_val |= ESDHC_HOST_CONTROL_LE; 244 226 /* DMA mode bits are shifted */
+2 -1
drivers/mmc/host/sdhci-pxav3.c
··· 195 195 clk_enable(clk); 196 196 197 197 host->quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL 198 - | SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC; 198 + | SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC 199 + | SDHCI_QUIRK_32BIT_ADMA_SIZE; 199 200 200 201 /* enable 1/8V DDR capable */ 201 202 host->mmc->caps |= MMC_CAP_1_8V_DDR;
+4
drivers/mmc/host/sdhci-s3c.c
··· 19 19 #include <linux/clk.h> 20 20 #include <linux/io.h> 21 21 #include <linux/gpio.h> 22 + #include <linux/module.h> 22 23 23 24 #include <linux/mmc/host.h> 24 25 ··· 502 501 503 502 /* This host supports the Auto CMD12 */ 504 503 host->quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12; 504 + 505 + /* Samsung SoCs need BROKEN_ADMA_ZEROLEN_DESC */ 506 + host->quirks |= SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC; 505 507 506 508 if (pdata->cd_type == S3C_SDHCI_CD_NONE || 507 509 pdata->cd_type == S3C_SDHCI_CD_PERMANENT)
+24 -29
drivers/mmc/host/sdhci.c
··· 628 628 /* timeout in us */ 629 629 if (!data) 630 630 target_timeout = cmd->cmd_timeout_ms * 1000; 631 - else 632 - target_timeout = data->timeout_ns / 1000 + 633 - data->timeout_clks / host->clock; 634 - 635 - if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK) 636 - host->timeout_clk = host->clock / 1000; 631 + else { 632 + target_timeout = data->timeout_ns / 1000; 633 + if (host->clock) 634 + target_timeout += data->timeout_clks / host->clock; 635 + } 637 636 638 637 /* 639 638 * Figure out needed cycles. ··· 644 645 * => 645 646 * (1) / (2) > 2^6 646 647 */ 647 - BUG_ON(!host->timeout_clk); 648 648 count = 0; 649 649 current_timeout = (1 << 13) * 1000 / host->timeout_clk; 650 650 while (current_timeout < target_timeout) { ··· 1865 1867 1866 1868 del_timer(&host->timer); 1867 1869 1868 - if (host->version >= SDHCI_SPEC_300) 1869 - del_timer(&host->tuning_timer); 1870 - 1871 1870 mrq = host->mrq; 1872 1871 1873 1872 /* ··· 2456 2461 host->max_clk = host->ops->get_max_clock(host); 2457 2462 } 2458 2463 2459 - host->timeout_clk = 2460 - (caps[0] & SDHCI_TIMEOUT_CLK_MASK) >> SDHCI_TIMEOUT_CLK_SHIFT; 2461 - if (host->timeout_clk == 0) { 2462 - if (host->ops->get_timeout_clock) { 2463 - host->timeout_clk = host->ops->get_timeout_clock(host); 2464 - } else if (!(host->quirks & 2465 - SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)) { 2466 - printk(KERN_ERR 2467 - "%s: Hardware doesn't specify timeout clock " 2468 - "frequency.\n", mmc_hostname(mmc)); 2469 - return -ENODEV; 2470 - } 2471 - } 2472 - if (caps[0] & SDHCI_TIMEOUT_CLK_UNIT) 2473 - host->timeout_clk *= 1000; 2474 - 2475 2464 /* 2476 2465 * In case of Host Controller v3.00, find out whether clock 2477 2466 * multiplier is supported. ··· 2488 2509 } else 2489 2510 mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_200; 2490 2511 2512 + host->timeout_clk = 2513 + (caps[0] & SDHCI_TIMEOUT_CLK_MASK) >> SDHCI_TIMEOUT_CLK_SHIFT; 2514 + if (host->timeout_clk == 0) { 2515 + if (host->ops->get_timeout_clock) { 2516 + host->timeout_clk = host->ops->get_timeout_clock(host); 2517 + } else if (!(host->quirks & 2518 + SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)) { 2519 + printk(KERN_ERR 2520 + "%s: Hardware doesn't specify timeout clock " 2521 + "frequency.\n", mmc_hostname(mmc)); 2522 + return -ENODEV; 2523 + } 2524 + } 2525 + if (caps[0] & SDHCI_TIMEOUT_CLK_UNIT) 2526 + host->timeout_clk *= 1000; 2527 + 2491 2528 if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK) 2492 - mmc->max_discard_to = (1 << 27) / (mmc->f_max / 1000); 2493 - else 2494 - mmc->max_discard_to = (1 << 27) / host->timeout_clk; 2529 + host->timeout_clk = mmc->f_max / 1000; 2530 + 2531 + mmc->max_discard_to = (1 << 27) / host->timeout_clk; 2495 2532 2496 2533 mmc->caps |= MMC_CAP_SDIO_IRQ | MMC_CAP_ERASE | MMC_CAP_CMD23; 2497 2534
-2
drivers/mmc/host/tmio_mmc.c
··· 27 27 static int tmio_mmc_suspend(struct platform_device *dev, pm_message_t state) 28 28 { 29 29 const struct mfd_cell *cell = mfd_get_cell(dev); 30 - struct mmc_host *mmc = platform_get_drvdata(dev); 31 30 int ret; 32 31 33 32 ret = tmio_mmc_host_suspend(&dev->dev); ··· 41 42 static int tmio_mmc_resume(struct platform_device *dev) 42 43 { 43 44 const struct mfd_cell *cell = mfd_get_cell(dev); 44 - struct mmc_host *mmc = platform_get_drvdata(dev); 45 45 int ret = 0; 46 46 47 47 /* Tell the MFD core we are ready to be enabled */
-2
include/linux/mmc/host.h
··· 56 56 #define MMC_TIMING_UHS_SDR104 4 57 57 #define MMC_TIMING_UHS_DDR50 5 58 58 59 - unsigned char ddr; /* dual data rate used */ 60 - 61 59 #define MMC_SDR_MODE 0 62 60 #define MMC_1_2V_DDR_MODE 1 63 61 #define MMC_1_8V_DDR_MODE 2