Commit 461d2815 authored by Linus Torvalds's avatar Linus Torvalds

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

Pull MMC fixes from Ulf Hansson:

 - cavium: Fix DMA support

 - sdhci-sprd: Fix soft reset when runtime resuming"

* tag 'mmc-v5.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
  mmc: cavium: Add the missing dma unmap when the dma has finished.
  mmc: cavium: Set the correct dma max segment size for mmc_host
  mmc: sdhci-sprd: Fix the incorrect soft reset operation when runtime resuming
parents ec4c99ad b803974a
...@@ -374,6 +374,7 @@ static int finish_dma_single(struct cvm_mmc_host *host, struct mmc_data *data) ...@@ -374,6 +374,7 @@ static int finish_dma_single(struct cvm_mmc_host *host, struct mmc_data *data)
{ {
data->bytes_xfered = data->blocks * data->blksz; data->bytes_xfered = data->blocks * data->blksz;
data->error = 0; data->error = 0;
dma_unmap_sg(host->dev, data->sg, data->sg_len, get_dma_dir(data));
return 1; return 1;
} }
...@@ -1046,7 +1047,8 @@ int cvm_mmc_of_slot_probe(struct device *dev, struct cvm_mmc_host *host) ...@@ -1046,7 +1047,8 @@ int cvm_mmc_of_slot_probe(struct device *dev, struct cvm_mmc_host *host)
mmc->max_segs = 1; mmc->max_segs = 1;
/* DMA size field can address up to 8 MB */ /* DMA size field can address up to 8 MB */
mmc->max_seg_size = 8 * 1024 * 1024; mmc->max_seg_size = min_t(unsigned int, 8 * 1024 * 1024,
dma_get_max_seg_size(host->dev));
mmc->max_req_size = mmc->max_seg_size; mmc->max_req_size = mmc->max_seg_size;
/* External DMA is in 512 byte blocks */ /* External DMA is in 512 byte blocks */
mmc->max_blk_size = 512; mmc->max_blk_size = 512;
......
...@@ -883,7 +883,7 @@ static int sdhci_acpi_runtime_resume(struct device *dev) ...@@ -883,7 +883,7 @@ static int sdhci_acpi_runtime_resume(struct device *dev)
sdhci_acpi_byt_setting(&c->pdev->dev); sdhci_acpi_byt_setting(&c->pdev->dev);
return sdhci_runtime_resume_host(c->host); return sdhci_runtime_resume_host(c->host, 0);
} }
#endif #endif
......
...@@ -1705,7 +1705,7 @@ static int sdhci_esdhc_runtime_resume(struct device *dev) ...@@ -1705,7 +1705,7 @@ static int sdhci_esdhc_runtime_resume(struct device *dev)
esdhc_pltfm_set_clock(host, imx_data->actual_clock); esdhc_pltfm_set_clock(host, imx_data->actual_clock);
} }
err = sdhci_runtime_resume_host(host); err = sdhci_runtime_resume_host(host, 0);
if (err) if (err)
goto disable_ipg_clk; goto disable_ipg_clk;
......
...@@ -289,7 +289,7 @@ static int sdhci_at91_runtime_resume(struct device *dev) ...@@ -289,7 +289,7 @@ static int sdhci_at91_runtime_resume(struct device *dev)
} }
out: out:
return sdhci_runtime_resume_host(host); return sdhci_runtime_resume_host(host, 0);
} }
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
......
...@@ -167,7 +167,7 @@ static int sdhci_pci_runtime_suspend_host(struct sdhci_pci_chip *chip) ...@@ -167,7 +167,7 @@ static int sdhci_pci_runtime_suspend_host(struct sdhci_pci_chip *chip)
err_pci_runtime_suspend: err_pci_runtime_suspend:
while (--i >= 0) while (--i >= 0)
sdhci_runtime_resume_host(chip->slots[i]->host); sdhci_runtime_resume_host(chip->slots[i]->host, 0);
return ret; return ret;
} }
...@@ -181,7 +181,7 @@ static int sdhci_pci_runtime_resume_host(struct sdhci_pci_chip *chip) ...@@ -181,7 +181,7 @@ static int sdhci_pci_runtime_resume_host(struct sdhci_pci_chip *chip)
if (!slot) if (!slot)
continue; continue;
ret = sdhci_runtime_resume_host(slot->host); ret = sdhci_runtime_resume_host(slot->host, 0);
if (ret) if (ret)
return ret; return ret;
} }
......
...@@ -554,7 +554,7 @@ static int sdhci_pxav3_runtime_resume(struct device *dev) ...@@ -554,7 +554,7 @@ static int sdhci_pxav3_runtime_resume(struct device *dev)
if (!IS_ERR(pxa->clk_core)) if (!IS_ERR(pxa->clk_core))
clk_prepare_enable(pxa->clk_core); clk_prepare_enable(pxa->clk_core);
return sdhci_runtime_resume_host(host); return sdhci_runtime_resume_host(host, 0);
} }
#endif #endif
......
...@@ -745,7 +745,7 @@ static int sdhci_s3c_runtime_resume(struct device *dev) ...@@ -745,7 +745,7 @@ static int sdhci_s3c_runtime_resume(struct device *dev)
clk_prepare_enable(busclk); clk_prepare_enable(busclk);
if (ourhost->cur_clk >= 0) if (ourhost->cur_clk >= 0)
clk_prepare_enable(ourhost->clk_bus[ourhost->cur_clk]); clk_prepare_enable(ourhost->clk_bus[ourhost->cur_clk]);
ret = sdhci_runtime_resume_host(host); ret = sdhci_runtime_resume_host(host, 0);
return ret; return ret;
} }
#endif #endif
......
...@@ -696,7 +696,7 @@ static int sdhci_sprd_runtime_resume(struct device *dev) ...@@ -696,7 +696,7 @@ static int sdhci_sprd_runtime_resume(struct device *dev)
if (ret) if (ret)
goto clk_disable; goto clk_disable;
sdhci_runtime_resume_host(host); sdhci_runtime_resume_host(host, 1);
return 0; return 0;
clk_disable: clk_disable:
......
...@@ -638,7 +638,7 @@ static int xenon_runtime_resume(struct device *dev) ...@@ -638,7 +638,7 @@ static int xenon_runtime_resume(struct device *dev)
priv->restore_needed = false; priv->restore_needed = false;
} }
ret = sdhci_runtime_resume_host(host); ret = sdhci_runtime_resume_host(host, 0);
if (ret) if (ret)
goto out; goto out;
return 0; return 0;
......
...@@ -3320,7 +3320,7 @@ int sdhci_runtime_suspend_host(struct sdhci_host *host) ...@@ -3320,7 +3320,7 @@ int sdhci_runtime_suspend_host(struct sdhci_host *host)
} }
EXPORT_SYMBOL_GPL(sdhci_runtime_suspend_host); EXPORT_SYMBOL_GPL(sdhci_runtime_suspend_host);
int sdhci_runtime_resume_host(struct sdhci_host *host) int sdhci_runtime_resume_host(struct sdhci_host *host, int soft_reset)
{ {
struct mmc_host *mmc = host->mmc; struct mmc_host *mmc = host->mmc;
unsigned long flags; unsigned long flags;
...@@ -3331,7 +3331,7 @@ int sdhci_runtime_resume_host(struct sdhci_host *host) ...@@ -3331,7 +3331,7 @@ int sdhci_runtime_resume_host(struct sdhci_host *host)
host->ops->enable_dma(host); host->ops->enable_dma(host);
} }
sdhci_init(host, 0); sdhci_init(host, soft_reset);
if (mmc->ios.power_mode != MMC_POWER_UNDEFINED && if (mmc->ios.power_mode != MMC_POWER_UNDEFINED &&
mmc->ios.power_mode != MMC_POWER_OFF) { mmc->ios.power_mode != MMC_POWER_OFF) {
......
...@@ -781,7 +781,7 @@ void sdhci_adma_write_desc(struct sdhci_host *host, void **desc, ...@@ -781,7 +781,7 @@ void sdhci_adma_write_desc(struct sdhci_host *host, void **desc,
int sdhci_suspend_host(struct sdhci_host *host); int sdhci_suspend_host(struct sdhci_host *host);
int sdhci_resume_host(struct sdhci_host *host); int sdhci_resume_host(struct sdhci_host *host);
int sdhci_runtime_suspend_host(struct sdhci_host *host); int sdhci_runtime_suspend_host(struct sdhci_host *host);
int sdhci_runtime_resume_host(struct sdhci_host *host); int sdhci_runtime_resume_host(struct sdhci_host *host, int soft_reset);
#endif #endif
void sdhci_cqe_enable(struct mmc_host *mmc); void sdhci_cqe_enable(struct mmc_host *mmc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment