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

Configure Feed

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

Merge tag 'mmc-v5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc

Pull MMC fixes from Ulf Hansson:

- tmio: Re-enable card irqs after a reset

- mtk-sd: Fixup probing of cqhci for crypto

- cqhci: Fix support for suspend/resume

- vub300: Fix control-message timeouts

- dw_mmc-exynos: Fix support for tuning

- winbond: Silences build errors on M68K

- sdhci-esdhc-imx: Fix support for tuning

- sdhci-pci: Read card detect from ACPI for Intel Merrifield

- sdhci: Fix eMMC support for Thundercomm TurboX CM2290

* tag 'mmc-v5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
mmc: tmio: reenable card irqs after the reset callback
mmc: mediatek: Move cqhci init behind ungate clock
mmc: cqhci: clear HALT state after CQE enable
mmc: vub300: fix control-message timeouts
mmc: dw_mmc: exynos: fix the finding clock sample value
mmc: winbond: don't build on M68K
mmc: sdhci-esdhc-imx: clear the buffer_read_ready to reset standard tuning circuit
mmc: sdhci-pci: Read card detect from ACPI for Intel Merrifield
mmc: sdhci: Map more voltage level to SDHCI_POWER_330

+104 -39
+1 -1
drivers/mmc/host/Kconfig
··· 506 506 507 507 config MMC_WBSD 508 508 tristate "Winbond W83L51xD SD/MMC Card Interface support" 509 - depends on ISA_DMA_API 509 + depends on ISA_DMA_API && !M68K 510 510 help 511 511 This selects the Winbond(R) W83L51xD Secure digital and 512 512 Multimedia card Interface.
+3
drivers/mmc/host/cqhci-core.c
··· 282 282 283 283 cqhci_writel(cq_host, cqcfg, CQHCI_CFG); 284 284 285 + if (cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT) 286 + cqhci_writel(cq_host, 0, CQHCI_CTL); 287 + 285 288 mmc->cqe_on = true; 286 289 287 290 if (cq_host->ops->enable)
+14
drivers/mmc/host/dw_mmc-exynos.c
··· 464 464 } 465 465 } 466 466 467 + /* 468 + * If there is no cadiates value, then it needs to return -EIO. 469 + * If there are candiates values and don't find bset clk sample value, 470 + * then use a first candiates clock sample value. 471 + */ 472 + for (i = 0; i < iter; i++) { 473 + __c = ror8(candiates, i); 474 + if ((__c & 0x1) == 0x1) { 475 + loc = i; 476 + goto out; 477 + } 478 + } 467 479 out: 468 480 return loc; 469 481 } ··· 506 494 priv->tuned_sample = found; 507 495 } else { 508 496 ret = -EIO; 497 + dev_warn(&mmc->class_dev, 498 + "There is no candiates value about clksmpl!\n"); 509 499 } 510 500 511 501 return ret;
+19 -19
drivers/mmc/host/mtk-sd.c
··· 2577 2577 host->dma_mask = DMA_BIT_MASK(32); 2578 2578 mmc_dev(mmc)->dma_mask = &host->dma_mask; 2579 2579 2580 + host->timeout_clks = 3 * 1048576; 2581 + host->dma.gpd = dma_alloc_coherent(&pdev->dev, 2582 + 2 * sizeof(struct mt_gpdma_desc), 2583 + &host->dma.gpd_addr, GFP_KERNEL); 2584 + host->dma.bd = dma_alloc_coherent(&pdev->dev, 2585 + MAX_BD_NUM * sizeof(struct mt_bdma_desc), 2586 + &host->dma.bd_addr, GFP_KERNEL); 2587 + if (!host->dma.gpd || !host->dma.bd) { 2588 + ret = -ENOMEM; 2589 + goto release_mem; 2590 + } 2591 + msdc_init_gpd_bd(host, &host->dma); 2592 + INIT_DELAYED_WORK(&host->req_timeout, msdc_request_timeout); 2593 + spin_lock_init(&host->lock); 2594 + 2595 + platform_set_drvdata(pdev, mmc); 2596 + msdc_ungate_clock(host); 2597 + msdc_init_hw(host); 2598 + 2580 2599 if (mmc->caps2 & MMC_CAP2_CQE) { 2581 2600 host->cq_host = devm_kzalloc(mmc->parent, 2582 2601 sizeof(*host->cq_host), ··· 2615 2596 /* 0 size, means 65536 so we don't have to -1 here */ 2616 2597 mmc->max_seg_size = 64 * 1024; 2617 2598 } 2618 - 2619 - host->timeout_clks = 3 * 1048576; 2620 - host->dma.gpd = dma_alloc_coherent(&pdev->dev, 2621 - 2 * sizeof(struct mt_gpdma_desc), 2622 - &host->dma.gpd_addr, GFP_KERNEL); 2623 - host->dma.bd = dma_alloc_coherent(&pdev->dev, 2624 - MAX_BD_NUM * sizeof(struct mt_bdma_desc), 2625 - &host->dma.bd_addr, GFP_KERNEL); 2626 - if (!host->dma.gpd || !host->dma.bd) { 2627 - ret = -ENOMEM; 2628 - goto release_mem; 2629 - } 2630 - msdc_init_gpd_bd(host, &host->dma); 2631 - INIT_DELAYED_WORK(&host->req_timeout, msdc_request_timeout); 2632 - spin_lock_init(&host->lock); 2633 - 2634 - platform_set_drvdata(pdev, mmc); 2635 - msdc_ungate_clock(host); 2636 - msdc_init_hw(host); 2637 2599 2638 2600 ret = devm_request_irq(&pdev->dev, host->irq, msdc_irq, 2639 2601 IRQF_TRIGGER_NONE, pdev->name, host);
+16
drivers/mmc/host/sdhci-esdhc-imx.c
··· 1187 1187 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); 1188 1188 struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); 1189 1189 u32 ctrl; 1190 + int ret; 1190 1191 1191 1192 /* Reset the tuning circuit */ 1192 1193 if (esdhc_is_usdhc(imx_data)) { ··· 1200 1199 } else if (imx_data->socdata->flags & ESDHC_FLAG_STD_TUNING) { 1201 1200 ctrl = readl(host->ioaddr + SDHCI_AUTO_CMD_STATUS); 1202 1201 ctrl &= ~ESDHC_MIX_CTRL_SMPCLK_SEL; 1202 + ctrl &= ~ESDHC_MIX_CTRL_EXE_TUNE; 1203 1203 writel(ctrl, host->ioaddr + SDHCI_AUTO_CMD_STATUS); 1204 + /* Make sure ESDHC_MIX_CTRL_EXE_TUNE cleared */ 1205 + ret = readl_poll_timeout(host->ioaddr + SDHCI_AUTO_CMD_STATUS, 1206 + ctrl, !(ctrl & ESDHC_MIX_CTRL_EXE_TUNE), 1, 50); 1207 + if (ret == -ETIMEDOUT) 1208 + dev_warn(mmc_dev(host->mmc), 1209 + "Warning! clear execute tuning bit failed\n"); 1210 + /* 1211 + * SDHCI_INT_DATA_AVAIL is W1C bit, set this bit will clear the 1212 + * usdhc IP internal logic flag execute_tuning_with_clr_buf, which 1213 + * will finally make sure the normal data transfer logic correct. 1214 + */ 1215 + ctrl = readl(host->ioaddr + SDHCI_INT_STATUS); 1216 + ctrl |= SDHCI_INT_DATA_AVAIL; 1217 + writel(ctrl, host->ioaddr + SDHCI_INT_STATUS); 1204 1218 } 1205 1219 } 1206 1220 }
+24 -5
drivers/mmc/host/sdhci-pci-core.c
··· 616 616 return intel_host->drv_strength; 617 617 } 618 618 619 - static int bxt_get_cd(struct mmc_host *mmc) 619 + static int sdhci_get_cd_nogpio(struct mmc_host *mmc) 620 620 { 621 - int gpio_cd = mmc_gpio_get_cd(mmc); 622 621 struct sdhci_host *host = mmc_priv(mmc); 623 622 unsigned long flags; 624 623 int ret = 0; 625 - 626 - if (!gpio_cd) 627 - return 0; 628 624 629 625 spin_lock_irqsave(&host->lock, flags); 630 626 ··· 632 636 spin_unlock_irqrestore(&host->lock, flags); 633 637 634 638 return ret; 639 + } 640 + 641 + static int bxt_get_cd(struct mmc_host *mmc) 642 + { 643 + int gpio_cd = mmc_gpio_get_cd(mmc); 644 + 645 + if (!gpio_cd) 646 + return 0; 647 + 648 + return sdhci_get_cd_nogpio(mmc); 649 + } 650 + 651 + static int mrfld_get_cd(struct mmc_host *mmc) 652 + { 653 + return sdhci_get_cd_nogpio(mmc); 635 654 } 636 655 637 656 #define SDHCI_INTEL_PWR_TIMEOUT_CNT 20 ··· 1352 1341 MMC_CAP_1_8V_DDR; 1353 1342 break; 1354 1343 case INTEL_MRFLD_SD: 1344 + slot->cd_idx = 0; 1345 + slot->cd_override_level = true; 1346 + /* 1347 + * There are two PCB designs of SD card slot with the opposite 1348 + * card detection sense. Quirk this out by ignoring GPIO state 1349 + * completely in the custom ->get_cd() callback. 1350 + */ 1351 + slot->host->mmc_host_ops.get_cd = mrfld_get_cd; 1355 1352 slot->host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V; 1356 1353 break; 1357 1354 case INTEL_MRFLD_SDIO:
+6
drivers/mmc/host/sdhci.c
··· 2042 2042 break; 2043 2043 case MMC_VDD_32_33: 2044 2044 case MMC_VDD_33_34: 2045 + /* 2046 + * 3.4 ~ 3.6V are valid only for those platforms where it's 2047 + * known that the voltage range is supported by hardware. 2048 + */ 2049 + case MMC_VDD_34_35: 2050 + case MMC_VDD_35_36: 2045 2051 pwr = SDHCI_POWER_330; 2046 2052 break; 2047 2053 default:
+12 -5
drivers/mmc/host/tmio_mmc_core.c
··· 195 195 sd_ctrl_write32_as_16_and_16(host, CTL_IRQ_MASK, host->sdcard_irq_mask_all); 196 196 host->sdcard_irq_mask = host->sdcard_irq_mask_all; 197 197 198 + if (host->native_hotplug) 199 + tmio_mmc_enable_mmc_irqs(host, 200 + TMIO_STAT_CARD_REMOVE | TMIO_STAT_CARD_INSERT); 201 + 198 202 tmio_mmc_set_bus_width(host, host->mmc->ios.bus_width); 199 203 200 204 if (host->pdata->flags & TMIO_MMC_SDIO_IRQ) { ··· 960 956 case MMC_POWER_OFF: 961 957 tmio_mmc_power_off(host); 962 958 /* For R-Car Gen2+, we need to reset SDHI specific SCC */ 963 - if (host->pdata->flags & TMIO_MMC_MIN_RCAR2) 959 + if (host->pdata->flags & TMIO_MMC_MIN_RCAR2) { 964 960 host->reset(host); 961 + 962 + if (host->native_hotplug) 963 + tmio_mmc_enable_mmc_irqs(host, 964 + TMIO_STAT_CARD_REMOVE | 965 + TMIO_STAT_CARD_INSERT); 966 + } 967 + 965 968 host->set_clock(host, 0); 966 969 break; 967 970 case MMC_POWER_UP: ··· 1195 1184 1196 1185 _host->set_clock(_host, 0); 1197 1186 tmio_mmc_reset(_host); 1198 - 1199 - if (_host->native_hotplug) 1200 - tmio_mmc_enable_mmc_irqs(_host, 1201 - TMIO_STAT_CARD_REMOVE | TMIO_STAT_CARD_INSERT); 1202 1187 1203 1188 spin_lock_init(&_host->lock); 1204 1189 mutex_init(&_host->ios_lock);
+9 -9
drivers/mmc/host/vub300.c
··· 576 576 GET_SYSTEM_PORT_STATUS, 577 577 USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 578 578 0x0000, 0x0000, &vub300->system_port_status, 579 - sizeof(vub300->system_port_status), HZ); 579 + sizeof(vub300->system_port_status), 1000); 580 580 if (sizeof(vub300->system_port_status) == retval) 581 581 new_system_port_status(vub300); 582 582 } ··· 1241 1241 SET_INTERRUPT_PSEUDOCODE, 1242 1242 USB_DIR_OUT | USB_TYPE_VENDOR | 1243 1243 USB_RECIP_DEVICE, 0x0000, 0x0000, 1244 - xfer_buffer, xfer_length, HZ); 1244 + xfer_buffer, xfer_length, 1000); 1245 1245 kfree(xfer_buffer); 1246 1246 if (retval < 0) 1247 1247 goto copy_error_message; ··· 1284 1284 SET_TRANSFER_PSEUDOCODE, 1285 1285 USB_DIR_OUT | USB_TYPE_VENDOR | 1286 1286 USB_RECIP_DEVICE, 0x0000, 0x0000, 1287 - xfer_buffer, xfer_length, HZ); 1287 + xfer_buffer, xfer_length, 1000); 1288 1288 kfree(xfer_buffer); 1289 1289 if (retval < 0) 1290 1290 goto copy_error_message; ··· 1991 1991 usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0), 1992 1992 SET_CLOCK_SPEED, 1993 1993 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 1994 - 0x00, 0x00, buf, buf_array_size, HZ); 1994 + 0x00, 0x00, buf, buf_array_size, 1000); 1995 1995 if (retval != 8) { 1996 1996 dev_err(&vub300->udev->dev, "SET_CLOCK_SPEED" 1997 1997 " %dkHz failed with retval=%d\n", kHzClock, retval); ··· 2013 2013 usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0), 2014 2014 SET_SD_POWER, 2015 2015 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 2016 - 0x0000, 0x0000, NULL, 0, HZ); 2016 + 0x0000, 0x0000, NULL, 0, 1000); 2017 2017 /* must wait for the VUB300 u-proc to boot up */ 2018 2018 msleep(600); 2019 2019 } else if ((ios->power_mode == MMC_POWER_UP) && !vub300->card_powered) { 2020 2020 usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0), 2021 2021 SET_SD_POWER, 2022 2022 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 2023 - 0x0001, 0x0000, NULL, 0, HZ); 2023 + 0x0001, 0x0000, NULL, 0, 1000); 2024 2024 msleep(600); 2025 2025 vub300->card_powered = 1; 2026 2026 } else if (ios->power_mode == MMC_POWER_ON) { ··· 2275 2275 GET_HC_INF0, 2276 2276 USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 2277 2277 0x0000, 0x0000, &vub300->hc_info, 2278 - sizeof(vub300->hc_info), HZ); 2278 + sizeof(vub300->hc_info), 1000); 2279 2279 if (retval < 0) 2280 2280 goto error5; 2281 2281 retval = 2282 2282 usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0), 2283 2283 SET_ROM_WAIT_STATES, 2284 2284 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 2285 - firmware_rom_wait_states, 0x0000, NULL, 0, HZ); 2285 + firmware_rom_wait_states, 0x0000, NULL, 0, 1000); 2286 2286 if (retval < 0) 2287 2287 goto error5; 2288 2288 dev_info(&vub300->udev->dev, ··· 2297 2297 GET_SYSTEM_PORT_STATUS, 2298 2298 USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 2299 2299 0x0000, 0x0000, &vub300->system_port_status, 2300 - sizeof(vub300->system_port_status), HZ); 2300 + sizeof(vub300->system_port_status), 1000); 2301 2301 if (retval < 0) { 2302 2302 goto error4; 2303 2303 } else if (sizeof(vub300->system_port_status) == retval) {