History

Merge tag 'mmc-v4.5' of git://git.linaro.org/people/ulf.hansson/mmc

Pull MMC updates from Ulf Hansson: "MMC core: - Optimize boot time by detecting cards simultaneously - Make runtime resume default behavior for MMC/SD - Enable MMC/SD/SDIO devices to suspend/resume asynchronously - Allow more than 8 partitions per card - Introduce MMC_CAP2_NO_SDIO to prevent unsupported SDIO commands - Support the standard DT wakeup-source property - Fix driver strength switching for HS200 and HS400 - Fix switch command timeout - Fix invalid vdd in voltage switch power cycle for SDIO MMC host: - sdhci: Restore behavior when setting VDD via external regulator - sdhci: A couple of changes/fixes related to the dma support - sdhci-tegra: Add Tegra210 support - sdhci-tegra: Support for UHS-I cards including tuning support - sdhci-of-at91: Add PM support - sh_mmcif: Rework dma channel handling - mvsdio: Delete platform data code path" * tag 'mmc-v4.5' of git://git.linaro.org/people/ulf.hansson/mmc: (52 commits) mmc: dw_mmc: remove the unused quirks mmc: sdhci-pci: use to_pci_dev() mmc: cb710: use to_platform_device() mmc: tegra: use correct accessor for misc ctrl register mmc: tegra: enable UHS-I modes mmc: tegra: implement UHS tuning mmc: tegra: disable SPI_MODE_CLKEN mmc: tegra: implement module external clock change mmc: sdhci: restore behavior when setting VDD via external regulator mmc: It is not an error for the card to be removed while suspended mmc: block: Allow more than 8 partitions per card mmc: core: Optimize boot time by detecting cards simultaneously mmc: dw_mmc: use resource_size_t to store physical address mmc: core: fix __mmc_switch timeout caused by preempt mmc: usdhi6rol0: handle NULL data in timeout mmc: of_mmc_spi: Add IRQF_ONESHOT to interrupt flags mmc: mediatek: change some dev_err to dev_dbg mmc: enable MMC/SD/SDIO device to suspend/resume asynchronously mmc: sdhci: Fix sdhci_runtime_pm_bus_on/off() mmc: sdhci: 64-bit DMA actually has 4-byte alignment ...

Linus Torvalds committed 10 years ago

Commit fb591fb2 parents 8c93020 01a999e40 files · +626 −549Browse files

Unified · Split

40 files
  1. Documentation/devicetree/bindings/mmc/renesas,mmcif.txt +1 −0
  2. MAINTAINERS +0 −1
  3. drivers/mmc/card/block.c +4 −7
  4. drivers/mmc/core/bus.c +2 −0
  5. drivers/mmc/core/core.c +43 −42
  6. drivers/mmc/core/core.h +8 −0
  7. drivers/mmc/core/host.c +4 −7
  8. drivers/mmc/core/mmc.c +5 −18
  9. drivers/mmc/core/mmc_ops.c +8 −1
  10. drivers/mmc/core/pwrseq.h +1 −1
  11. drivers/mmc/core/pwrseq_emmc.c +1 −1
  12. drivers/mmc/core/pwrseq_simple.c +1 −1
  13. drivers/mmc/core/sd.c +3 −14
  14. drivers/mmc/core/sdio.c +1 −1
  15. drivers/mmc/core/sdio_bus.c +1 −0
  16. drivers/mmc/host/Kconfig +1 −0
  17. drivers/mmc/host/atmel-mci-regs.h +0 −171
  18. drivers/mmc/host/atmel-mci.c +162 −3
  19. drivers/mmc/host/cb710-mmc.h +1 −2
  20. drivers/mmc/host/dw_mmc-pltfm.c +1 −1
  21. drivers/mmc/host/dw_mmc-rockchip.c +0 −8
  22. drivers/mmc/host/dw_mmc.c +1 −20
  23. drivers/mmc/host/mtk-sd.c +4 −5
  24. drivers/mmc/host/mvsdio.c +14 −44
  25. drivers/mmc/host/of_mmc_spi.c +2 −2
  26. drivers/mmc/host/omap_hsmmc.c +2 −4
  27. drivers/mmc/host/sdhci-esdhc-imx.c +5 −2
  28. drivers/mmc/host/sdhci-of-at91.c +73 −2
  29. drivers/mmc/host/sdhci-of-esdhc.c +10 −0
  30. drivers/mmc/host/sdhci-pci-core.c +3 −3
  31. drivers/mmc/host/sdhci-pltfm.c +2 −1
  32. drivers/mmc/host/sdhci-tegra.c +151 −27
  33. drivers/mmc/host/sdhci.c +52 −72
  34. drivers/mmc/host/sdhci.h +12 −9
  35. drivers/mmc/host/sh_mmcif.c +38 −46
  36. drivers/mmc/host/usdhi6rol0.c +2 −1
  37. include/linux/mmc/dw_mmc.h +3 −9
  38. include/linux/mmc/host.h +3 −3
  39. include/linux/platform_data/mmc-mvsdio.h +0 −18
  40. lib/Kconfig.debug +1 −2
