MMC host:

- sunxi-mmc: Fix clock refcount imbalance during unbind
  - sdhci-esdhc-imx: Fix some tuning settings
 -----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCgA1FiEEugLDXPmKSktSkQsV/iaEJXNYjCkFAmPKa/MXHHVsZi5oYW5z
 c29uQGxpbmFyby5vcmcACgkQ/iaEJXNYjClREA//VmX8lBTD2I5FeHPwF5m4HRz7
 jycUjqBFe5PpB6jvqkpPHQmaKkyouXkfdhVhrBKVnatSKvBDDRRjWL/yiG7tNW3r
 2uOEYmzCobVRrmcvAJsk2Bxu6b8/YchdYNxR0bVU84z1VDM6skyiVGPlde6Xw9e6
 ZLz3ZDDARS6GGFIIZu+mlMI5PHi16mdIXjoihev+zNY3ctwGPxWU9Id9kgGOYYrF
 1DSu/u5K3XyE8XWc/yjgP5UD5PEEsbWOQ5HaAbA3WxlTkzHm27CYScrnBc/YQGwJ
 foy91zhj7vPuEP5Ef0wG8CBkrLdPjFZ1B5ENSOG9O66rTQwpp22Z0qEUkfBI91lH
 hGI3dGm6bYuIdDqS4BWuDSI4jbyIn7w87NROHjXr39U87FpswoN3fwg9ctJMfW2S
 d2NvKN8uRJqw2SfsHbISSakJp3ULWtQAbNHsadIDYTyfh/hott65sSTS/faA2qt1
 9AqQ41OaoAnYB3DXglyNBReZyNFDn0D9D1TKI6CtuoRiEkLyeButjqniesIs+0c+
 oRuGRjMBIoePY31vTRK9/s9bM0ieTrRW+HsyohciEW0X7X9YAIFC0uP2d/01R5NW
 q0/lBy+nBvFrbWHxLfu+oGs1wQ/ZNlb7aaP4WlvIvgA1KaqxyBQhZuy1Kq7g02wE
 s7evUrpmmbcROoMYGdA=
 =v3Cn
 -----END PGP SIGNATURE-----

Merge tag 'mmc-v6.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc

Pull MMC fixes from Ulf Hansson:

 - sunxi-mmc: Fix clock refcount imbalance during unbind

 - sdhci-esdhc-imx: Fix some tuning settings

* tag 'mmc-v6.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
  mmc: sunxi-mmc: Fix clock refcount imbalance during unbind
  mmc: sdhci-esdhc-imx: correct the tuning start tap and step setting
This commit is contained in:
Linus Torvalds 2023-01-20 11:04:59 -08:00
commit 1670d7e69b
2 changed files with 20 additions and 10 deletions

View File

@ -107,6 +107,7 @@
#define ESDHC_TUNING_START_TAP_DEFAULT 0x1
#define ESDHC_TUNING_START_TAP_MASK 0x7f
#define ESDHC_TUNING_CMD_CRC_CHECK_DISABLE (1 << 7)
#define ESDHC_TUNING_STEP_DEFAULT 0x1
#define ESDHC_TUNING_STEP_MASK 0x00070000
#define ESDHC_TUNING_STEP_SHIFT 16
@ -1368,7 +1369,7 @@ static void sdhci_esdhc_imx_hwinit(struct sdhci_host *host)
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host);
struct cqhci_host *cq_host = host->mmc->cqe_private;
int tmp;
u32 tmp;
if (esdhc_is_usdhc(imx_data)) {
/*
@ -1423,17 +1424,24 @@ static void sdhci_esdhc_imx_hwinit(struct sdhci_host *host)
if (imx_data->socdata->flags & ESDHC_FLAG_STD_TUNING) {
tmp = readl(host->ioaddr + ESDHC_TUNING_CTRL);
tmp |= ESDHC_STD_TUNING_EN |
ESDHC_TUNING_START_TAP_DEFAULT;
if (imx_data->boarddata.tuning_start_tap) {
tmp &= ~ESDHC_TUNING_START_TAP_MASK;
tmp |= ESDHC_STD_TUNING_EN;
/*
* ROM code or bootloader may config the start tap
* and step, unmask them first.
*/
tmp &= ~(ESDHC_TUNING_START_TAP_MASK | ESDHC_TUNING_STEP_MASK);
if (imx_data->boarddata.tuning_start_tap)
tmp |= imx_data->boarddata.tuning_start_tap;
}
else
tmp |= ESDHC_TUNING_START_TAP_DEFAULT;
if (imx_data->boarddata.tuning_step) {
tmp &= ~ESDHC_TUNING_STEP_MASK;
tmp |= imx_data->boarddata.tuning_step
<< ESDHC_TUNING_STEP_SHIFT;
} else {
tmp |= ESDHC_TUNING_STEP_DEFAULT
<< ESDHC_TUNING_STEP_SHIFT;
}
/* Disable the CMD CRC check for tuning, if not, need to

View File

@ -1492,9 +1492,11 @@ static int sunxi_mmc_remove(struct platform_device *pdev)
struct sunxi_mmc_host *host = mmc_priv(mmc);
mmc_remove_host(mmc);
pm_runtime_force_suspend(&pdev->dev);
disable_irq(host->irq);
sunxi_mmc_disable(host);
pm_runtime_disable(&pdev->dev);
if (!pm_runtime_status_suspended(&pdev->dev)) {
disable_irq(host->irq);
sunxi_mmc_disable(host);
}
dma_free_coherent(&pdev->dev, PAGE_SIZE, host->sg_cpu, host->sg_dma);
mmc_free_host(mmc);