Commit 34e3211e authored by Wolfram Sang's avatar Wolfram Sang Committed by Ulf Hansson

Revert "mmc: tmio: fix reset operation"

This reverts commit a87852c6. It did fix
the issue, but was building on top of already wrong assumptions. The
driver missed that 'hw_reset' was only for resetting remote HW (card)
and not for the IP core. Since we fixed that in a previous patch, we can
now remove this patch to make it clear that 'reset' is for resetting the
IP core only. Also, cancelling DMA will only be called when actually
needed again. It will also allow for further cleanups and better
readability. Note that in addition to the revert, the call in
'tmio_mmc_execute_tuning' will be converted, too, to maintain the
current behaviour.
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tested-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Link: https://lore.kernel.org/r/20200820132538.24758-3-wsa+renesas@sang-engineering.comSigned-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 6e7d4de1
...@@ -178,18 +178,6 @@ static void tmio_mmc_reset(struct tmio_mmc_host *host) ...@@ -178,18 +178,6 @@ static void tmio_mmc_reset(struct tmio_mmc_host *host)
} }
} }
static void tmio_mmc_hw_reset(struct mmc_host *mmc)
{
struct tmio_mmc_host *host = mmc_priv(mmc);
host->reset(host);
tmio_mmc_abort_dma(host);
if (host->hw_reset)
host->hw_reset(host);
}
static void tmio_mmc_reset_work(struct work_struct *work) static void tmio_mmc_reset_work(struct work_struct *work)
{ {
struct tmio_mmc_host *host = container_of(work, struct tmio_mmc_host, struct tmio_mmc_host *host = container_of(work, struct tmio_mmc_host,
...@@ -228,11 +216,12 @@ static void tmio_mmc_reset_work(struct work_struct *work) ...@@ -228,11 +216,12 @@ static void tmio_mmc_reset_work(struct work_struct *work)
spin_unlock_irqrestore(&host->lock, flags); spin_unlock_irqrestore(&host->lock, flags);
tmio_mmc_hw_reset(host->mmc); host->reset(host);
/* Ready for new calls */ /* Ready for new calls */
host->mrq = NULL; host->mrq = NULL;
tmio_mmc_abort_dma(host);
mmc_request_done(host->mmc, mrq); mmc_request_done(host->mmc, mrq);
} }
...@@ -720,6 +709,14 @@ static int tmio_mmc_start_data(struct tmio_mmc_host *host, ...@@ -720,6 +709,14 @@ static int tmio_mmc_start_data(struct tmio_mmc_host *host,
return 0; return 0;
} }
static void tmio_mmc_hw_reset(struct mmc_host *mmc)
{
struct tmio_mmc_host *host = mmc_priv(mmc);
if (host->hw_reset)
host->hw_reset(host);
}
static int tmio_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode) static int tmio_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode)
{ {
struct tmio_mmc_host *host = mmc_priv(mmc); struct tmio_mmc_host *host = mmc_priv(mmc);
...@@ -732,7 +729,7 @@ static int tmio_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode) ...@@ -732,7 +729,7 @@ static int tmio_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode)
if (ret < 0) { if (ret < 0) {
dev_warn(&host->pdev->dev, "Tuning procedure failed\n"); dev_warn(&host->pdev->dev, "Tuning procedure failed\n");
tmio_mmc_hw_reset(mmc); host->reset(host);
} }
return ret; return ret;
...@@ -1180,7 +1177,7 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host) ...@@ -1180,7 +1177,7 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host)
_host->sdio_irq_mask = TMIO_SDIO_MASK_ALL; _host->sdio_irq_mask = TMIO_SDIO_MASK_ALL;
_host->set_clock(_host, 0); _host->set_clock(_host, 0);
tmio_mmc_hw_reset(mmc); _host->reset(_host);
_host->sdcard_irq_mask = sd_ctrl_read16_and_16_as_32(_host, CTL_IRQ_MASK); _host->sdcard_irq_mask = sd_ctrl_read16_and_16_as_32(_host, CTL_IRQ_MASK);
tmio_mmc_disable_mmc_irqs(_host, TMIO_MASK_ALL); tmio_mmc_disable_mmc_irqs(_host, TMIO_MASK_ALL);
...@@ -1283,7 +1280,7 @@ int tmio_mmc_host_runtime_resume(struct device *dev) ...@@ -1283,7 +1280,7 @@ int tmio_mmc_host_runtime_resume(struct device *dev)
struct tmio_mmc_host *host = dev_get_drvdata(dev); struct tmio_mmc_host *host = dev_get_drvdata(dev);
tmio_mmc_clk_enable(host); tmio_mmc_clk_enable(host);
tmio_mmc_hw_reset(host->mmc); host->reset(host);
if (host->clk_cache) if (host->clk_cache)
host->set_clock(host, host->clk_cache); host->set_clock(host, host->clk_cache);
......
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