Documentation/devicetree/bindings/mmc/renesas,mmcif.txt+1−0
@@ -11,6 +11,7 @@ Required properties: · 10 unmodified lines
1111 - "renesas,mmcif-r8a7740" for the MMCIF found in r8a7740 SoCs
1212 - "renesas,mmcif-r8a7790" for the MMCIF found in r8a7790 SoCs
1313 - "renesas,mmcif-r8a7791" for the MMCIF found in r8a7791 SoCs
14+ - "renesas,mmcif-r8a7793" for the MMCIF found in r8a7793 SoCs
1415 - "renesas,mmcif-r8a7794" for the MMCIF found in r8a7794 SoCs
1516
1617 - clocks: reference to the functional clock
MAINTAINERS+0−1
@@ -1896,7 +1896,6 @@ ATMEL AT91 / AT32 MCI DRIVER · 1895 unmodified lines
18961896 M: Ludovic Desroches <ludovic.desroches@atmel.com>
18971897 S: Maintained
18981898 F: drivers/mmc/host/atmel-mci.c
1899−F: drivers/mmc/host/atmel-mci-regs.h
19001899
19011900 ATMEL AT91 / AT32 SERIAL DRIVER
19021901 M: Nicolas Ferre <nicolas.ferre@atmel.com>
drivers/mmc/card/block.c+4−7
@@ -171,11 +171,7 @@ static struct mmc_blk_data *mmc_blk_get(struct gendisk *disk) · 170 unmodified lines
171171
172172 static inline int mmc_get_devidx(struct gendisk *disk)
173173 {
174− int devmaj = MAJOR(disk_devt(disk));
175− int devidx = MINOR(disk_devt(disk)) / perdev_minors;
176−
177− if (!devmaj)
178− devidx = disk->first_minor / perdev_minors;
174+ int devidx = disk->first_minor / perdev_minors;
179175 return devidx;
180176 }
181177
@@ -344,7 +340,7 @@ static struct mmc_blk_ioc_data *mmc_blk_ioctl_copy_from_user( · 162 unmodified lines
344340 struct mmc_blk_ioc_data *idata;
345341 int err;
346342
347− idata = kzalloc(sizeof(*idata), GFP_KERNEL);
343+ idata = kmalloc(sizeof(*idata), GFP_KERNEL);
348344 if (!idata) {
349345 err = -ENOMEM;
350346 goto out;
@@ -364,7 +360,7 @@ static struct mmc_blk_ioc_data *mmc_blk_ioctl_copy_from_user( · 13 unmodified lines
364360 if (!idata->buf_bytes)
365361 return idata;
366362
367− idata->buf = kzalloc(idata->buf_bytes, GFP_KERNEL);
363+ idata->buf = kmalloc(idata->buf_bytes, GFP_KERNEL);
368364 if (!idata->buf) {
369365 err = -ENOMEM;
370366 goto idata_err;
@@ -2244,6 +2240,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card, · 1873 unmodified lines
22442240 md->disk->queue = md->queue.queue;
22452241 md->disk->driverfs_dev = parent;
22462242 set_disk_ro(md->disk, md->read_only || default_ro);
2243+ md->disk->flags = GENHD_FL_EXT_DEVT;
22472244 if (area_type & (MMC_BLK_DATA_AREA_RPMB | MMC_BLK_DATA_AREA_BOOT))
22482245 md->disk->flags |= GENHD_FL_NO_PART_SCAN;
22492246
drivers/mmc/core/bus.c+2−0
@@ -349,6 +349,8 @@ int mmc_add_card(struct mmc_card *card) · 348 unmodified lines
349349
350350 card->dev.of_node = mmc_of_find_child_device(card->host, 0);
351351
352+ device_enable_async_suspend(&card->dev);
353+
352354 ret = device_add(&card->dev);
353355 if (ret)
354356 return ret;
drivers/mmc/core/core.c+43−42
@@ -55,7 +55,6 @@ · 54 unmodified lines
5555 */
5656 #define MMC_BKOPS_MAX_TIMEOUT (4 * 60 * 1000) /* max time to wait in ms */
5757
58−static struct workqueue_struct *workqueue;
5958 static const unsigned freqs[] = { 400000, 300000, 200000, 100000 };
6059
6160 /*
@@ -66,21 +65,16 @@ static const unsigned freqs[] = { 400000, 300000, 200000, 100000 }; · 4 unmodified lines
6665 bool use_spi_crc = 1;
6766 module_param(use_spi_crc, bool, 0);
6867
69−/*
70− * Internal function. Schedule delayed work in the MMC work queue.
71− */
7268 static int mmc_schedule_delayed_work(struct delayed_work *work,
7369 unsigned long delay)
7470 {
75− return queue_delayed_work(workqueue, work, delay);
76−}
77−
78−/*
79− * Internal function. Flush all scheduled work from the MMC work queue.
80− */
81−static void mmc_flush_scheduled_work(void)
82−{
83− flush_workqueue(workqueue);
71+ /*
72+ * We use the system_freezable_wq, because of two reasons.
73+ * First, it allows several works (not the same work item) to be
74+ * executed simultaneously. Second, the queue becomes frozen when
75+ * userspace becomes frozen during system PM.
76+ */
77+ return queue_delayed_work(system_freezable_wq, work, delay);
8478 }
8579
8680 #ifdef CONFIG_FAIL_MMC_REQUEST
@@ -1485,7 +1479,7 @@ int mmc_regulator_get_supply(struct mmc_host *mmc) · 1398 unmodified lines
14851479 if (IS_ERR(mmc->supply.vmmc)) {
14861480 if (PTR_ERR(mmc->supply.vmmc) == -EPROBE_DEFER)
14871481 return -EPROBE_DEFER;
1488− dev_info(dev, "No vmmc regulator found\n");
1482+ dev_dbg(dev, "No vmmc regulator found\n");
14891483 } else {
14901484 ret = mmc_regulator_get_ocrmask(mmc->supply.vmmc);
14911485 if (ret > 0)
@@ -1497,7 +1491,7 @@ int mmc_regulator_get_supply(struct mmc_host *mmc) · 5 unmodified lines
14971491 if (IS_ERR(mmc->supply.vqmmc)) {
14981492 if (PTR_ERR(mmc->supply.vqmmc) == -EPROBE_DEFER)
14991493 return -EPROBE_DEFER;
1500− dev_info(dev, "No vqmmc regulator found\n");
1494+ dev_dbg(dev, "No vqmmc regulator found\n");
15011495 }
15021496
15031497 return 0;
@@ -2476,15 +2470,20 @@ static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq) · 972 unmodified lines
24762470 * sdio_reset sends CMD52 to reset card. Since we do not know
24772471 * if the card is being re-initialized, just send it. CMD52
24782472 * should be ignored by SD/eMMC cards.
2473+ * Skip it if we already know that we do not support SDIO commands
24792474 */
2480− sdio_reset(host);
2475+ if (!(host->caps2 & MMC_CAP2_NO_SDIO))
2476+ sdio_reset(host);
2477+
24812478 mmc_go_idle(host);
24822479
24832480 mmc_send_if_cond(host, host->ocr_avail);
24842481
24852482 /* Order's important: probe SDIO, then SD, then MMC */
2486− if (!mmc_attach_sdio(host))
2487− return 0;
2483+ if (!(host->caps2 & MMC_CAP2_NO_SDIO))
2484+ if (!mmc_attach_sdio(host))
2485+ return 0;
2486+
24882487 if (!mmc_attach_sd(host))
24892488 return 0;
24902489 if (!mmc_attach_mmc(host))
@@ -2498,9 +2497,6 @@ int _mmc_detect_card_removed(struct mmc_host *host) · 7 unmodified lines
24982497 {
24992498 int ret;
25002499
2501− if (host->caps & MMC_CAP_NONREMOVABLE)
2502− return 0;
2503−
25042500 if (!host->card || mmc_card_removed(host->card))
25052501 return 1;
25062502
@@ -2536,6 +2532,9 @@ int mmc_detect_card_removed(struct mmc_host *host) · 29 unmodified lines
25362532 if (!card)
25372533 return 1;
25382534
2535+ if (host->caps & MMC_CAP_NONREMOVABLE)
2536+ return 0;
2537+
25392538 ret = mmc_card_removed(card);
25402539 /*
25412540 * The card will be considered unchanged unless we have been asked to
@@ -2567,11 +2566,6 @@ void mmc_rescan(struct work_struct *work) · 25 unmodified lines
25672566 container_of(work, struct mmc_host, detect.work);
25682567 int i;
25692568
2570− if (host->trigger_card_event && host->ops->card_event) {
2571− host->ops->card_event(host);
2572− host->trigger_card_event = false;
2573− }
2574−
25752569 if (host->rescan_disable)
25762570 return;
25772571
@@ -2580,6 +2574,13 @@ void mmc_rescan(struct work_struct *work) · 2 unmodified lines
25802574 return;
25812575 host->rescan_entered = 1;
25822576
2577+ if (host->trigger_card_event && host->ops->card_event) {
2578+ mmc_claim_host(host);
2579+ host->ops->card_event(host);
2580+ mmc_release_host(host);
2581+ host->trigger_card_event = false;
2582+ }
2583+
25832584 mmc_bus_get(host);
25842585
25852586 /*
@@ -2611,15 +2612,14 @@ void mmc_rescan(struct work_struct *work) · 25 unmodified lines
26112612 */
26122613 mmc_bus_put(host);
26132614
2615+ mmc_claim_host(host);
26142616 if (!(host->caps & MMC_CAP_NONREMOVABLE) && host->ops->get_cd &&
26152617 host->ops->get_cd(host) == 0) {
2616− mmc_claim_host(host);
26172618 mmc_power_off(host);
26182619 mmc_release_host(host);
26192620 goto out;
26202621 }
26212622
2622− mmc_claim_host(host);
26232623 for (i = 0; i < ARRAY_SIZE(freqs); i++) {
26242624 if (!mmc_rescan_try_freq(host, max(freqs[i], host->f_min)))
26252625 break;
@@ -2663,7 +2663,6 @@ void mmc_stop_host(struct mmc_host *host) · 37 unmodified lines
26632663
26642664 host->rescan_disable = 1;
26652665 cancel_delayed_work_sync(&host->detect);
2666− mmc_flush_scheduled_work();
26672666
26682667 /* clear pm flags now and let card drivers set them as needed */
26692668 host->pm_flags = 0;
@@ -2759,14 +2758,13 @@ int mmc_flush_cache(struct mmc_card *card) · 89 unmodified lines
27592758 }
27602759 EXPORT_SYMBOL(mmc_flush_cache);
27612760
2762−#ifdef CONFIG_PM
2763−
2761+#ifdef CONFIG_PM_SLEEP
27642762 /* Do the card removal on suspend if card is assumed removeable
27652763 * Do that in pm notifier while userspace isn't yet frozen, so we will be able
27662764 to sync the card.
27672765 */
2768−int mmc_pm_notify(struct notifier_block *notify_block,
2769− unsigned long mode, void *unused)
2766+static int mmc_pm_notify(struct notifier_block *notify_block,
2767+ unsigned long mode, void *unused)
27702768 {
27712769 struct mmc_host *host = container_of(
27722770 notify_block, struct mmc_host, pm_notify);
@@ -2813,6 +2811,17 @@ int mmc_pm_notify(struct notifier_block *notify_block, · 40 unmodified lines
28132811
28142812 return 0;
28152813 }
2814+
2815+void mmc_register_pm_notifier(struct mmc_host *host)
2816+{
2817+ host->pm_notify.notifier_call = mmc_pm_notify;
2818+ register_pm_notifier(&host->pm_notify);
2819+}
2820+
2821+void mmc_unregister_pm_notifier(struct mmc_host *host)
2822+{
2823+ unregister_pm_notifier(&host->pm_notify);
2824+}
28162825 #endif
28172826
28182827 /**
@@ -2836,13 +2845,9 @@ static int __init mmc_init(void) · 17 unmodified lines
28362845 {
28372846 int ret;
28382847
2839− workqueue = alloc_ordered_workqueue("kmmcd", 0);
2840− if (!workqueue)
2841− return -ENOMEM;
2842−
28432848 ret = mmc_register_bus();
28442849 if (ret)
2845− goto destroy_workqueue;
2850+ return ret;
28462851
28472852 ret = mmc_register_host_class();
28482853 if (ret)
@@ -2858,9 +2863,6 @@ unregister_host_class: · 9 unmodified lines
28582863 mmc_unregister_host_class();
28592864 unregister_bus:
28602865 mmc_unregister_bus();
2861−destroy_workqueue:
2862− destroy_workqueue(workqueue);
2863−
28642866 return ret;
28652867 }
28662868
@@ -2869,7 +2871,6 @@ static void __exit mmc_exit(void) · 2 unmodified lines
28692871 sdio_unregister_bus();
28702872 mmc_unregister_host_class();
28712873 mmc_unregister_bus();
2872− destroy_workqueue(workqueue);
28732874 }
28742875
28752876 subsys_initcall(mmc_init);
drivers/mmc/core/core.h+8−0
@@ -90,5 +90,13 @@ int mmc_execute_tuning(struct mmc_card *card); · 89 unmodified lines
9090 int mmc_hs200_to_hs400(struct mmc_card *card);
9191 int mmc_hs400_to_hs200(struct mmc_card *card);
9292
93+#ifdef CONFIG_PM_SLEEP
94+void mmc_register_pm_notifier(struct mmc_host *host);
95+void mmc_unregister_pm_notifier(struct mmc_host *host);
96+#else
97+static inline void mmc_register_pm_notifier(struct mmc_host *host) { }
98+static inline void mmc_unregister_pm_notifier(struct mmc_host *host) { }
99+#endif
100+
93101 #endif
94102
drivers/mmc/core/host.c+4−7
@@ -21,7 +21,6 @@ · 20 unmodified lines
2121 #include <linux/export.h>
2222 #include <linux/leds.h>
2323 #include <linux/slab.h>
24−#include <linux/suspend.h>
2524
2625 #include <linux/mmc/host.h>
2726 #include <linux/mmc/card.h>
@@ -275,7 +274,8 @@ int mmc_of_parse(struct mmc_host *host) · 247 unmodified lines
275274 host->caps2 |= MMC_CAP2_FULL_PWR_CYCLE;
276275 if (of_property_read_bool(np, "keep-power-in-suspend"))
277276 host->pm_caps |= MMC_PM_KEEP_POWER;
278− if (of_property_read_bool(np, "enable-sdio-wakeup"))
277+ if (of_property_read_bool(np, "wakeup-source") ||
278+ of_property_read_bool(np, "enable-sdio-wakeup")) /* legacy */
279279 host->pm_caps |= MMC_PM_WAKE_SDIO_IRQ;
280280 if (of_property_read_bool(np, "mmc-ddr-1_8v"))
281281 host->caps |= MMC_CAP_1_8V_DDR;
@@ -348,9 +348,6 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev) · 66 unmodified lines
348348 spin_lock_init(&host->lock);
349349 init_waitqueue_head(&host->wq);
350350 INIT_DELAYED_WORK(&host->detect, mmc_rescan);
351−#ifdef CONFIG_PM
352− host->pm_notify.notifier_call = mmc_pm_notify;
353−#endif
354351 setup_timer(&host->retune_timer, mmc_retune_timer, (unsigned long)host);
355352
356353 /*
@@ -395,7 +392,7 @@ int mmc_add_host(struct mmc_host *host) · 38 unmodified lines
395392 #endif
396393
397394 mmc_start_host(host);
398− register_pm_notifier(&host->pm_notify);
395+ mmc_register_pm_notifier(host);
399396
400397 return 0;
401398 }
@@ -412,7 +409,7 @@ EXPORT_SYMBOL(mmc_add_host); · 10 unmodified lines
412409 */
413410 void mmc_remove_host(struct mmc_host *host)
414411 {
415− unregister_pm_notifier(&host->pm_notify);
412+ mmc_unregister_pm_notifier(host);
416413 mmc_stop_host(host);
417414
418415 #ifdef CONFIG_DEBUG_FS
drivers/mmc/core/mmc.c+5−18
@@ -1076,8 +1076,7 @@ static int mmc_select_hs400(struct mmc_card *card) · 1075 unmodified lines
10761076 mmc_set_clock(host, max_dtr);
10771077
10781078 /* Switch card to HS mode */
1079− val = EXT_CSD_TIMING_HS |
1080− card->drive_strength << EXT_CSD_DRV_STR_SHIFT;
1079+ val = EXT_CSD_TIMING_HS;
10811080 err = __mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
10821081 EXT_CSD_HS_TIMING, val,
10831082 card->ext_csd.generic_cmd6_time,
@@ -1160,8 +1159,7 @@ int mmc_hs400_to_hs200(struct mmc_card *card) · 76 unmodified lines
11601159 mmc_set_clock(host, max_dtr);
11611160
11621161 /* Switch HS400 to HS DDR */
1163− val = EXT_CSD_TIMING_HS |
1164− card->drive_strength << EXT_CSD_DRV_STR_SHIFT;
1162+ val = EXT_CSD_TIMING_HS;
11651163 err = __mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_HS_TIMING,
11661164 val, card->ext_csd.generic_cmd6_time,
11671165 true, send_status, true);
@@ -1907,16 +1905,8 @@ static int mmc_shutdown(struct mmc_host *host) · 739 unmodified lines
19071905 */
19081906 static int mmc_resume(struct mmc_host *host)
19091907 {
1910− int err = 0;
1911−
1912− if (!(host->caps & MMC_CAP_RUNTIME_RESUME)) {
1913− err = _mmc_resume(host);
1914− pm_runtime_set_active(&host->card->dev);
1915− pm_runtime_mark_last_busy(&host->card->dev);
1916− }
19171908 pm_runtime_enable(&host->card->dev);
1918−
1919− return err;
1909+ return 0;
19201910 }
19211911
19221912 /*
@@ -1944,12 +1934,9 @@ static int mmc_runtime_resume(struct mmc_host *host) · 21 unmodified lines
19441934 {
19451935 int err;
19461936
1947− if (!(host->caps & (MMC_CAP_AGGRESSIVE_PM | MMC_CAP_RUNTIME_RESUME)))
1948− return 0;
1949−
19501937 err = _mmc_resume(host);
1951− if (err)
1952− pr_err("%s: error %d doing aggressive resume\n",
1938+ if (err && err != -ENOMEDIUM)
1939+ pr_err("%s: error %d doing runtime resume\n",
19531940 mmc_hostname(host), err);
19541941
19551942 return 0;
drivers/mmc/core/mmc_ops.c+8−1
@@ -489,6 +489,7 @@ int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value, · 488 unmodified lines
489489 unsigned long timeout;
490490 u32 status = 0;
491491 bool use_r1b_resp = use_busy_signal;
492+ bool expired = false;
492493
493494 mmc_retune_hold(host);
494495
@@ -545,6 +546,12 @@ int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value, · 50 unmodified lines
545546 timeout = jiffies + msecs_to_jiffies(timeout_ms);
546547 do {
547548 if (send_status) {
549+ /*
550+ * Due to the possibility of being preempted after
551+ * sending the status command, check the expiration
552+ * time first.
553+ */
554+ expired = time_after(jiffies, timeout);
548555 err = __mmc_send_status(card, &status, ignore_crc);
549556 if (err)
550557 goto out;
@@ -565,7 +572,7 @@ int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value, · 14 unmodified lines
565572 }
566573
567574 /* Timeout if the device never leaves the program state. */
568− if (time_after(jiffies, timeout)) {
575+ if (expired && R1_CURRENT_STATE(status) == R1_STATE_PRG) {
569576 pr_err("%s: Card stuck in programming state! %s\n",
570577 mmc_hostname(host), __func__);
571578 err = -ETIMEDOUT;
drivers/mmc/core/pwrseq.h+1−1
@@ -16,7 +16,7 @@ struct mmc_pwrseq_ops { · 15 unmodified lines
1616 };
1717
1818 struct mmc_pwrseq {
19− struct mmc_pwrseq_ops *ops;
19+ const struct mmc_pwrseq_ops *ops;
2020 };
2121
2222 #ifdef CONFIG_OF
drivers/mmc/core/pwrseq_emmc.c+1−1
@@ -51,7 +51,7 @@ static void mmc_pwrseq_emmc_free(struct mmc_host *host) · 50 unmodified lines
5151 kfree(pwrseq);
5252 }
5353
54−static struct mmc_pwrseq_ops mmc_pwrseq_emmc_ops = {
54+static const struct mmc_pwrseq_ops mmc_pwrseq_emmc_ops = {
5555 .post_power_on = mmc_pwrseq_emmc_reset,
5656 .free = mmc_pwrseq_emmc_free,
5757 };
drivers/mmc/core/pwrseq_simple.c+1−1
@@ -87,7 +87,7 @@ static void mmc_pwrseq_simple_free(struct mmc_host *host) · 86 unmodified lines
8787 kfree(pwrseq);
8888 }
8989
90−static struct mmc_pwrseq_ops mmc_pwrseq_simple_ops = {
90+static const struct mmc_pwrseq_ops mmc_pwrseq_simple_ops = {
9191 .pre_power_on = mmc_pwrseq_simple_pre_power_on,
9292 .post_power_on = mmc_pwrseq_simple_post_power_on,
9393 .power_off = mmc_pwrseq_simple_power_off,
drivers/mmc/core/sd.c+3−14
@@ -1128,16 +1128,8 @@ out: · 1127 unmodified lines
11281128 */
11291129 static int mmc_sd_resume(struct mmc_host *host)
11301130 {
1131− int err = 0;
1132−
1133− if (!(host->caps & MMC_CAP_RUNTIME_RESUME)) {
1134− err = _mmc_sd_resume(host);
1135− pm_runtime_set_active(&host->card->dev);
1136− pm_runtime_mark_last_busy(&host->card->dev);
1137− }
11381131 pm_runtime_enable(&host->card->dev);
1139−
1140− return err;
1132+ return 0;
11411133 }
11421134
11431135 /*
@@ -1165,12 +1157,9 @@ static int mmc_sd_runtime_resume(struct mmc_host *host) · 21 unmodified lines
11651157 {
11661158 int err;
11671159
1168− if (!(host->caps & (MMC_CAP_AGGRESSIVE_PM | MMC_CAP_RUNTIME_RESUME)))
1169− return 0;
1170−
11711160 err = _mmc_sd_resume(host);
1172− if (err)
1173− pr_err("%s: error %d doing aggressive resume\n",
1161+ if (err && err != -ENOMEDIUM)
1162+ pr_err("%s: error %d doing runtime resume\n",
11741163 mmc_hostname(host), err);
11751164
11761165 return 0;
drivers/mmc/core/sdio.c+1−1
@@ -630,7 +630,7 @@ try_again: · 629 unmodified lines
630630 */
631631 if (!powered_resume && (rocr & ocr & R4_18V_PRESENT)) {
632632 err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180,
633− ocr);
633+ ocr_card);
634634 if (err == -EAGAIN) {
635635 sdio_reset(host);
636636 mmc_go_idle(host);
drivers/mmc/core/sdio_bus.c+1−0
@@ -322,6 +322,7 @@ int sdio_add_func(struct sdio_func *func) · 321 unmodified lines
322322
323323 sdio_set_of_node(func);
324324 sdio_acpi_set_handle(func);
325+ device_enable_async_suspend(&func->dev);
325326 ret = device_add(&func->dev);
326327 if (ret == 0)
327328 sdio_func_set_present(func);
drivers/mmc/host/Kconfig+1−0
@@ -455,6 +455,7 @@ config MMC_TIFM_SD · 454 unmodified lines
455455 config MMC_MVSDIO
456456 tristate "Marvell MMC/SD/SDIO host driver"
457457 depends on PLAT_ORION
458+ depends on OF
458459 ---help---
459460 This selects the Marvell SDIO host driver.
460461 SDIO may currently be found on the Kirkwood 88F6281 and 88F6192
drivers/mmc/host/atmel-mci-regs.h+0−171
@@ -1,171 +0,0 @@
1−/*
2− * Atmel MultiMedia Card Interface driver
3− *
4− * Copyright (C) 2004-2006 Atmel Corporation
5− *
6− * This program is free software; you can redistribute it and/or modify
7− * it under the terms of the GNU General Public License version 2 as
8− * published by the Free Software Foundation.
9− */
10−
11−/*
12− * Superset of MCI IP registers integrated in Atmel AVR32 and AT91 Processors
13− * Registers and bitfields marked with [2] are only available in MCI2
14− */
15−
16−#ifndef __DRIVERS_MMC_ATMEL_MCI_H__
17−#define __DRIVERS_MMC_ATMEL_MCI_H__
18−
19−/* MCI Register Definitions */
20−#define ATMCI_CR 0x0000 /* Control */
21−# define ATMCI_CR_MCIEN ( 1 << 0) /* MCI Enable */
22−# define ATMCI_CR_MCIDIS ( 1 << 1) /* MCI Disable */
23−# define ATMCI_CR_PWSEN ( 1 << 2) /* Power Save Enable */
24−# define ATMCI_CR_PWSDIS ( 1 << 3) /* Power Save Disable */
25−# define ATMCI_CR_SWRST ( 1 << 7) /* Software Reset */
26−#define ATMCI_MR 0x0004 /* Mode */
27−# define ATMCI_MR_CLKDIV(x) ((x) << 0) /* Clock Divider */
28−# define ATMCI_MR_PWSDIV(x) ((x) << 8) /* Power Saving Divider */
29−# define ATMCI_MR_RDPROOF ( 1 << 11) /* Read Proof */
30−# define ATMCI_MR_WRPROOF ( 1 << 12) /* Write Proof */
31−# define ATMCI_MR_PDCFBYTE ( 1 << 13) /* Force Byte Transfer */
32−# define ATMCI_MR_PDCPADV ( 1 << 14) /* Padding Value */
33−# define ATMCI_MR_PDCMODE ( 1 << 15) /* PDC-oriented Mode */
34−# define ATMCI_MR_CLKODD(x) ((x) << 16) /* LSB of Clock Divider */
35−#define ATMCI_DTOR 0x0008 /* Data Timeout */
36−# define ATMCI_DTOCYC(x) ((x) << 0) /* Data Timeout Cycles */
37−# define ATMCI_DTOMUL(x) ((x) << 4) /* Data Timeout Multiplier */
38−#define ATMCI_SDCR 0x000c /* SD Card / SDIO */
39−# define ATMCI_SDCSEL_SLOT_A ( 0 << 0) /* Select SD slot A */
40−# define ATMCI_SDCSEL_SLOT_B ( 1 << 0) /* Select SD slot A */
41−# define ATMCI_SDCSEL_MASK ( 3 << 0)
42−# define ATMCI_SDCBUS_1BIT ( 0 << 6) /* 1-bit data bus */
43−# define ATMCI_SDCBUS_4BIT ( 2 << 6) /* 4-bit data bus */
44−# define ATMCI_SDCBUS_8BIT ( 3 << 6) /* 8-bit data bus[2] */
45−# define ATMCI_SDCBUS_MASK ( 3 << 6)
46−#define ATMCI_ARGR 0x0010 /* Command Argument */
47−#define ATMCI_CMDR 0x0014 /* Command */
48−# define ATMCI_CMDR_CMDNB(x) ((x) << 0) /* Command Opcode */
49−# define ATMCI_CMDR_RSPTYP_NONE ( 0 << 6) /* No response */
50−# define ATMCI_CMDR_RSPTYP_48BIT ( 1 << 6) /* 48-bit response */
51−# define ATMCI_CMDR_RSPTYP_136BIT ( 2 << 6) /* 136-bit response */
52−# define ATMCI_CMDR_SPCMD_INIT ( 1 << 8) /* Initialization command */
53−# define ATMCI_CMDR_SPCMD_SYNC ( 2 << 8) /* Synchronized command */
54−# define ATMCI_CMDR_SPCMD_INT ( 4 << 8) /* Interrupt command */
55−# define ATMCI_CMDR_SPCMD_INTRESP ( 5 << 8) /* Interrupt response */
56−# define ATMCI_CMDR_OPDCMD ( 1 << 11) /* Open Drain */
57−# define ATMCI_CMDR_MAXLAT_5CYC ( 0 << 12) /* Max latency 5 cycles */
58−# define ATMCI_CMDR_MAXLAT_64CYC ( 1 << 12) /* Max latency 64 cycles */
59−# define ATMCI_CMDR_START_XFER ( 1 << 16) /* Start data transfer */
60−# define ATMCI_CMDR_STOP_XFER ( 2 << 16) /* Stop data transfer */
61−# define ATMCI_CMDR_TRDIR_WRITE ( 0 << 18) /* Write data */
62−# define ATMCI_CMDR_TRDIR_READ ( 1 << 18) /* Read data */
63−# define ATMCI_CMDR_BLOCK ( 0 << 19) /* Single-block transfer */
64−# define ATMCI_CMDR_MULTI_BLOCK ( 1 << 19) /* Multi-block transfer */
65−# define ATMCI_CMDR_STREAM ( 2 << 19) /* MMC Stream transfer */
66−# define ATMCI_CMDR_SDIO_BYTE ( 4 << 19) /* SDIO Byte transfer */
67−# define ATMCI_CMDR_SDIO_BLOCK ( 5 << 19) /* SDIO Block transfer */
68−# define ATMCI_CMDR_SDIO_SUSPEND ( 1 << 24) /* SDIO Suspend Command */
69−# define ATMCI_CMDR_SDIO_RESUME ( 2 << 24) /* SDIO Resume Command */
70−#define ATMCI_BLKR 0x0018 /* Block */
71−# define ATMCI_BCNT(x) ((x) << 0) /* Data Block Count */
72−# define ATMCI_BLKLEN(x) ((x) << 16) /* Data Block Length */
73−#define ATMCI_CSTOR 0x001c /* Completion Signal Timeout[2] */
74−# define ATMCI_CSTOCYC(x) ((x) << 0) /* CST cycles */
75−# define ATMCI_CSTOMUL(x) ((x) << 4) /* CST multiplier */
76−#define ATMCI_RSPR 0x0020 /* Response 0 */
77−#define ATMCI_RSPR1 0x0024 /* Response 1 */
78−#define ATMCI_RSPR2 0x0028 /* Response 2 */
79−#define ATMCI_RSPR3 0x002c /* Response 3 */
80−#define ATMCI_RDR 0x0030 /* Receive Data */
81−#define ATMCI_TDR 0x0034 /* Transmit Data */
82−#define ATMCI_SR 0x0040 /* Status */
83−#define ATMCI_IER 0x0044 /* Interrupt Enable */
84−#define ATMCI_IDR 0x0048 /* Interrupt Disable */
85−#define ATMCI_IMR 0x004c /* Interrupt Mask */
86−# define ATMCI_CMDRDY ( 1 << 0) /* Command Ready */
87−# define ATMCI_RXRDY ( 1 << 1) /* Receiver Ready */
88−# define ATMCI_TXRDY ( 1 << 2) /* Transmitter Ready */
89−# define ATMCI_BLKE ( 1 << 3) /* Data Block Ended */
90−# define ATMCI_DTIP ( 1 << 4) /* Data Transfer In Progress */
91−# define ATMCI_NOTBUSY ( 1 << 5) /* Data Not Busy */
92−# define ATMCI_ENDRX ( 1 << 6) /* End of RX Buffer */
93−# define ATMCI_ENDTX ( 1 << 7) /* End of TX Buffer */
94−# define ATMCI_SDIOIRQA ( 1 << 8) /* SDIO IRQ in slot A */
95−# define ATMCI_SDIOIRQB ( 1 << 9) /* SDIO IRQ in slot B */
96−# define ATMCI_SDIOWAIT ( 1 << 12) /* SDIO Read Wait Operation Status */
97−# define ATMCI_CSRCV ( 1 << 13) /* CE-ATA Completion Signal Received */
98−# define ATMCI_RXBUFF ( 1 << 14) /* RX Buffer Full */
99−# define ATMCI_TXBUFE ( 1 << 15) /* TX Buffer Empty */
100−# define ATMCI_RINDE ( 1 << 16) /* Response Index Error */
101−# define ATMCI_RDIRE ( 1 << 17) /* Response Direction Error */
102−# define ATMCI_RCRCE ( 1 << 18) /* Response CRC Error */
103−# define ATMCI_RENDE ( 1 << 19) /* Response End Bit Error */
104−# define ATMCI_RTOE ( 1 << 20) /* Response Time-Out Error */
105−# define ATMCI_DCRCE ( 1 << 21) /* Data CRC Error */
106−# define ATMCI_DTOE ( 1 << 22) /* Data Time-Out Error */
107−# define ATMCI_CSTOE ( 1 << 23) /* Completion Signal Time-out Error */
108−# define ATMCI_BLKOVRE ( 1 << 24) /* DMA Block Overrun Error */
109−# define ATMCI_DMADONE ( 1 << 25) /* DMA Transfer Done */
110−# define ATMCI_FIFOEMPTY ( 1 << 26) /* FIFO Empty Flag */
111−# define ATMCI_XFRDONE ( 1 << 27) /* Transfer Done Flag */
112−# define ATMCI_ACKRCV ( 1 << 28) /* Boot Operation Acknowledge Received */
113−# define ATMCI_ACKRCVE ( 1 << 29) /* Boot Operation Acknowledge Error */
114−# define ATMCI_OVRE ( 1 << 30) /* RX Overrun Error */
115−# define ATMCI_UNRE ( 1 << 31) /* TX Underrun Error */
116−#define ATMCI_DMA 0x0050 /* DMA Configuration[2] */
117−# define ATMCI_DMA_OFFSET(x) ((x) << 0) /* DMA Write Buffer Offset */
118−# define ATMCI_DMA_CHKSIZE(x) ((x) << 4) /* DMA Channel Read and Write Chunk Size */
119−# define ATMCI_DMAEN ( 1 << 8) /* DMA Hardware Handshaking Enable */
120−#define ATMCI_CFG 0x0054 /* Configuration[2] */
121−# define ATMCI_CFG_FIFOMODE_1DATA ( 1 << 0) /* MCI Internal FIFO control mode */
122−# define ATMCI_CFG_FERRCTRL_COR ( 1 << 4) /* Flow Error flag reset control mode */
123−# define ATMCI_CFG_HSMODE ( 1 << 8) /* High Speed Mode */
124−# define ATMCI_CFG_LSYNC ( 1 << 12) /* Synchronize on the last block */
125−#define ATMCI_WPMR 0x00e4 /* Write Protection Mode[2] */
126−# define ATMCI_WP_EN ( 1 << 0) /* WP Enable */
127−# define ATMCI_WP_KEY (0x4d4349 << 8) /* WP Key */
128−#define ATMCI_WPSR 0x00e8 /* Write Protection Status[2] */
129−# define ATMCI_GET_WP_VS(x) ((x) & 0x0f)
130−# define ATMCI_GET_WP_VSRC(x) (((x) >> 8) & 0xffff)
131−#define ATMCI_VERSION 0x00FC /* Version */
132−#define ATMCI_FIFO_APERTURE 0x0200 /* FIFO Aperture[2] */
133−
134−/* This is not including the FIFO Aperture on MCI2 */
135−#define ATMCI_REGS_SIZE 0x100
136−
137−/* Register access macros */
138−#ifdef CONFIG_AVR32
139−#define atmci_readl(port, reg) \
140− __raw_readl((port)->regs + reg)
141−#define atmci_writel(port, reg, value) \
142− __raw_writel((value), (port)->regs + reg)
143−#else
144−#define atmci_readl(port, reg) \
145− readl_relaxed((port)->regs + reg)
146−#define atmci_writel(port, reg, value) \
147− writel_relaxed((value), (port)->regs + reg)
148−#endif
149−
150−/* On AVR chips the Peripheral DMA Controller is not connected to MCI. */
151−#ifdef CONFIG_AVR32
152−# define ATMCI_PDC_CONNECTED 0
153−#else
154−# define ATMCI_PDC_CONNECTED 1
155−#endif
156−
157−/*
158− * Fix sconfig's burst size according to atmel MCI. We need to convert them as:
159− * 1 -> 0, 4 -> 1, 8 -> 2, 16 -> 3.
160− *
161− * This can be done by finding most significant bit set.
162− */
163−static inline unsigned int atmci_convert_chksize(unsigned int maxburst)
164−{
165− if (maxburst > 1)
166− return fls(maxburst) - 2;
167− else
168− return 0;
169−}
170−
171−#endif /* __DRIVERS_MMC_ATMEL_MCI_H__ */
drivers/mmc/host/atmel-mci.c+162−3
@@ -44,7 +44,141 @@ · 43 unmodified lines
4444 #include <asm/io.h>
4545 #include <asm/unaligned.h>
4646
47−#include "atmel-mci-regs.h"
47+/*
48+ * Superset of MCI IP registers integrated in Atmel AVR32 and AT91 Processors
49+ * Registers and bitfields marked with [2] are only available in MCI2
50+ */
51+
52+/* MCI Register Definitions */
53+#define ATMCI_CR 0x0000 /* Control */
54+#define ATMCI_CR_MCIEN BIT(0) /* MCI Enable */
55+#define ATMCI_CR_MCIDIS BIT(1) /* MCI Disable */
56+#define ATMCI_CR_PWSEN BIT(2) /* Power Save Enable */
57+#define ATMCI_CR_PWSDIS BIT(3) /* Power Save Disable */
58+#define ATMCI_CR_SWRST BIT(7) /* Software Reset */
59+#define ATMCI_MR 0x0004 /* Mode */
60+#define ATMCI_MR_CLKDIV(x) ((x) << 0) /* Clock Divider */
61+#define ATMCI_MR_PWSDIV(x) ((x) << 8) /* Power Saving Divider */
62+#define ATMCI_MR_RDPROOF BIT(11) /* Read Proof */
63+#define ATMCI_MR_WRPROOF BIT(12) /* Write Proof */
64+#define ATMCI_MR_PDCFBYTE BIT(13) /* Force Byte Transfer */
65+#define ATMCI_MR_PDCPADV BIT(14) /* Padding Value */
66+#define ATMCI_MR_PDCMODE BIT(15) /* PDC-oriented Mode */
67+#define ATMCI_MR_CLKODD(x) ((x) << 16) /* LSB of Clock Divider */
68+#define ATMCI_DTOR 0x0008 /* Data Timeout */
69+#define ATMCI_DTOCYC(x) ((x) << 0) /* Data Timeout Cycles */
70+#define ATMCI_DTOMUL(x) ((x) << 4) /* Data Timeout Multiplier */
71+#define ATMCI_SDCR 0x000c /* SD Card / SDIO */
72+#define ATMCI_SDCSEL_SLOT_A (0 << 0) /* Select SD slot A */
73+#define ATMCI_SDCSEL_SLOT_B (1 << 0) /* Select SD slot A */
74+#define ATMCI_SDCSEL_MASK (3 << 0)
75+#define ATMCI_SDCBUS_1BIT (0 << 6) /* 1-bit data bus */
76+#define ATMCI_SDCBUS_4BIT (2 << 6) /* 4-bit data bus */
77+#define ATMCI_SDCBUS_8BIT (3 << 6) /* 8-bit data bus[2] */
78+#define ATMCI_SDCBUS_MASK (3 << 6)
79+#define ATMCI_ARGR 0x0010 /* Command Argument */
80+#define ATMCI_CMDR 0x0014 /* Command */
81+#define ATMCI_CMDR_CMDNB(x) ((x) << 0) /* Command Opcode */
82+#define ATMCI_CMDR_RSPTYP_NONE (0 << 6) /* No response */
83+#define ATMCI_CMDR_RSPTYP_48BIT (1 << 6) /* 48-bit response */
84+#define ATMCI_CMDR_RSPTYP_136BIT (2 << 6) /* 136-bit response */
85+#define ATMCI_CMDR_SPCMD_INIT (1 << 8) /* Initialization command */
86+#define ATMCI_CMDR_SPCMD_SYNC (2 << 8) /* Synchronized command */
87+#define ATMCI_CMDR_SPCMD_INT (4 << 8) /* Interrupt command */
88+#define ATMCI_CMDR_SPCMD_INTRESP (5 << 8) /* Interrupt response */
89+#define ATMCI_CMDR_OPDCMD (1 << 11) /* Open Drain */
90+#define ATMCI_CMDR_MAXLAT_5CYC (0 << 12) /* Max latency 5 cycles */
91+#define ATMCI_CMDR_MAXLAT_64CYC (1 << 12) /* Max latency 64 cycles */
92+#define ATMCI_CMDR_START_XFER (1 << 16) /* Start data transfer */
93+#define ATMCI_CMDR_STOP_XFER (2 << 16) /* Stop data transfer */
94+#define ATMCI_CMDR_TRDIR_WRITE (0 << 18) /* Write data */
95+#define ATMCI_CMDR_TRDIR_READ (1 << 18) /* Read data */
96+#define ATMCI_CMDR_BLOCK (0 << 19) /* Single-block transfer */
97+#define ATMCI_CMDR_MULTI_BLOCK (1 << 19) /* Multi-block transfer */
98+#define ATMCI_CMDR_STREAM (2 << 19) /* MMC Stream transfer */
99+#define ATMCI_CMDR_SDIO_BYTE (4 << 19) /* SDIO Byte transfer */
100+#define ATMCI_CMDR_SDIO_BLOCK (5 << 19) /* SDIO Block transfer */
101+#define ATMCI_CMDR_SDIO_SUSPEND (1 << 24) /* SDIO Suspend Command */
102+#define ATMCI_CMDR_SDIO_RESUME (2 << 24) /* SDIO Resume Command */
103+#define ATMCI_BLKR 0x0018 /* Block */
104+#define ATMCI_BCNT(x) ((x) << 0) /* Data Block Count */
105+#define ATMCI_BLKLEN(x) ((x) << 16) /* Data Block Length */
106+#define ATMCI_CSTOR 0x001c /* Completion Signal Timeout[2] */
107+#define ATMCI_CSTOCYC(x) ((x) << 0) /* CST cycles */
108+#define ATMCI_CSTOMUL(x) ((x) << 4) /* CST multiplier */
109+#define ATMCI_RSPR 0x0020 /* Response 0 */
110+#define ATMCI_RSPR1 0x0024 /* Response 1 */
111+#define ATMCI_RSPR2 0x0028 /* Response 2 */
112+#define ATMCI_RSPR3 0x002c /* Response 3 */
113+#define ATMCI_RDR 0x0030 /* Receive Data */
114+#define ATMCI_TDR 0x0034 /* Transmit Data */
115+#define ATMCI_SR 0x0040 /* Status */
116+#define ATMCI_IER 0x0044 /* Interrupt Enable */
117+#define ATMCI_IDR 0x0048 /* Interrupt Disable */
118+#define ATMCI_IMR 0x004c /* Interrupt Mask */
119+#define ATMCI_CMDRDY BIT(0) /* Command Ready */
120+#define ATMCI_RXRDY BIT(1) /* Receiver Ready */
121+#define ATMCI_TXRDY BIT(2) /* Transmitter Ready */
122+#define ATMCI_BLKE BIT(3) /* Data Block Ended */
123+#define ATMCI_DTIP BIT(4) /* Data Transfer In Progress */
124+#define ATMCI_NOTBUSY BIT(5) /* Data Not Busy */
125+#define ATMCI_ENDRX BIT(6) /* End of RX Buffer */
126+#define ATMCI_ENDTX BIT(7) /* End of TX Buffer */
127+#define ATMCI_SDIOIRQA BIT(8) /* SDIO IRQ in slot A */
128+#define ATMCI_SDIOIRQB BIT(9) /* SDIO IRQ in slot B */
129+#define ATMCI_SDIOWAIT BIT(12) /* SDIO Read Wait Operation Status */
130+#define ATMCI_CSRCV BIT(13) /* CE-ATA Completion Signal Received */
131+#define ATMCI_RXBUFF BIT(14) /* RX Buffer Full */
132+#define ATMCI_TXBUFE BIT(15) /* TX Buffer Empty */
133+#define ATMCI_RINDE BIT(16) /* Response Index Error */
134+#define ATMCI_RDIRE BIT(17) /* Response Direction Error */
135+#define ATMCI_RCRCE BIT(18) /* Response CRC Error */
136+#define ATMCI_RENDE BIT(19) /* Response End Bit Error */
137+#define ATMCI_RTOE BIT(20) /* Response Time-Out Error */
138+#define ATMCI_DCRCE BIT(21) /* Data CRC Error */
139+#define ATMCI_DTOE BIT(22) /* Data Time-Out Error */
140+#define ATMCI_CSTOE BIT(23) /* Completion Signal Time-out Error */
141+#define ATMCI_BLKOVRE BIT(24) /* DMA Block Overrun Error */
142+#define ATMCI_DMADONE BIT(25) /* DMA Transfer Done */
143+#define ATMCI_FIFOEMPTY BIT(26) /* FIFO Empty Flag */
144+#define ATMCI_XFRDONE BIT(27) /* Transfer Done Flag */
145+#define ATMCI_ACKRCV BIT(28) /* Boot Operation Acknowledge Received */
146+#define ATMCI_ACKRCVE BIT(29) /* Boot Operation Acknowledge Error */
147+#define ATMCI_OVRE BIT(30) /* RX Overrun Error */
148+#define ATMCI_UNRE BIT(31) /* TX Underrun Error */
149+#define ATMCI_DMA 0x0050 /* DMA Configuration[2] */
150+#define ATMCI_DMA_OFFSET(x) ((x) << 0) /* DMA Write Buffer Offset */
151+#define ATMCI_DMA_CHKSIZE(x) ((x) << 4) /* DMA Channel Read and Write Chunk Size */
152+#define ATMCI_DMAEN BIT(8) /* DMA Hardware Handshaking Enable */
153+#define ATMCI_CFG 0x0054 /* Configuration[2] */
154+#define ATMCI_CFG_FIFOMODE_1DATA BIT(0) /* MCI Internal FIFO control mode */
155+#define ATMCI_CFG_FERRCTRL_COR BIT(4) /* Flow Error flag reset control mode */
156+#define ATMCI_CFG_HSMODE BIT(8) /* High Speed Mode */
157+#define ATMCI_CFG_LSYNC BIT(12) /* Synchronize on the last block */
158+#define ATMCI_WPMR 0x00e4 /* Write Protection Mode[2] */
159+#define ATMCI_WP_EN BIT(0) /* WP Enable */
160+#define ATMCI_WP_KEY (0x4d4349 << 8) /* WP Key */
161+#define ATMCI_WPSR 0x00e8 /* Write Protection Status[2] */
162+#define ATMCI_GET_WP_VS(x) ((x) & 0x0f)
163+#define ATMCI_GET_WP_VSRC(x) (((x) >> 8) & 0xffff)
164+#define ATMCI_VERSION 0x00FC /* Version */
165+#define ATMCI_FIFO_APERTURE 0x0200 /* FIFO Aperture[2] */
166+
167+/* This is not including the FIFO Aperture on MCI2 */
168+#define ATMCI_REGS_SIZE 0x100
169+
170+/* Register access macros */
171+#define atmci_readl(port, reg) \
172+ __raw_readl((port)->regs + reg)
173+#define atmci_writel(port, reg, value) \
174+ __raw_writel((value), (port)->regs + reg)
175+
176+/* On AVR chips the Peripheral DMA Controller is not connected to MCI. */
177+#ifdef CONFIG_AVR32
178+# define ATMCI_PDC_CONNECTED 0
179+#else
180+# define ATMCI_PDC_CONNECTED 1
181+#endif
48182
49183 #define AUTOSUSPEND_DELAY 50
50184
@@ -584,6 +718,29 @@ static inline unsigned int atmci_get_version(struct atmel_mci *host) · 533 unmodified lines
584718 return atmci_readl(host, ATMCI_VERSION) & 0x00000fff;
585719 }
586720
721+/*
722+ * Fix sconfig's burst size according to atmel MCI. We need to convert them as:
723+ * 1 -> 0, 4 -> 1, 8 -> 2, 16 -> 3.
724+ * With version 0x600, we need to convert them as: 1 -> 0, 2 -> 1, 4 -> 2,
725+ * 8 -> 3, 16 -> 4.
726+ *
727+ * This can be done by finding most significant bit set.
728+ */
729+static inline unsigned int atmci_convert_chksize(struct atmel_mci *host,
730+ unsigned int maxburst)
731+{
732+ unsigned int version = atmci_get_version(host);
733+ unsigned int offset = 2;
734+
735+ if (version >= 0x600)
736+ offset = 1;
737+
738+ if (maxburst > 1)
739+ return fls(maxburst) - offset;
740+ else
741+ return 0;
742+}
743+
587744 static void atmci_timeout_timer(unsigned long data)
588745 {
589746 struct atmel_mci *host;
@@ -1034,11 +1191,13 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data) · 444 unmodified lines
10341191 if (data->flags & MMC_DATA_READ) {
10351192 direction = DMA_FROM_DEVICE;
10361193 host->dma_conf.direction = slave_dirn = DMA_DEV_TO_MEM;
1037− maxburst = atmci_convert_chksize(host->dma_conf.src_maxburst);
1194+ maxburst = atmci_convert_chksize(host,
1195+ host->dma_conf.src_maxburst);
10381196 } else {
10391197 direction = DMA_TO_DEVICE;
10401198 host->dma_conf.direction = slave_dirn = DMA_MEM_TO_DEV;
1041− maxburst = atmci_convert_chksize(host->dma_conf.dst_maxburst);
1199+ maxburst = atmci_convert_chksize(host,
1200+ host->dma_conf.dst_maxburst);
10421201 }
10431202
10441203 if (host->caps.has_dma_conf_reg)
drivers/mmc/host/cb710-mmc.h+1−2
@@ -29,8 +29,7 @@ static inline struct mmc_host *cb710_slot_to_mmc(struct cb710_slot *slot) · 28 unmodified lines
2929
3030 static inline struct cb710_slot *cb710_mmc_to_slot(struct mmc_host *mmc)
3131 {
32− struct platform_device *pdev = container_of(mmc_dev(mmc),
33− struct platform_device, dev);
32+ struct platform_device *pdev = to_platform_device(mmc_dev(mmc));
3433 return cb710_pdev_to_slot(pdev);
3534 }
3635
drivers/mmc/host/dw_mmc-pltfm.c+1−1
@@ -60,7 +60,7 @@ int dw_mci_pltfm_register(struct platform_device *pdev, · 59 unmodified lines
6060
6161 regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
6262 /* Get registers' physical base address */
63− host->phy_regs = (void *)(regs->start);
63+ host->phy_regs = regs->start;
6464 host->regs = devm_ioremap_resource(&pdev->dev, regs);
6565 if (IS_ERR(host->regs))
6666 return PTR_ERR(host->regs);
drivers/mmc/host/dw_mmc-rockchip.c+0−8
@@ -239,20 +239,12 @@ static int dw_mci_rockchip_init(struct dw_mci *host) · 238 unmodified lines
239239 return 0;
240240 }
241241
242−/* Common capabilities of RK3288 SoC */
243−static unsigned long dw_mci_rk3288_dwmmc_caps[4] = {
244− MMC_CAP_RUNTIME_RESUME, /* emmc */
245− MMC_CAP_RUNTIME_RESUME, /* sdmmc */
246− MMC_CAP_RUNTIME_RESUME, /* sdio0 */
247− MMC_CAP_RUNTIME_RESUME, /* sdio1 */
248−};
249242 static const struct dw_mci_drv_data rk2928_drv_data = {
250243 .prepare_command = dw_mci_rockchip_prepare_command,
251244 .init = dw_mci_rockchip_init,
252245 };
253246
254247 static const struct dw_mci_drv_data rk3288_drv_data = {
255− .caps = dw_mci_rk3288_dwmmc_caps,
256248 .prepare_command = dw_mci_rockchip_prepare_command,
257249 .set_ios = dw_mci_rk3288_set_ios,
258250 .execute_tuning = dw_mci_rk3288_execute_tuning,
drivers/mmc/host/dw_mmc.c+1−20
@@ -699,7 +699,7 @@ static int dw_mci_edmac_start_dma(struct dw_mci *host, · 698 unmodified lines
699699 int ret = 0;
700700
701701 /* Set external dma config: burst size, burst width */
702− cfg.dst_addr = (dma_addr_t)(host->phy_regs + fifo_offset);
702+ cfg.dst_addr = host->phy_regs + fifo_offset;
703703 cfg.src_addr = cfg.dst_addr;
704704 cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
705705 cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
@@ -1634,12 +1634,6 @@ static int dw_mci_command_complete(struct dw_mci *host, struct mmc_command *cmd) · 928 unmodified lines
16341634 else
16351635 cmd->error = 0;
16361636
1637− if (cmd->error) {
1638− /* newer ip versions need a delay between retries */
1639− if (host->quirks & DW_MCI_QUIRK_RETRY_DELAY)
1640− mdelay(20);
1641− }
1642−
16431637 return cmd->error;
16441638 }
16451639
@@ -2355,16 +2349,6 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id) · 709 unmodified lines
23552349
23562350 pending = mci_readl(host, MINTSTS); /* read-only mask reg */
23572351
2358− /*
2359− * DTO fix - version 2.10a and below, and only if internal DMA
2360− * is configured.
2361− */
2362− if (host->quirks & DW_MCI_QUIRK_IDMAC_DTO) {
2363− if (!pending &&
2364− ((mci_readl(host, STATUS) >> 17) & 0x1fff))
2365− pending |= SDMMC_INT_DATA_OVER;
2366− }
2367−
23682352 if (pending) {
23692353 /* Check volt switch first, since it can look like an error */
23702354 if ((host->state == STATE_SENDING_CMD11) &&
@@ -3165,9 +3149,6 @@ int dw_mci_probe(struct dw_mci *host) · 794 unmodified lines
31653149 /* Now that slots are all setup, we can enable card detect */
31663150 dw_mci_enable_cd(host);
31673151
3168− if (host->quirks & DW_MCI_QUIRK_IDMAC_DTO)
3169− dev_info(host->dev, "Internal DMAC interrupt fix enabled.\n");
3170−
31713152 return 0;
31723153
31733154 err_dmaunmap:
drivers/mmc/host/mtk-sd.c+4−5
@@ -972,7 +972,7 @@ static bool msdc_data_xfer_done(struct msdc_host *host, u32 events, · 971 unmodified lines
972972 if ((events & MSDC_INT_XFER_COMPL) && (!stop || !stop->error)) {
973973 data->bytes_xfered = data->blocks * data->blksz;
974974 } else {
975− dev_err(host->dev, "interrupt events: %x\n", events);
975+ dev_dbg(host->dev, "interrupt events: %x\n", events);
976976 msdc_reset_hw(host);
977977 host->error |= REQ_DAT_ERR;
978978 data->bytes_xfered = 0;
@@ -982,10 +982,10 @@ static bool msdc_data_xfer_done(struct msdc_host *host, u32 events, · 3 unmodified lines
982982 else if (events & MSDC_INT_DATCRCERR)
983983 data->error = -EILSEQ;
984984
985− dev_err(host->dev, "%s: cmd=%d; blocks=%d",
985+ dev_dbg(host->dev, "%s: cmd=%d; blocks=%d",
986986 __func__, mrq->cmd->opcode, data->blocks);
987− dev_err(host->dev, "data_error=%d xfer_size=%d\n",
988− (int)data->error, data->bytes_xfered);
987+ dev_dbg(host->dev, "data_error=%d xfer_size=%d\n",
988+ (int)data->error, data->bytes_xfered);
989989 }
990990
991991 msdc_data_xfer_next(host, mrq, data);
@@ -1543,7 +1543,6 @@ static int msdc_drv_probe(struct platform_device *pdev) · 551 unmodified lines
15431543 mmc->f_min = host->src_clk_freq / (4 * 255);
15441544
15451545 mmc->caps |= MMC_CAP_ERASE | MMC_CAP_CMD23;
1546− mmc->caps |= MMC_CAP_RUNTIME_RESUME;
15471546 /* MMC core transfer sizes tunable parameters */
15481547 mmc->max_segs = MAX_BD_NUM;
15491548 mmc->max_seg_size = BDMA_DESC_BUFLEN;
drivers/mmc/host/mvsdio.c+14−44
@@ -20,15 +20,12 @@ · 19 unmodified lines
2020 #include <linux/scatterlist.h>
2121 #include <linux/irq.h>
2222 #include <linux/clk.h>
23−#include <linux/gpio.h>
24−#include <linux/of_gpio.h>
2523 #include <linux/of_irq.h>
2624 #include <linux/mmc/host.h>
2725 #include <linux/mmc/slot-gpio.h>
2826
2927 #include <asm/sizes.h>
3028 #include <asm/unaligned.h>
31−#include <linux/platform_data/mmc-mvsdio.h>
3229
3330 #include "mvsdio.h"
3431
@@ -704,6 +701,10 @@ static int mvsd_probe(struct platform_device *pdev) · 669 unmodified lines
704701 struct resource *r;
705702 int ret, irq;
706703
704+ if (!np) {
705+ dev_err(&pdev->dev, "no DT node\n");
706+ return -ENODEV;
707+ }
707708 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
708709 irq = platform_get_irq(pdev, 0);
709710 if (!r || irq < 0)
@@ -727,8 +728,12 @@ static int mvsd_probe(struct platform_device *pdev) · 17 unmodified lines
727728 * fixed rate clock).
728729 */
729730 host->clk = devm_clk_get(&pdev->dev, NULL);
730− if (!IS_ERR(host->clk))
731− clk_prepare_enable(host->clk);
731+ if (IS_ERR(host->clk)) {
732+ dev_err(&pdev->dev, "no clock associated\n");
733+ ret = -EINVAL;
734+ goto out;
735+ }
736+ clk_prepare_enable(host->clk);
732737
733738 mmc->ops = &mvsd_ops;
734739
@@ -744,45 +749,10 @@ static int mvsd_probe(struct platform_device *pdev) · 9 unmodified lines
744749 mmc->max_seg_size = mmc->max_blk_size * mmc->max_blk_count;
745750 mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
746751
747− if (np) {
748− if (IS_ERR(host->clk)) {
749− dev_err(&pdev->dev, "DT platforms must have a clock associated\n");
750− ret = -EINVAL;
751− goto out;
752− }
753−
754− host->base_clock = clk_get_rate(host->clk) / 2;
755− ret = mmc_of_parse(mmc);
756− if (ret < 0)
757− goto out;
758− } else {
759− const struct mvsdio_platform_data *mvsd_data;
760−
761− mvsd_data = pdev->dev.platform_data;
762− if (!mvsd_data) {
763− ret = -ENXIO;
764− goto out;
765− }
766− mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ |
767− MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
768− host->base_clock = mvsd_data->clock / 2;
769− /* GPIO 0 regarded as invalid for backward compatibility */
770− if (mvsd_data->gpio_card_detect &&
771− gpio_is_valid(mvsd_data->gpio_card_detect)) {
772− ret = mmc_gpio_request_cd(mmc,
773− mvsd_data->gpio_card_detect,
774− 0);
775− if (ret)
776− goto out;
777− } else {
778− mmc->caps |= MMC_CAP_NEEDS_POLL;
779− }
780−
781− if (mvsd_data->gpio_write_protect &&
782− gpio_is_valid(mvsd_data->gpio_write_protect))
783− mmc_gpio_request_ro(mmc, mvsd_data->gpio_write_protect);
784− }
785−
752+ host->base_clock = clk_get_rate(host->clk) / 2;
753+ ret = mmc_of_parse(mmc);
754+ if (ret < 0)
755+ goto out;
786756 if (maxfreq)
787757 mmc->f_max = maxfreq;
788758
drivers/mmc/host/of_mmc_spi.c+2−2
@@ -55,8 +55,8 @@ static int of_mmc_spi_init(struct device *dev, · 54 unmodified lines
5555 {
5656 struct of_mmc_spi *oms = to_of_mmc_spi(dev);
5757
58− return request_threaded_irq(oms->detect_irq, NULL, irqhandler, 0,
59− dev_name(dev), mmc);
58+ return request_threaded_irq(oms->detect_irq, NULL, irqhandler,
59+ IRQF_ONESHOT, dev_name(dev), mmc);
6060 }
6161
6262 static void of_mmc_spi_exit(struct device *dev, void *mmc)
drivers/mmc/host/omap_hsmmc.c+2−4
@@ -2250,10 +2250,8 @@ static int omap_hsmmc_remove(struct platform_device *pdev) · 2249 unmodified lines
22502250 pm_runtime_get_sync(host->dev);
22512251 mmc_remove_host(host->mmc);
22522252
2253− if (host->tx_chan)
2254− dma_release_channel(host->tx_chan);
2255− if (host->rx_chan)
2256− dma_release_channel(host->rx_chan);
2253+ dma_release_channel(host->tx_chan);
2254+ dma_release_channel(host->rx_chan);
22572255
22582256 pm_runtime_put_sync(host->dev);
22592257 pm_runtime_disable(host->dev);
drivers/mmc/host/sdhci-esdhc-imx.c+5−2
@@ -76,6 +76,7 @@ · 75 unmodified lines
7676 #define ESDHC_STD_TUNING_EN (1 << 24)
7777 /* NOTE: the minimum valid tuning start tap for mx6sl is 1 */
7878 #define ESDHC_TUNING_START_TAP 0x1
79+#define ESDHC_TUNING_STEP_MASK 0x00070000
7980 #define ESDHC_TUNING_STEP_SHIFT 16
8081
8182 /* pinctrl state */
@@ -489,9 +490,11 @@ static void esdhc_writew_le(struct sdhci_host *host, u16 val, int reg) · 407 unmodified lines
489490 m |= ESDHC_MIX_CTRL_FBCLK_SEL;
490491 tuning_ctrl = readl(host->ioaddr + ESDHC_TUNING_CTRL);
491492 tuning_ctrl |= ESDHC_STD_TUNING_EN | ESDHC_TUNING_START_TAP;
492− if (imx_data->boarddata.tuning_step)
493+ if (imx_data->boarddata.tuning_step) {
494+ tuning_ctrl &= ~ESDHC_TUNING_STEP_MASK;
493495 tuning_ctrl |= imx_data->boarddata.tuning_step << ESDHC_TUNING_STEP_SHIFT;
494− writel(tuning_ctrl, host->ioaddr + ESDHC_TUNING_CTRL);
496+ }
497+ writel(tuning_ctrl, host->ioaddr + ESDHC_TUNING_CTRL);
495498 } else {
496499 v &= ~ESDHC_MIX_CTRL_EXE_TUNE;
497500 }
drivers/mmc/host/sdhci-of-at91.c+73−2
@@ -21,6 +21,8 @@ · 20 unmodified lines
2121 #include <linux/module.h>
2222 #include <linux/of.h>
2323 #include <linux/of_device.h>
24+#include <linux/pm.h>
25+#include <linux/pm_runtime.h>
2426
2527 #include "sdhci-pltfm.h"
2628
@@ -51,6 +53,60 @@ static const struct of_device_id sdhci_at91_dt_match[] = { · 24 unmodified lines
5153 {}
5254 };
5355
56+#ifdef CONFIG_PM
57+static int sdhci_at91_runtime_suspend(struct device *dev)
58+{
59+ struct sdhci_host *host = dev_get_drvdata(dev);
60+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
61+ struct sdhci_at91_priv *priv = pltfm_host->priv;
62+ int ret;
63+
64+ ret = sdhci_runtime_suspend_host(host);
65+
66+ clk_disable_unprepare(priv->gck);
67+ clk_disable_unprepare(priv->hclock);
68+ clk_disable_unprepare(priv->mainck);
69+
70+ return ret;
71+}
72+
73+static int sdhci_at91_runtime_resume(struct device *dev)
74+{
75+ struct sdhci_host *host = dev_get_drvdata(dev);
76+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
77+ struct sdhci_at91_priv *priv = pltfm_host->priv;
78+ int ret;
79+
80+ ret = clk_prepare_enable(priv->mainck);
81+ if (ret) {
82+ dev_err(dev, "can't enable mainck\n");
83+ return ret;
84+ }
85+
86+ ret = clk_prepare_enable(priv->hclock);
87+ if (ret) {
88+ dev_err(dev, "can't enable hclock\n");
89+ return ret;
90+ }
91+
92+ ret = clk_prepare_enable(priv->gck);
93+ if (ret) {
94+ dev_err(dev, "can't enable gck\n");
95+ return ret;
96+ }
97+
98+ return sdhci_runtime_resume_host(host);
99+}
100+#endif /* CONFIG_PM */
101+
102+static const struct dev_pm_ops sdhci_at91_dev_pm_ops = {
103+ SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
104+ pm_runtime_force_resume)
105+ SET_RUNTIME_PM_OPS(sdhci_at91_runtime_suspend,
106+ sdhci_at91_runtime_resume,
107+ NULL)
108+};
109+
54110 static int sdhci_at91_probe(struct platform_device *pdev)
55111 {
56112 const struct of_device_id *match;
@@ -144,12 +200,23 @@ static int sdhci_at91_probe(struct platform_device *pdev) · 87 unmodified lines
144200
145201 sdhci_get_of_property(pdev);
146202
203+ pm_runtime_get_noresume(&pdev->dev);
204+ pm_runtime_set_active(&pdev->dev);
205+ pm_runtime_enable(&pdev->dev);
206+ pm_runtime_set_autosuspend_delay(&pdev->dev, 50);
207+ pm_runtime_use_autosuspend(&pdev->dev);
208+
147209 ret = sdhci_add_host(host);
148210 if (ret)
149− goto clocks_disable_unprepare;
211+ goto pm_runtime_disable;
212+
213+ pm_runtime_put_autosuspend(&pdev->dev);
150214
151215 return 0;
152216
217+pm_runtime_disable:
218+ pm_runtime_disable(&pdev->dev);
219+ pm_runtime_set_suspended(&pdev->dev);
153220 clocks_disable_unprepare:
154221 clk_disable_unprepare(priv->gck);
155222 clk_disable_unprepare(priv->mainck);
@@ -165,6 +232,10 @@ static int sdhci_at91_remove(struct platform_device *pdev) · 9 unmodified lines
165232 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
166233 struct sdhci_at91_priv *priv = pltfm_host->priv;
167234
235+ pm_runtime_get_sync(&pdev->dev);
236+ pm_runtime_disable(&pdev->dev);
237+ pm_runtime_put_noidle(&pdev->dev);
238+
168239 sdhci_pltfm_unregister(pdev);
169240
170241 clk_disable_unprepare(priv->gck);
@@ -178,7 +249,7 @@ static struct platform_driver sdhci_at91_driver = { · 7 unmodified lines
178249 .driver = {
179250 .name = "sdhci-at91",
180251 .of_match_table = sdhci_at91_dt_match,
181− .pm = SDHCI_PLTFM_PMOPS,
252+ .pm = &sdhci_at91_dev_pm_ops,
182253 },
183254 .probe = sdhci_at91_probe,
184255 .remove = sdhci_at91_remove,
drivers/mmc/host/sdhci-of-esdhc.c+10−0
@@ -584,6 +584,8 @@ static int sdhci_esdhc_probe(struct platform_device *pdev) · 583 unmodified lines
584584 {
585585 struct sdhci_host *host;
586586 struct device_node *np;
587+ struct sdhci_pltfm_host *pltfm_host;
588+ struct sdhci_esdhc *esdhc;
587589 int ret;
588590
589591 np = pdev->dev.of_node;
@@ -600,6 +602,14 @@ static int sdhci_esdhc_probe(struct platform_device *pdev) · 10 unmodified lines
600602
601603 sdhci_get_of_property(pdev);
602604
605+ pltfm_host = sdhci_priv(host);
606+ esdhc = pltfm_host->priv;
607+ if (esdhc->vendor_ver == VENDOR_V_22)
608+ host->quirks2 |= SDHCI_QUIRK2_HOST_NO_CMD23;
609+
610+ if (esdhc->vendor_ver > VENDOR_V_22)
611+ host->quirks &= ~SDHCI_QUIRK_NO_BUSY_IRQ;
612+
603613 if (of_device_is_compatible(np, "fsl,p5040-esdhc") ||
604614 of_device_is_compatible(np, "fsl,p5020-esdhc") ||
605615 of_device_is_compatible(np, "fsl,p4080-esdhc") ||
drivers/mmc/host/sdhci-pci-core.c+3−3
@@ -277,7 +277,7 @@ static int spt_select_drive_strength(struct sdhci_host *host, · 276 unmodified lines
277277 if (sdhci_pci_spt_drive_strength > 0)
278278 drive_strength = sdhci_pci_spt_drive_strength & 0xf;
279279 else
280− drive_strength = 1; /* 33-ohm */
280+ drive_strength = 0; /* Default 50-ohm */
281281
282282 if ((mmc_driver_type_mask(drive_strength) & card_drv) == 0)
283283 drive_strength = 0; /* Default 50-ohm */
@@ -1464,7 +1464,7 @@ static int sdhci_pci_resume(struct device *dev) · 1180 unmodified lines
14641464
14651465 static int sdhci_pci_runtime_suspend(struct device *dev)
14661466 {
1467− struct pci_dev *pdev = container_of(dev, struct pci_dev, dev);
1467+ struct pci_dev *pdev = to_pci_dev(dev);
14681468 struct sdhci_pci_chip *chip;
14691469 struct sdhci_pci_slot *slot;
14701470 int i, ret;
@@ -1500,7 +1500,7 @@ err_pci_runtime_suspend: · 29 unmodified lines
15001500
15011501 static int sdhci_pci_runtime_resume(struct device *dev)
15021502 {
1503− struct pci_dev *pdev = container_of(dev, struct pci_dev, dev);
1503+ struct pci_dev *pdev = to_pci_dev(dev);
15041504 struct sdhci_pci_chip *chip;
15051505 struct sdhci_pci_slot *slot;
15061506 int i, ret;
drivers/mmc/host/sdhci-pltfm.c+2−1
@@ -104,7 +104,8 @@ void sdhci_get_of_property(struct platform_device *pdev) · 103 unmodified lines
104104 if (of_find_property(np, "keep-power-in-suspend", NULL))
105105 host->mmc->pm_caps |= MMC_PM_KEEP_POWER;
106106
107− if (of_find_property(np, "enable-sdio-wakeup", NULL))
107+ if (of_property_read_bool(np, "wakeup-source") ||
108+ of_property_read_bool(np, "enable-sdio-wakeup")) /* legacy */
108109 host->mmc->pm_caps |= MMC_PM_WAKE_SDIO_IRQ;
109110 }
110111 #else
drivers/mmc/host/sdhci-tegra.c+151−27
@@ -22,12 +22,20 @@ · 21 unmodified lines
2222 #include <linux/of_device.h>
2323 #include <linux/mmc/card.h>
2424 #include <linux/mmc/host.h>
25+#include <linux/mmc/mmc.h>
2526 #include <linux/mmc/slot-gpio.h>
2627 #include <linux/gpio/consumer.h>
2728
2829 #include "sdhci-pltfm.h"
2930
3031 /* Tegra SDHOST controller vendor register definitions */
32+#define SDHCI_TEGRA_VENDOR_CLOCK_CTRL 0x100
33+#define SDHCI_CLOCK_CTRL_TAP_MASK 0x00ff0000
34+#define SDHCI_CLOCK_CTRL_TAP_SHIFT 16
35+#define SDHCI_CLOCK_CTRL_SDR50_TUNING_OVERRIDE BIT(5)
36+#define SDHCI_CLOCK_CTRL_PADPIPE_CLKEN_OVERRIDE BIT(3)
37+#define SDHCI_CLOCK_CTRL_SPI_MODE_CLKEN_OVERRIDE BIT(2)
38+
3139 #define SDHCI_TEGRA_VENDOR_MISC_CTRL 0x120
3240 #define SDHCI_MISC_CTRL_ENABLE_SDR104 0x8
3341 #define SDHCI_MISC_CTRL_ENABLE_SDR50 0x10
@@ -37,9 +45,9 @@ · 3 unmodified lines
3745 #define NVQUIRK_FORCE_SDHCI_SPEC_200 BIT(0)
3846 #define NVQUIRK_ENABLE_BLOCK_GAP_DET BIT(1)
3947 #define NVQUIRK_ENABLE_SDHCI_SPEC_300 BIT(2)
40−#define NVQUIRK_DISABLE_SDR50 BIT(3)
41−#define NVQUIRK_DISABLE_SDR104 BIT(4)
42−#define NVQUIRK_DISABLE_DDR50 BIT(5)
48+#define NVQUIRK_ENABLE_SDR50 BIT(3)
49+#define NVQUIRK_ENABLE_SDR104 BIT(4)
50+#define NVQUIRK_ENABLE_DDR50 BIT(5)
4351
4452 struct sdhci_tegra_soc_data {
4553 const struct sdhci_pltfm_data *pdata;
@@ -49,6 +57,7 @@ struct sdhci_tegra_soc_data { · 3 unmodified lines
4957 struct sdhci_tegra {
5058 const struct sdhci_tegra_soc_data *soc_data;
5159 struct gpio_desc *power_gpio;
60+ bool ddr_signaling;
5261 };
5362
5463 static u16 tegra_sdhci_readw(struct sdhci_host *host, int reg)
@@ -124,25 +133,33 @@ static void tegra_sdhci_reset(struct sdhci_host *host, u8 mask) · 69 unmodified lines
124133 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
125134 struct sdhci_tegra *tegra_host = pltfm_host->priv;
126135 const struct sdhci_tegra_soc_data *soc_data = tegra_host->soc_data;
127− u32 misc_ctrl;
136+ u32 misc_ctrl, clk_ctrl;
128137
129138 sdhci_reset(host, mask);
130139
131140 if (!(mask & SDHCI_RESET_ALL))
132141 return;
133142
134− misc_ctrl = sdhci_readw(host, SDHCI_TEGRA_VENDOR_MISC_CTRL);
143+ misc_ctrl = sdhci_readl(host, SDHCI_TEGRA_VENDOR_MISC_CTRL);
135144 /* Erratum: Enable SDHCI spec v3.00 support */
136145 if (soc_data->nvquirks & NVQUIRK_ENABLE_SDHCI_SPEC_300)
137146 misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDHCI_SPEC_300;
138− /* Don't advertise UHS modes which aren't supported yet */
139− if (soc_data->nvquirks & NVQUIRK_DISABLE_SDR50)
140− misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR50;
141− if (soc_data->nvquirks & NVQUIRK_DISABLE_DDR50)
142− misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_DDR50;
143− if (soc_data->nvquirks & NVQUIRK_DISABLE_SDR104)
144− misc_ctrl &= ~SDHCI_MISC_CTRL_ENABLE_SDR104;
145− sdhci_writew(host, misc_ctrl, SDHCI_TEGRA_VENDOR_MISC_CTRL);
147+ /* Advertise UHS modes as supported by host */
148+ if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR50)
149+ misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR50;
150+ if (soc_data->nvquirks & NVQUIRK_ENABLE_DDR50)
151+ misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_DDR50;
152+ if (soc_data->nvquirks & NVQUIRK_ENABLE_SDR104)
153+ misc_ctrl |= SDHCI_MISC_CTRL_ENABLE_SDR104;
154+ sdhci_writel(host, misc_ctrl, SDHCI_TEGRA_VENDOR_MISC_CTRL);
155+
156+ clk_ctrl = sdhci_readl(host, SDHCI_TEGRA_VENDOR_CLOCK_CTRL);
157+ clk_ctrl &= ~SDHCI_CLOCK_CTRL_SPI_MODE_CLKEN_OVERRIDE;
158+ if (soc_data->nvquirks & SDHCI_MISC_CTRL_ENABLE_SDR50)
159+ clk_ctrl |= SDHCI_CLOCK_CTRL_SDR50_TUNING_OVERRIDE;
160+ sdhci_writel(host, clk_ctrl, SDHCI_TEGRA_VENDOR_CLOCK_CTRL);
161+
162+ tegra_host->ddr_signaling = false;
146163 }
147164
148165 static void tegra_sdhci_set_bus_width(struct sdhci_host *host, int bus_width)
@@ -164,15 +181,99 @@ static void tegra_sdhci_set_bus_width(struct sdhci_host *host, int bus_width) · 15 unmodified lines
164181 sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
165182 }
166183
184+static void tegra_sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
185+{
186+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
187+ struct sdhci_tegra *tegra_host = pltfm_host->priv;
188+ unsigned long host_clk;
189+
190+ if (!clock)
191+ return;
192+
193+ host_clk = tegra_host->ddr_signaling ? clock * 2 : clock;
194+ clk_set_rate(pltfm_host->clk, host_clk);
195+ host->max_clk = clk_get_rate(pltfm_host->clk);
196+
197+ return sdhci_set_clock(host, clock);
198+}
199+
200+static void tegra_sdhci_set_uhs_signaling(struct sdhci_host *host,
201+ unsigned timing)
202+{
203+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
204+ struct sdhci_tegra *tegra_host = pltfm_host->priv;
205+
206+ if (timing == MMC_TIMING_UHS_DDR50)
207+ tegra_host->ddr_signaling = true;
208+
209+ return sdhci_set_uhs_signaling(host, timing);
210+}
211+
212+static unsigned int tegra_sdhci_get_max_clock(struct sdhci_host *host)
213+{
214+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
215+
216+ /*
217+ * DDR modes require the host to run at double the card frequency, so
218+ * the maximum rate we can support is half of the module input clock.
219+ */
220+ return clk_round_rate(pltfm_host->clk, UINT_MAX) / 2;
221+}
222+
223+static void tegra_sdhci_set_tap(struct sdhci_host *host, unsigned int tap)
224+{
225+ u32 reg;
226+
227+ reg = sdhci_readl(host, SDHCI_TEGRA_VENDOR_CLOCK_CTRL);
228+ reg &= ~SDHCI_CLOCK_CTRL_TAP_MASK;
229+ reg |= tap << SDHCI_CLOCK_CTRL_TAP_SHIFT;
230+ sdhci_writel(host, reg, SDHCI_TEGRA_VENDOR_CLOCK_CTRL);
231+}
232+
233+static int tegra_sdhci_execute_tuning(struct sdhci_host *host, u32 opcode)
234+{
235+ unsigned int min, max;
236+
237+ /*
238+ * Start search for minimum tap value at 10, as smaller values are
239+ * may wrongly be reported as working but fail at higher speeds,
240+ * according to the TRM.
241+ */
242+ min = 10;
243+ while (min < 255) {
244+ tegra_sdhci_set_tap(host, min);
245+ if (!mmc_send_tuning(host->mmc, opcode, NULL))
246+ break;
247+ min++;
248+ }
249+
250+ /* Find the maximum tap value that still passes. */
251+ max = min + 1;
252+ while (max < 255) {
253+ tegra_sdhci_set_tap(host, max);
254+ if (mmc_send_tuning(host->mmc, opcode, NULL)) {
255+ max--;
256+ break;
257+ }
258+ max++;
259+ }
260+
261+ /* The TRM states the ideal tap value is at 75% in the passing range. */
262+ tegra_sdhci_set_tap(host, min + ((max - min) * 3 / 4));
263+
264+ return mmc_send_tuning(host->mmc, opcode, NULL);
265+}
266+
167267 static const struct sdhci_ops tegra_sdhci_ops = {
168268 .get_ro = tegra_sdhci_get_ro,
169269 .read_w = tegra_sdhci_readw,
170270 .write_l = tegra_sdhci_writel,
171− .set_clock = sdhci_set_clock,
271+ .set_clock = tegra_sdhci_set_clock,
172272 .set_bus_width = tegra_sdhci_set_bus_width,
173273 .reset = tegra_sdhci_reset,
174− .set_uhs_signaling = sdhci_set_uhs_signaling,
175− .get_max_clock = sdhci_pltfm_clk_get_max_clock,
274+ .platform_execute_tuning = tegra_sdhci_execute_tuning,
275+ .set_uhs_signaling = tegra_sdhci_set_uhs_signaling,
276+ .get_max_clock = tegra_sdhci_get_max_clock,
176277 };
177278
178279 static const struct sdhci_pltfm_data sdhci_tegra20_pdata = {
@@ -184,7 +285,7 @@ static const struct sdhci_pltfm_data sdhci_tegra20_pdata = { · 5 unmodified lines
184285 .ops = &tegra_sdhci_ops,
185286 };
186287
187−static struct sdhci_tegra_soc_data soc_data_tegra20 = {
288+static const struct sdhci_tegra_soc_data soc_data_tegra20 = {
188289 .pdata = &sdhci_tegra20_pdata,
189290 .nvquirks = NVQUIRK_FORCE_SDHCI_SPEC_200 |
190291 NVQUIRK_ENABLE_BLOCK_GAP_DET,
@@ -197,14 +298,15 @@ static const struct sdhci_pltfm_data sdhci_tegra30_pdata = { · 6 unmodified lines
197298 SDHCI_QUIRK_NO_HISPD_BIT |
198299 SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
199300 SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
301+ .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
200302 .ops = &tegra_sdhci_ops,
201303 };
202304
203−static struct sdhci_tegra_soc_data soc_data_tegra30 = {
305+static const struct sdhci_tegra_soc_data soc_data_tegra30 = {
204306 .pdata = &sdhci_tegra30_pdata,
205307 .nvquirks = NVQUIRK_ENABLE_SDHCI_SPEC_300 |
206− NVQUIRK_DISABLE_SDR50 |
207− NVQUIRK_DISABLE_SDR104,
308+ NVQUIRK_ENABLE_SDR50 |
309+ NVQUIRK_ENABLE_SDR104,
208310 };
209311
210312 static const struct sdhci_ops tegra114_sdhci_ops = {
@@ -212,11 +314,12 @@ static const struct sdhci_ops tegra114_sdhci_ops = { · 1 unmodified line
212314 .read_w = tegra_sdhci_readw,
213315 .write_w = tegra_sdhci_writew,
214316 .write_l = tegra_sdhci_writel,
215− .set_clock = sdhci_set_clock,
317+ .set_clock = tegra_sdhci_set_clock,
216318 .set_bus_width = tegra_sdhci_set_bus_width,
217319 .reset = tegra_sdhci_reset,
218− .set_uhs_signaling = sdhci_set_uhs_signaling,
219− .get_max_clock = sdhci_pltfm_clk_get_max_clock,
320+ .platform_execute_tuning = tegra_sdhci_execute_tuning,
321+ .set_uhs_signaling = tegra_sdhci_set_uhs_signaling,
322+ .get_max_clock = tegra_sdhci_get_max_clock,
220323 };
221324
222325 static const struct sdhci_pltfm_data sdhci_tegra114_pdata = {
@@ -226,17 +329,34 @@ static const struct sdhci_pltfm_data sdhci_tegra114_pdata = { · 3 unmodified lines
226329 SDHCI_QUIRK_NO_HISPD_BIT |
227330 SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
228331 SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
332+ .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
229333 .ops = &tegra114_sdhci_ops,
230334 };
231335
232−static struct sdhci_tegra_soc_data soc_data_tegra114 = {
336+static const struct sdhci_tegra_soc_data soc_data_tegra114 = {
233337 .pdata = &sdhci_tegra114_pdata,
234− .nvquirks = NVQUIRK_DISABLE_SDR50 |
235− NVQUIRK_DISABLE_DDR50 |
236− NVQUIRK_DISABLE_SDR104,
338+ .nvquirks = NVQUIRK_ENABLE_SDR50 |
339+ NVQUIRK_ENABLE_DDR50 |
340+ NVQUIRK_ENABLE_SDR104,
341+};
342+
343+static const struct sdhci_pltfm_data sdhci_tegra210_pdata = {
344+ .quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
345+ SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
346+ SDHCI_QUIRK_SINGLE_POWER_WRITE |
347+ SDHCI_QUIRK_NO_HISPD_BIT |
348+ SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
349+ SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
350+ .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
351+ .ops = &tegra114_sdhci_ops,
352+};
353+
354+static const struct sdhci_tegra_soc_data soc_data_tegra210 = {
355+ .pdata = &sdhci_tegra210_pdata,
237356 };
238357
239358 static const struct of_device_id sdhci_tegra_dt_match[] = {
359+ { .compatible = "nvidia,tegra210-sdhci", .data = &soc_data_tegra210 },
240360 { .compatible = "nvidia,tegra124-sdhci", .data = &soc_data_tegra114 },
241361 { .compatible = "nvidia,tegra114-sdhci", .data = &soc_data_tegra114 },
242362 { .compatible = "nvidia,tegra30-sdhci", .data = &soc_data_tegra30 },
@@ -271,6 +391,7 @@ static int sdhci_tegra_probe(struct platform_device *pdev) · 28 unmodified lines
271391 rc = -ENOMEM;
272392 goto err_alloc_tegra_host;
273393 }
394+ tegra_host->ddr_signaling = false;
274395 tegra_host->soc_data = soc_data;
275396 pltfm_host->priv = tegra_host;
276397
@@ -278,6 +399,9 @@ static int sdhci_tegra_probe(struct platform_device *pdev) · 1 unmodified line
278399 if (rc)
279400 goto err_parse_dt;
280401
402+ if (tegra_host->soc_data->nvquirks & NVQUIRK_ENABLE_DDR50)
403+ host->mmc->caps |= MMC_CAP_1_8V_DDR;
404+
281405 tegra_host->power_gpio = devm_gpiod_get_optional(&pdev->dev, "power",
282406 GPIOD_OUT_HIGH);
283407 if (IS_ERR(tegra_host->power_gpio)) {
drivers/mmc/host/sdhci.c+52−72
@@ -492,7 +492,7 @@ static int sdhci_adma_table_pre(struct sdhci_host *host, · 491 unmodified lines
492492 host->align_buffer, host->align_buffer_sz, direction);
493493 if (dma_mapping_error(mmc_dev(host->mmc), host->align_addr))
494494 goto fail;
495− BUG_ON(host->align_addr & host->align_mask);
495+ BUG_ON(host->align_addr & SDHCI_ADMA2_MASK);
496496
497497 host->sg_count = sdhci_pre_dma_transfer(host, data);
498498 if (host->sg_count < 0)
@@ -514,8 +514,8 @@ static int sdhci_adma_table_pre(struct sdhci_host *host, · 15 unmodified lines
514514 * the (up to three) bytes that screw up the
515515 * alignment.
516516 */
517− offset = (host->align_sz - (addr & host->align_mask)) &
518− host->align_mask;
517+ offset = (SDHCI_ADMA2_ALIGN - (addr & SDHCI_ADMA2_MASK)) &
518+ SDHCI_ADMA2_MASK;
519519 if (offset) {
520520 if (data->flags & MMC_DATA_WRITE) {
521521 buffer = sdhci_kmap_atomic(sg, &flags);
@@ -529,8 +529,8 @@ static int sdhci_adma_table_pre(struct sdhci_host *host, · 7 unmodified lines
529529
530530 BUG_ON(offset > 65536);
531531
532− align += host->align_sz;
533− align_addr += host->align_sz;
532+ align += SDHCI_ADMA2_ALIGN;
533+ align_addr += SDHCI_ADMA2_ALIGN;
534534
535535 desc += host->desc_sz;
536536
@@ -540,9 +540,12 @@ static int sdhci_adma_table_pre(struct sdhci_host *host, · 3 unmodified lines
540540
541541 BUG_ON(len > 65536);
542542
543− /* tran, valid */
544− sdhci_adma_write_desc(host, desc, addr, len, ADMA2_TRAN_VALID);
545− desc += host->desc_sz;
543+ if (len) {
544+ /* tran, valid */
545+ sdhci_adma_write_desc(host, desc, addr, len,
546+ ADMA2_TRAN_VALID);
547+ desc += host->desc_sz;
548+ }
546549
547550 /*
548551 * If this triggers then we have a calculation bug
@@ -608,7 +611,7 @@ static void sdhci_adma_table_post(struct sdhci_host *host, · 59 unmodified lines
608611 /* Do a quick scan of the SG list for any unaligned mappings */
609612 has_unaligned = false;
610613 for_each_sg(data->sg, sg, host->sg_count, i)
611− if (sg_dma_address(sg) & host->align_mask) {
614+ if (sg_dma_address(sg) & SDHCI_ADMA2_MASK) {
612615 has_unaligned = true;
613616 break;
614617 }
@@ -620,15 +623,15 @@ static void sdhci_adma_table_post(struct sdhci_host *host, · 5 unmodified lines
620623 align = host->align_buffer;
621624
622625 for_each_sg(data->sg, sg, host->sg_count, i) {
623− if (sg_dma_address(sg) & host->align_mask) {
624− size = host->align_sz -
625− (sg_dma_address(sg) & host->align_mask);
626+ if (sg_dma_address(sg) & SDHCI_ADMA2_MASK) {
627+ size = SDHCI_ADMA2_ALIGN -
628+ (sg_dma_address(sg) & SDHCI_ADMA2_MASK);
626629
627630 buffer = sdhci_kmap_atomic(sg, &flags);
628631 memcpy(buffer, align, size);
629632 sdhci_kunmap_atomic(buffer, &flags);
630633
631− align += host->align_sz;
634+ align += SDHCI_ADMA2_ALIGN;
632635 }
633636 }
634637 }
@@ -768,8 +771,7 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) · 133 unmodified lines
768771 if (unlikely(broken)) {
769772 for_each_sg(data->sg, sg, data->sg_len, i) {
770773 if (sg->length & 0x3) {
771− DBG("Reverting to PIO because of "
772− "transfer size (%d)\n",
774+ DBG("Reverting to PIO because of transfer size (%d)\n",
773775 sg->length);
774776 host->flags &= ~SDHCI_REQ_USE_DMA;
775777 break;
@@ -803,8 +805,7 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) · 27 unmodified lines
803805 if (unlikely(broken)) {
804806 for_each_sg(data->sg, sg, data->sg_len, i) {
805807 if (sg->offset & 0x3) {
806− DBG("Reverting to PIO because of "
807− "bad alignment\n");
808+ DBG("Reverting to PIO because of bad alignment\n");
808809 host->flags &= ~SDHCI_REQ_USE_DMA;
809810 break;
810811 }
@@ -1016,8 +1017,8 @@ void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) · 205 unmodified lines
10161017
10171018 while (sdhci_readl(host, SDHCI_PRESENT_STATE) & mask) {
10181019 if (timeout == 0) {
1019− pr_err("%s: Controller never released "
1020− "inhibit bit(s).\n", mmc_hostname(host->mmc));
1020+ pr_err("%s: Controller never released inhibit bit(s).\n",
1021+ mmc_hostname(host->mmc));
10211022 sdhci_dumpregs(host);
10221023 cmd->error = -EIO;
10231024 tasklet_schedule(&host->finish_tasklet);
@@ -1254,8 +1255,8 @@ clock_set: · 230 unmodified lines
12541255 while (!((clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL))
12551256 & SDHCI_CLOCK_INT_STABLE)) {
12561257 if (timeout == 0) {
1257− pr_err("%s: Internal clock never "
1258− "stabilised.\n", mmc_hostname(host->mmc));
1258+ pr_err("%s: Internal clock never stabilised.\n",
1259+ mmc_hostname(host->mmc));
12591260 sdhci_dumpregs(host);
12601261 return;
12611262 }
@@ -1274,19 +1275,6 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned char mode, · 12 unmodified lines
12741275 struct mmc_host *mmc = host->mmc;
12751276 u8 pwr = 0;
12761277
1277− if (!IS_ERR(mmc->supply.vmmc)) {
1278− spin_unlock_irq(&host->lock);
1279− mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
1280− spin_lock_irq(&host->lock);
1281−
1282− if (mode != MMC_POWER_OFF)
1283− sdhci_writeb(host, SDHCI_POWER_ON, SDHCI_POWER_CONTROL);
1284− else
1285− sdhci_writeb(host, 0, SDHCI_POWER_CONTROL);
1286−
1287− return;
1288− }
1289−
12901278 if (mode != MMC_POWER_OFF) {
12911279 switch (1 << vdd) {
12921280 case MMC_VDD_165_195:
@@ -1301,7 +1289,9 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned char mode, · 8 unmodified lines
13011289 pwr = SDHCI_POWER_330;
13021290 break;
13031291 default:
1304− BUG();
1292+ WARN(1, "%s: Invalid vdd %#x\n",
1293+ mmc_hostname(host->mmc), vdd);
1294+ break;
13051295 }
13061296 }
13071297
@@ -1345,6 +1335,12 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned char mode, · 37 unmodified lines
13451335 if (host->quirks & SDHCI_QUIRK_DELAY_AFTER_POWER)
13461336 mdelay(10);
13471337 }
1338+
1339+ if (!IS_ERR(mmc->supply.vmmc)) {
1340+ spin_unlock_irq(&host->lock);
1341+ mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
1342+ spin_lock_irq(&host->lock);
1343+ }
13481344 }
13491345
13501346 /*****************************************************************************\
@@ -1540,8 +1536,8 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) · 189 unmodified lines
15401536 else if (ios->drv_type == MMC_SET_DRIVER_TYPE_D)
15411537 ctrl_2 |= SDHCI_CTRL_DRV_TYPE_D;
15421538 else {
1543− pr_warn("%s: invalid driver type, default to "
1544− "driver type B\n", mmc_hostname(mmc));
1539+ pr_warn("%s: invalid driver type, default to driver type B\n",
1540+ mmc_hostname(mmc));
15451541 ctrl_2 |= SDHCI_CTRL_DRV_TYPE_B;
15461542 }
15471543
@@ -2015,10 +2011,7 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode) · 467 unmodified lines
20152011 spin_lock_irqsave(&host->lock, flags);
20162012
20172013 if (!host->tuning_done) {
2018− pr_info(DRIVER_NAME ": Timeout waiting for "
2019− "Buffer Read Ready interrupt during tuning "
2020− "procedure, falling back to fixed sampling "
2021− "clock\n");
2014+ pr_info(DRIVER_NAME ": Timeout waiting for Buffer Read Ready interrupt during tuning procedure, falling back to fixed sampling clock\n");
20222015 ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2);
20232016 ctrl &= ~SDHCI_CTRL_TUNED_CLK;
20242017 ctrl &= ~SDHCI_CTRL_EXEC_TUNING;
@@ -2046,9 +2039,7 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode) · 21 unmodified lines
20462039 sdhci_writew(host, ctrl, SDHCI_HOST_CONTROL2);
20472040 }
20482041 if (!(ctrl & SDHCI_CTRL_TUNED_CLK)) {
2049− pr_info(DRIVER_NAME ": Tuning procedure"
2050− " failed, falling back to fixed sampling"
2051− " clock\n");
2042+ pr_info(DRIVER_NAME ": Tuning procedure failed, falling back to fixed sampling clock\n");
20522043 err = -EIO;
20532044 }
20542045
@@ -2293,8 +2284,8 @@ static void sdhci_timeout_timer(unsigned long data) · 238 unmodified lines
22932284 spin_lock_irqsave(&host->lock, flags);
22942285
22952286 if (host->mrq) {
2296− pr_err("%s: Timeout waiting for hardware "
2297− "interrupt.\n", mmc_hostname(host->mmc));
2287+ pr_err("%s: Timeout waiting for hardware interrupt.\n",
2288+ mmc_hostname(host->mmc));
22982289 sdhci_dumpregs(host);
22992290
23002291 if (host->data) {
@@ -2325,9 +2316,8 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask, u32 *mask) · 24 unmodified lines
23252316 BUG_ON(intmask == 0);
23262317
23272318 if (!host->cmd) {
2328− pr_err("%s: Got command interrupt 0x%08x even "
2329− "though no command operation was in progress.\n",
2330− mmc_hostname(host->mmc), (unsigned)intmask);
2319+ pr_err("%s: Got command interrupt 0x%08x even though no command operation was in progress.\n",
2320+ mmc_hostname(host->mmc), (unsigned)intmask);
23312321 sdhci_dumpregs(host);
23322322 return;
23332323 }
@@ -2356,8 +2346,7 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask, u32 *mask) · 22 unmodified lines
23562346 */
23572347 if (host->cmd->flags & MMC_RSP_BUSY) {
23582348 if (host->cmd->data)
2359− DBG("Cannot wait for busy signal when also "
2360− "doing a data transfer");
2349+ DBG("Cannot wait for busy signal when also doing a data transfer");
23612350 else if (!(host->quirks & SDHCI_QUIRK_NO_BUSY_IRQ)
23622351 && !host->busy_handle) {
23632352 /* Mark that command complete before busy is ended */
@@ -2451,9 +2440,8 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) · 87 unmodified lines
24512440 }
24522441 }
24532442
2454− pr_err("%s: Got data interrupt 0x%08x even "
2455− "though no data operation was in progress.\n",
2456− mmc_hostname(host->mmc), (unsigned)intmask);
2443+ pr_err("%s: Got data interrupt 0x%08x even though no data operation was in progress.\n",
2444+ mmc_hostname(host->mmc), (unsigned)intmask);
24572445 sdhci_dumpregs(host);
24582446
24592447 return;
@@ -2760,7 +2748,7 @@ static int sdhci_runtime_pm_put(struct sdhci_host *host) · 300 unmodified lines
27602748
27612749 static void sdhci_runtime_pm_bus_on(struct sdhci_host *host)
27622750 {
2763− if (host->runtime_suspended || host->bus_on)
2751+ if (host->bus_on)
27642752 return;
27652753 host->bus_on = true;
27662754 pm_runtime_get_noresume(host->mmc->parent);
@@ -2768,7 +2756,7 @@ static void sdhci_runtime_pm_bus_on(struct sdhci_host *host) · 1 unmodified line
27682756
27692757 static void sdhci_runtime_pm_bus_off(struct sdhci_host *host)
27702758 {
2771− if (host->runtime_suspended || !host->bus_on)
2759+ if (!host->bus_on)
27722760 return;
27732761 host->bus_on = false;
27742762 pm_runtime_put_noidle(host->mmc->parent);
@@ -2896,9 +2884,8 @@ int sdhci_add_host(struct sdhci_host *host) · 121 unmodified lines
28962884 host->version = (host->version & SDHCI_SPEC_VER_MASK)
28972885 >> SDHCI_SPEC_VER_SHIFT;
28982886 if (host->version > SDHCI_SPEC_300) {
2899− pr_err("%s: Unknown controller version (%d). "
2900− "You may experience problems.\n", mmc_hostname(mmc),
2901− host->version);
2887+ pr_err("%s: Unknown controller version (%d). You may experience problems.\n",
2888+ mmc_hostname(mmc), host->version);
29022889 }
29032890
29042891 caps[0] = (host->quirks & SDHCI_QUIRK_MISSING_CAPS) ? host->caps :
@@ -2967,24 +2954,17 @@ int sdhci_add_host(struct sdhci_host *host) · 62 unmodified lines
29672954 if (host->flags & SDHCI_USE_64_BIT_DMA) {
29682955 host->adma_table_sz = (SDHCI_MAX_SEGS * 2 + 1) *
29692956 SDHCI_ADMA2_64_DESC_SZ;
2970− host->align_buffer_sz = SDHCI_MAX_SEGS *
2971− SDHCI_ADMA2_64_ALIGN;
29722957 host->desc_sz = SDHCI_ADMA2_64_DESC_SZ;
2973− host->align_sz = SDHCI_ADMA2_64_ALIGN;
2974− host->align_mask = SDHCI_ADMA2_64_ALIGN - 1;
29752958 } else {
29762959 host->adma_table_sz = (SDHCI_MAX_SEGS * 2 + 1) *
29772960 SDHCI_ADMA2_32_DESC_SZ;
2978− host->align_buffer_sz = SDHCI_MAX_SEGS *
2979− SDHCI_ADMA2_32_ALIGN;
29802961 host->desc_sz = SDHCI_ADMA2_32_DESC_SZ;
2981− host->align_sz = SDHCI_ADMA2_32_ALIGN;
2982− host->align_mask = SDHCI_ADMA2_32_ALIGN - 1;
29832962 }
29842963 host->adma_table = dma_alloc_coherent(mmc_dev(mmc),
29852964 host->adma_table_sz,
29862965 &host->adma_addr,
29872966 GFP_KERNEL);
2967+ host->align_buffer_sz = SDHCI_MAX_SEGS * SDHCI_ADMA2_ALIGN;
29882968 host->align_buffer = kmalloc(host->align_buffer_sz, GFP_KERNEL);
29892969 if (!host->adma_table || !host->align_buffer) {
29902970 if (host->adma_table)
@@ -2998,7 +2978,7 @@ int sdhci_add_host(struct sdhci_host *host) · 7 unmodified lines
29982978 host->flags &= ~SDHCI_USE_ADMA;
29992979 host->adma_table = NULL;
30002980 host->align_buffer = NULL;
3001− } else if (host->adma_addr & host->align_mask) {
2981+ } else if (host->adma_addr & (SDHCI_ADMA2_DESC_ALIGN - 1)) {
30022982 pr_warn("%s: unable to allocate aligned ADMA descriptor\n",
30032983 mmc_hostname(mmc));
30042984 host->flags &= ~SDHCI_USE_ADMA;
@@ -3031,8 +3011,8 @@ int sdhci_add_host(struct sdhci_host *host) · 26 unmodified lines
30313011 if (host->max_clk == 0 || host->quirks &
30323012 SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN) {
30333013 if (!host->ops->get_max_clock) {
3034− pr_err("%s: Hardware doesn't specify base clock "
3035− "frequency.\n", mmc_hostname(mmc));
3014+ pr_err("%s: Hardware doesn't specify base clock frequency.\n",
3015+ mmc_hostname(mmc));
30363016 return -ENODEV;
30373017 }
30383018 host->max_clk = host->ops->get_max_clock(host);
@@ -3294,8 +3274,8 @@ int sdhci_add_host(struct sdhci_host *host) · 255 unmodified lines
32943274 mmc->ocr_avail_mmc &= host->ocr_avail_mmc;
32953275
32963276 if (mmc->ocr_avail == 0) {
3297− pr_err("%s: Hardware doesn't report any "
3298− "support voltages.\n", mmc_hostname(mmc));
3277+ pr_err("%s: Hardware doesn't report any support voltages.\n",
3278+ mmc_hostname(mmc));
32993279 return -ENODEV;
33003280 }
33013281
drivers/mmc/host/sdhci.h+12−9
@@ -272,22 +272,27 @@ · 271 unmodified lines
272272 /* ADMA2 32-bit DMA descriptor size */
273273 #define SDHCI_ADMA2_32_DESC_SZ 8
274274
275−/* ADMA2 32-bit DMA alignment */
276−#define SDHCI_ADMA2_32_ALIGN 4
277−
278275 /* ADMA2 32-bit descriptor */
279276 struct sdhci_adma2_32_desc {
280277 __le16 cmd;
281278 __le16 len;
282279 __le32 addr;
283−} __packed __aligned(SDHCI_ADMA2_32_ALIGN);
280+} __packed __aligned(4);
281+
282+/* ADMA2 data alignment */
283+#define SDHCI_ADMA2_ALIGN 4
284+#define SDHCI_ADMA2_MASK (SDHCI_ADMA2_ALIGN - 1)
285+
286+/*
287+ * ADMA2 descriptor alignment. Some controllers (e.g. Intel) require 8 byte
288+ * alignment for the descriptor table even in 32-bit DMA mode. Memory
289+ * allocation is at least 8 byte aligned anyway, so just stipulate 8 always.
290+ */
291+#define SDHCI_ADMA2_DESC_ALIGN 8
284292
285293 /* ADMA2 64-bit DMA descriptor size */
286294 #define SDHCI_ADMA2_64_DESC_SZ 12
287295
288−/* ADMA2 64-bit DMA alignment */
289−#define SDHCI_ADMA2_64_ALIGN 8
290−
291296 /*
292297 * ADMA2 64-bit descriptor. Note 12-byte descriptor can't always be 8-byte
293298 * aligned.
@@ -482,8 +487,6 @@ struct sdhci_host { · 188 unmodified lines
482487 dma_addr_t align_addr; /* Mapped bounce buffer */
483488
484489 unsigned int desc_sz; /* ADMA descriptor size */
485− unsigned int align_sz; /* ADMA alignment */
486− unsigned int align_mask; /* ADMA alignment mask */
487490
488491 struct tasklet_struct finish_tasklet; /* Tasklet structures */
489492
drivers/mmc/host/sh_mmcif.c+38−46
@@ -397,38 +397,26 @@ static void sh_mmcif_start_dma_tx(struct sh_mmcif_host *host) · 396 unmodified lines
397397 }
398398
399399 static struct dma_chan *
400−sh_mmcif_request_dma_one(struct sh_mmcif_host *host,
401− struct sh_mmcif_plat_data *pdata,
402− enum dma_transfer_direction direction)
400+sh_mmcif_request_dma_pdata(struct sh_mmcif_host *host, uintptr_t slave_id)
403401 {
404− struct dma_slave_config cfg = { 0, };
405− struct dma_chan *chan;
406− void *slave_data = NULL;
407− struct resource *res;
408− struct device *dev = sh_mmcif_host_to_dev(host);
409402 dma_cap_mask_t mask;
410− int ret;
411403
412404 dma_cap_zero(mask);
413405 dma_cap_set(DMA_SLAVE, mask);
406+ if (slave_id <= 0)
407+ return NULL;
414408
415− if (pdata)
416− slave_data = direction == DMA_MEM_TO_DEV ?
417− (void *)pdata->slave_id_tx :
418− (void *)pdata->slave_id_rx;
419−
420− chan = dma_request_slave_channel_compat(mask, shdma_chan_filter,
421− slave_data, dev,
422− direction == DMA_MEM_TO_DEV ? "tx" : "rx");
423−
424− dev_dbg(dev, "%s: %s: got channel %p\n", __func__,
425− direction == DMA_MEM_TO_DEV ? "TX" : "RX", chan);
409+ return dma_request_channel(mask, shdma_chan_filter, (void *)slave_id);
410+}
426411
427− if (!chan)
428− return NULL;
412+static int sh_mmcif_dma_slave_config(struct sh_mmcif_host *host,
413+ struct dma_chan *chan,
414+ enum dma_transfer_direction direction)
415+{
416+ struct resource *res;
417+ struct dma_slave_config cfg = { 0, };
429418
430419 res = platform_get_resource(host->pd, IORESOURCE_MEM, 0);
431−
432420 cfg.direction = direction;
433421
434422 if (direction == DMA_DEV_TO_MEM) {
@@ -439,38 +427,42 @@ sh_mmcif_request_dma_one(struct sh_mmcif_host *host, · 4 unmodified lines
439427 cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
440428 }
441429
442− ret = dmaengine_slave_config(chan, &cfg);
443− if (ret < 0) {
444− dma_release_channel(chan);
445− return NULL;
446− }
447−
448− return chan;
430+ return dmaengine_slave_config(chan, &cfg);
449431 }
450432
451−static void sh_mmcif_request_dma(struct sh_mmcif_host *host,
452− struct sh_mmcif_plat_data *pdata)
433+static void sh_mmcif_request_dma(struct sh_mmcif_host *host)
453434 {
454435 struct device *dev = sh_mmcif_host_to_dev(host);
455436 host->dma_active = false;
456437
457− if (pdata) {
458− if (pdata->slave_id_tx <= 0 || pdata->slave_id_rx <= 0)
459− return;
460− } else if (!dev->of_node) {
461− return;
438+ /* We can only either use DMA for both Tx and Rx or not use it at all */
439+ if (IS_ENABLED(CONFIG_SUPERH) && dev->platform_data) {
440+ struct sh_mmcif_plat_data *pdata = dev->platform_data;
441+
442+ host->chan_tx = sh_mmcif_request_dma_pdata(host,
443+ pdata->slave_id_tx);
444+ host->chan_rx = sh_mmcif_request_dma_pdata(host,
445+ pdata->slave_id_rx);
446+ } else {
447+ host->chan_tx = dma_request_slave_channel(dev, "tx");
448+ host->chan_tx = dma_request_slave_channel(dev, "rx");
462449 }
450+ dev_dbg(dev, "%s: got channel TX %p RX %p\n", __func__, host->chan_tx,
451+ host->chan_rx);
463452
464− /* We can only either use DMA for both Tx and Rx or not use it at all */
465− host->chan_tx = sh_mmcif_request_dma_one(host, pdata, DMA_MEM_TO_DEV);
466− if (!host->chan_tx)
467− return;
453+ if (!host->chan_tx || !host->chan_rx ||
454+ sh_mmcif_dma_slave_config(host, host->chan_tx, DMA_MEM_TO_DEV) ||
455+ sh_mmcif_dma_slave_config(host, host->chan_rx, DMA_DEV_TO_MEM))
456+ goto error;
468457
469− host->chan_rx = sh_mmcif_request_dma_one(host, pdata, DMA_DEV_TO_MEM);
470− if (!host->chan_rx) {
458+ return;
459+
460+error:
461+ if (host->chan_tx)
471462 dma_release_channel(host->chan_tx);
472− host->chan_tx = NULL;
473− }
463+ if (host->chan_rx)
464+ dma_release_channel(host->chan_rx);
465+ host->chan_tx = host->chan_rx = NULL;
474466 }
475467
476468 static void sh_mmcif_release_dma(struct sh_mmcif_host *host)
@@ -1102,7 +1094,7 @@ static void sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) · 625 unmodified lines
11021094 if (ios->power_mode == MMC_POWER_UP) {
11031095 if (!host->card_present) {
11041096 /* See if we also get DMA */
1105− sh_mmcif_request_dma(host, dev->platform_data);
1097+ sh_mmcif_request_dma(host);
11061098 host->card_present = true;
11071099 }
11081100 sh_mmcif_set_power(host, ios);
drivers/mmc/host/usdhi6rol0.c+2−1
@@ -1634,7 +1634,7 @@ static void usdhi6_timeout_work(struct work_struct *work) · 1633 unmodified lines
16341634 struct usdhi6_host *host = container_of(d, struct usdhi6_host, timeout_work);
16351635 struct mmc_request *mrq = host->mrq;
16361636 struct mmc_data *data = mrq ? mrq->data : NULL;
1637− struct scatterlist *sg = host->sg ?: data->sg;
1637+ struct scatterlist *sg;
16381638
16391639 dev_warn(mmc_dev(host->mmc),
16401640 "%s timeout wait %u CMD%d: IRQ 0x%08x:0x%08x, last IRQ 0x%08x\n",
@@ -1666,6 +1666,7 @@ static void usdhi6_timeout_work(struct work_struct *work) · 25 unmodified lines
16661666 case USDHI6_WAIT_FOR_MWRITE:
16671667 case USDHI6_WAIT_FOR_READ:
16681668 case USDHI6_WAIT_FOR_WRITE:
1669+ sg = host->sg ?: data->sg;
16691670 dev_dbg(mmc_dev(host->mmc),
16701671 "%c: page #%u @ +0x%zx %ux%u in SG%u. Current SG %u bytes @ %u\n",
16711672 data->flags & MMC_DATA_READ ? 'R' : 'W', host->page_idx,
include/linux/mmc/dw_mmc.h+3−9
@@ -172,7 +172,7 @@ struct dw_mci { · 171 unmodified lines
172172 /* For edmac */
173173 struct dw_mci_dma_slave *dms;
174174 /* Registers's physical base address */
175− void *phy_regs;
175+ resource_size_t phy_regs;
176176
177177 u32 cmd_status;
178178 u32 data_status;
@@ -235,16 +235,10 @@ struct dw_mci_dma_ops { · 56 unmodified lines
235235 };
236236
237237 /* IP Quirks/flags. */
238−/* DTO fix for command transmission with IDMAC configured */
239−#define DW_MCI_QUIRK_IDMAC_DTO BIT(0)
240−/* delay needed between retries on some 2.11a implementations */
241−#define DW_MCI_QUIRK_RETRY_DELAY BIT(1)
242−/* High Speed Capable - Supports HS cards (up to 50MHz) */
243−#define DW_MCI_QUIRK_HIGHSPEED BIT(2)
244238 /* Unreliable card detection */
245−#define DW_MCI_QUIRK_BROKEN_CARD_DETECTION BIT(3)
239+#define DW_MCI_QUIRK_BROKEN_CARD_DETECTION BIT(0)
246240 /* Timer for broken data transfer over scheme */
247−#define DW_MCI_QUIRK_BROKEN_DTO BIT(4)
241+#define DW_MCI_QUIRK_BROKEN_DTO BIT(1)
248242
249243 struct dma_pdata;
250244
include/linux/mmc/host.h+3−3
@@ -212,7 +212,9 @@ struct mmc_host { · 211 unmodified lines
212212 u32 ocr_avail_sdio; /* SDIO-specific OCR */
213213 u32 ocr_avail_sd; /* SD-specific OCR */
214214 u32 ocr_avail_mmc; /* MMC-specific OCR */
215+#ifdef CONFIG_PM_SLEEP
215216 struct notifier_block pm_notify;
217+#endif
216218 u32 max_current_330;
217219 u32 max_current_300;
218220 u32 max_current_180;
@@ -259,7 +261,6 @@ struct mmc_host { · 40 unmodified lines
259261 #define MMC_CAP_UHS_SDR50 (1 << 17) /* Host supports UHS SDR50 mode */
260262 #define MMC_CAP_UHS_SDR104 (1 << 18) /* Host supports UHS SDR104 mode */
261263 #define MMC_CAP_UHS_DDR50 (1 << 19) /* Host supports UHS DDR50 mode */
262−#define MMC_CAP_RUNTIME_RESUME (1 << 20) /* Resume at runtime_resume. */
263264 #define MMC_CAP_DRIVER_TYPE_A (1 << 23) /* Host supports Driver Type A */
264265 #define MMC_CAP_DRIVER_TYPE_C (1 << 24) /* Host supports Driver Type C */
265266 #define MMC_CAP_DRIVER_TYPE_D (1 << 25) /* Host supports Driver Type D */
@@ -289,6 +290,7 @@ struct mmc_host { · 23 unmodified lines
289290 #define MMC_CAP2_HSX00_1_2V (MMC_CAP2_HS200_1_2V_SDR | MMC_CAP2_HS400_1_2V)
290291 #define MMC_CAP2_SDIO_IRQ_NOTHREAD (1 << 17)
291292 #define MMC_CAP2_NO_WRITE_PROTECT (1 << 18) /* No physical write protect pin, assume that card is always read-write */
293+#define MMC_CAP2_NO_SDIO (1 << 19) /* Do not send SDIO commands during initialization */
292294
293295 mmc_pm_flag_t pm_caps; /* supported pm features */
294296
@@ -434,8 +436,6 @@ static inline int mmc_regulator_set_vqmmc(struct mmc_host *mmc, · 139 unmodified lines
434436
435437 int mmc_regulator_get_supply(struct mmc_host *mmc);
436438
437−int mmc_pm_notify(struct notifier_block *notify_block, unsigned long, void *);
438−
439439 static inline int mmc_card_is_removable(struct mmc_host *host)
440440 {
441441 return !(host->caps & MMC_CAP_NONREMOVABLE);
include/linux/platform_data/mmc-mvsdio.h+0−18
@@ -1,18 +0,0 @@
1−/*
2− * This file is licensed under the terms of the GNU General Public
3− * License version 2. This program is licensed "as is" without any
4− * warranty of any kind, whether express or implied.
5− */
6−
7−#ifndef __MMC_MVSDIO_H
8−#define __MMC_MVSDIO_H
9−
10−#include <linux/mbus.h>
11−
12−struct mvsdio_platform_data {
13− unsigned int clock;
14− int gpio_card_detect;
15− int gpio_write_protect;
16−};
17−
18−#endif
lib/Kconfig.debug+1−2
@@ -1534,8 +1534,7 @@ config FAIL_IO_TIMEOUT · 1533 unmodified lines
15341534
15351535 config FAIL_MMC_REQUEST
15361536 bool "Fault-injection capability for MMC IO"
1537− select DEBUG_FS
1538− depends on FAULT_INJECTION && MMC
1537+ depends on FAULT_INJECTION_DEBUG_FS && MMC
15391538 help
15401539 Provide fault-injection capability for MMC IO.
15411540 This will make the mmc core return data errors. This is

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t