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

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc:
mvsdio: fix CONFIG_PM=y build
mmci: fix crash with debug enabled
sdhci: catch ADMA errors
mmc: increase power up delay
sdhci-pci: bad error handling in probe function
mmc_block: be prepared for oversized requests

+22 -13
+8
drivers/mmc/card/block.c
··· 254 brq.data.blocks = req->nr_sectors; 255 256 /* 257 * After a read error, we redo the request one sector at a time 258 * in order to accurately determine which sectors can be read 259 * successfully.
··· 254 brq.data.blocks = req->nr_sectors; 255 256 /* 257 + * The block layer doesn't support all sector count 258 + * restrictions, so we need to be prepared for too big 259 + * requests. 260 + */ 261 + if (brq.data.blocks > card->host->max_blk_count) 262 + brq.data.blocks = card->host->max_blk_count; 263 + 264 + /* 265 * After a read error, we redo the request one sector at a time 266 * in order to accurately determine which sectors can be read 267 * successfully.
+2 -2
drivers/mmc/core/core.c
··· 706 * This delay should be sufficient to allow the power supply 707 * to reach the minimum voltage. 708 */ 709 - mmc_delay(2); 710 711 host->ios.clock = host->f_min; 712 host->ios.power_mode = MMC_POWER_ON; ··· 716 * This delay must be at least 74 clock sizes, or 1 ms, or the 717 * time required to reach a stable voltage. 718 */ 719 - mmc_delay(2); 720 } 721 722 static void mmc_power_off(struct mmc_host *host)
··· 706 * This delay should be sufficient to allow the power supply 707 * to reach the minimum voltage. 708 */ 709 + mmc_delay(10); 710 711 host->ios.clock = host->f_min; 712 host->ios.power_mode = MMC_POWER_ON; ··· 716 * This delay must be at least 74 clock sizes, or 1 ms, or the 717 * time required to reach a stable voltage. 718 */ 719 + mmc_delay(10); 720 } 721 722 static void mmc_power_off(struct mmc_host *host)
+1 -1
drivers/mmc/host/mmci.c
··· 514 } 515 516 host = mmc_priv(mmc); 517 /* Bits 12 thru 19 is the designer */ 518 host->hw_designer = (dev->periphid >> 12) & 0xff; 519 /* Bits 20 thru 23 is the revison */ ··· 546 host->mclk = clk_get_rate(host->clk); 547 DBG(host, "eventual mclk rate: %u Hz\n", host->mclk); 548 } 549 - host->mmc = mmc; 550 host->base = ioremap(dev->res.start, SZ_4K); 551 if (!host->base) { 552 ret = -ENOMEM;
··· 514 } 515 516 host = mmc_priv(mmc); 517 + host->mmc = mmc; 518 /* Bits 12 thru 19 is the designer */ 519 host->hw_designer = (dev->periphid >> 12) & 0xff; 520 /* Bits 20 thru 23 is the revison */ ··· 545 host->mclk = clk_get_rate(host->clk); 546 DBG(host, "eventual mclk rate: %u Hz\n", host->mclk); 547 } 548 host->base = ioremap(dev->res.start, SZ_4K); 549 if (!host->base) { 550 ret = -ENOMEM;
+5 -6
drivers/mmc/host/mvsdio.c
··· 825 } 826 827 #ifdef CONFIG_PM 828 - static int mvsd_suspend(struct platform_device *dev, pm_message_t state, 829 - u32 level) 830 { 831 struct mmc_host *mmc = platform_get_drvdata(dev); 832 int ret = 0; 833 834 - if (mmc && level == SUSPEND_DISABLE) 835 ret = mmc_suspend_host(mmc, state); 836 837 return ret; 838 } 839 840 - static int mvsd_resume(struct platform_device *dev, u32 level) 841 { 842 - struct mmc_host *mmc = platform_dev_get_drvdata(dev); 843 int ret = 0; 844 845 - if (mmc && level == RESUME_ENABLE) 846 ret = mmc_resume_host(mmc); 847 848 return ret;
··· 825 } 826 827 #ifdef CONFIG_PM 828 + static int mvsd_suspend(struct platform_device *dev, pm_message_t state) 829 { 830 struct mmc_host *mmc = platform_get_drvdata(dev); 831 int ret = 0; 832 833 + if (mmc) 834 ret = mmc_suspend_host(mmc, state); 835 836 return ret; 837 } 838 839 + static int mvsd_resume(struct platform_device *dev) 840 { 841 + struct mmc_host *mmc = platform_get_drvdata(dev); 842 int ret = 0; 843 844 + if (mmc) 845 ret = mmc_resume_host(mmc); 846 847 return ret;
+5 -3
drivers/mmc/host/sdhci-pci.c
··· 522 523 host = sdhci_alloc_host(&pdev->dev, sizeof(struct sdhci_pci_slot)); 524 if (IS_ERR(host)) { 525 - ret = PTR_ERR(host); 526 - goto unmap; 527 } 528 529 slot = sdhci_priv(host); ··· 541 ret = pci_request_region(pdev, bar, mmc_hostname(host->mmc)); 542 if (ret) { 543 dev_err(&pdev->dev, "cannot request region\n"); 544 - return ERR_PTR(ret); 545 } 546 547 addr = pci_resource_start(pdev, bar); ··· 572 573 release: 574 pci_release_region(pdev, bar); 575 sdhci_free_host(host); 576 577 return ERR_PTR(ret);
··· 522 523 host = sdhci_alloc_host(&pdev->dev, sizeof(struct sdhci_pci_slot)); 524 if (IS_ERR(host)) { 525 + dev_err(&pdev->dev, "cannot allocate host\n"); 526 + return ERR_PTR(PTR_ERR(host)); 527 } 528 529 slot = sdhci_priv(host); ··· 541 ret = pci_request_region(pdev, bar, mmc_hostname(host->mmc)); 542 if (ret) { 543 dev_err(&pdev->dev, "cannot request region\n"); 544 + goto free; 545 } 546 547 addr = pci_resource_start(pdev, bar); ··· 572 573 release: 574 pci_release_region(pdev, bar); 575 + 576 + free: 577 sdhci_free_host(host); 578 579 return ERR_PTR(ret);
+1 -1
drivers/mmc/host/sdhci.h
··· 125 #define SDHCI_INT_DATA_MASK (SDHCI_INT_DATA_END | SDHCI_INT_DMA_END | \ 126 SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | \ 127 SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_DATA_CRC | \ 128 - SDHCI_INT_DATA_END_BIT) 129 #define SDHCI_INT_ALL_MASK ((unsigned int)-1) 130 131 #define SDHCI_ACMD12_ERR 0x3C
··· 125 #define SDHCI_INT_DATA_MASK (SDHCI_INT_DATA_END | SDHCI_INT_DMA_END | \ 126 SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | \ 127 SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_DATA_CRC | \ 128 + SDHCI_INT_DATA_END_BIT | SDHCI_ADMA_ERROR) 129 #define SDHCI_INT_ALL_MASK ((unsigned int)-1) 130 131 #define SDHCI_ACMD12_ERR 0x3C