Commit 88d4a164 authored by Linus Torvalds's avatar Linus Torvalds

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

Pull MMC fixes from Ulf Hansson:
 "MMC core:
   - Fix in_flight[issue_type] value error to properly manage requests

  MMC host:
   - wbsd: Fix double free in the probe error path
   - sunplus: Fix error path in probe
   - sdhci_f_sdh30: Fix order of function calls in sdhci_f_sdh30_remove"

* tag 'mmc-v6.5-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
  mmc: f-sdh30: fix order of function calls in sdhci_f_sdh30_remove
  mmc: sunplus: Fix error handling in spmmc_drv_probe()
  mmc: sunplus: fix return value check of mmc_add_host()
  mmc: wbsd: fix double mmc_free_host() in wbsd_init()
  mmc: block: Fix in_flight[issue_type] value error
parents f33fd7eb 58abdd80
...@@ -2097,14 +2097,14 @@ static void mmc_blk_mq_poll_completion(struct mmc_queue *mq, ...@@ -2097,14 +2097,14 @@ static void mmc_blk_mq_poll_completion(struct mmc_queue *mq,
mmc_blk_urgent_bkops(mq, mqrq); mmc_blk_urgent_bkops(mq, mqrq);
} }
static void mmc_blk_mq_dec_in_flight(struct mmc_queue *mq, struct request *req) static void mmc_blk_mq_dec_in_flight(struct mmc_queue *mq, enum mmc_issue_type issue_type)
{ {
unsigned long flags; unsigned long flags;
bool put_card; bool put_card;
spin_lock_irqsave(&mq->lock, flags); spin_lock_irqsave(&mq->lock, flags);
mq->in_flight[mmc_issue_type(mq, req)] -= 1; mq->in_flight[issue_type] -= 1;
put_card = (mmc_tot_in_flight(mq) == 0); put_card = (mmc_tot_in_flight(mq) == 0);
...@@ -2117,6 +2117,7 @@ static void mmc_blk_mq_dec_in_flight(struct mmc_queue *mq, struct request *req) ...@@ -2117,6 +2117,7 @@ static void mmc_blk_mq_dec_in_flight(struct mmc_queue *mq, struct request *req)
static void mmc_blk_mq_post_req(struct mmc_queue *mq, struct request *req, static void mmc_blk_mq_post_req(struct mmc_queue *mq, struct request *req,
bool can_sleep) bool can_sleep)
{ {
enum mmc_issue_type issue_type = mmc_issue_type(mq, req);
struct mmc_queue_req *mqrq = req_to_mmc_queue_req(req); struct mmc_queue_req *mqrq = req_to_mmc_queue_req(req);
struct mmc_request *mrq = &mqrq->brq.mrq; struct mmc_request *mrq = &mqrq->brq.mrq;
struct mmc_host *host = mq->card->host; struct mmc_host *host = mq->card->host;
...@@ -2136,7 +2137,7 @@ static void mmc_blk_mq_post_req(struct mmc_queue *mq, struct request *req, ...@@ -2136,7 +2137,7 @@ static void mmc_blk_mq_post_req(struct mmc_queue *mq, struct request *req,
blk_mq_complete_request(req); blk_mq_complete_request(req);
} }
mmc_blk_mq_dec_in_flight(mq, req); mmc_blk_mq_dec_in_flight(mq, issue_type);
} }
void mmc_blk_mq_recovery(struct mmc_queue *mq) void mmc_blk_mq_recovery(struct mmc_queue *mq)
......
...@@ -210,13 +210,16 @@ static int sdhci_f_sdh30_remove(struct platform_device *pdev) ...@@ -210,13 +210,16 @@ static int sdhci_f_sdh30_remove(struct platform_device *pdev)
{ {
struct sdhci_host *host = platform_get_drvdata(pdev); struct sdhci_host *host = platform_get_drvdata(pdev);
struct f_sdhost_priv *priv = sdhci_f_sdhost_priv(host); struct f_sdhost_priv *priv = sdhci_f_sdhost_priv(host);
struct clk *clk_iface = priv->clk_iface;
reset_control_assert(priv->rst); struct reset_control *rst = priv->rst;
clk_disable_unprepare(priv->clk); struct clk *clk = priv->clk;
clk_disable_unprepare(priv->clk_iface);
sdhci_pltfm_unregister(pdev); sdhci_pltfm_unregister(pdev);
reset_control_assert(rst);
clk_disable_unprepare(clk);
clk_disable_unprepare(clk_iface);
return 0; return 0;
} }
......
...@@ -863,11 +863,9 @@ static int spmmc_drv_probe(struct platform_device *pdev) ...@@ -863,11 +863,9 @@ static int spmmc_drv_probe(struct platform_device *pdev)
struct spmmc_host *host; struct spmmc_host *host;
int ret = 0; int ret = 0;
mmc = mmc_alloc_host(sizeof(*host), &pdev->dev); mmc = devm_mmc_alloc_host(&pdev->dev, sizeof(struct spmmc_host));
if (!mmc) { if (!mmc)
ret = -ENOMEM; return -ENOMEM;
goto probe_free_host;
}
host = mmc_priv(mmc); host = mmc_priv(mmc);
host->mmc = mmc; host->mmc = mmc;
...@@ -902,7 +900,7 @@ static int spmmc_drv_probe(struct platform_device *pdev) ...@@ -902,7 +900,7 @@ static int spmmc_drv_probe(struct platform_device *pdev)
ret = mmc_of_parse(mmc); ret = mmc_of_parse(mmc);
if (ret) if (ret)
goto probe_free_host; goto clk_disable;
mmc->ops = &spmmc_ops; mmc->ops = &spmmc_ops;
mmc->f_min = SPMMC_MIN_CLK; mmc->f_min = SPMMC_MIN_CLK;
...@@ -911,7 +909,7 @@ static int spmmc_drv_probe(struct platform_device *pdev) ...@@ -911,7 +909,7 @@ static int spmmc_drv_probe(struct platform_device *pdev)
ret = mmc_regulator_get_supply(mmc); ret = mmc_regulator_get_supply(mmc);
if (ret) if (ret)
goto probe_free_host; goto clk_disable;
if (!mmc->ocr_avail) if (!mmc->ocr_avail)
mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
...@@ -927,14 +925,17 @@ static int spmmc_drv_probe(struct platform_device *pdev) ...@@ -927,14 +925,17 @@ static int spmmc_drv_probe(struct platform_device *pdev)
host->tuning_info.enable_tuning = 1; host->tuning_info.enable_tuning = 1;
pm_runtime_set_active(&pdev->dev); pm_runtime_set_active(&pdev->dev);
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
mmc_add_host(mmc); ret = mmc_add_host(mmc);
if (ret)
goto pm_disable;
return ret; return 0;
probe_free_host: pm_disable:
if (mmc) pm_runtime_disable(&pdev->dev);
mmc_free_host(mmc);
clk_disable:
clk_disable_unprepare(host->clk);
return ret; return ret;
} }
...@@ -948,7 +949,6 @@ static int spmmc_drv_remove(struct platform_device *dev) ...@@ -948,7 +949,6 @@ static int spmmc_drv_remove(struct platform_device *dev)
pm_runtime_put_noidle(&dev->dev); pm_runtime_put_noidle(&dev->dev);
pm_runtime_disable(&dev->dev); pm_runtime_disable(&dev->dev);
platform_set_drvdata(dev, NULL); platform_set_drvdata(dev, NULL);
mmc_free_host(host->mmc);
return 0; return 0;
} }
......
...@@ -1705,8 +1705,6 @@ static int wbsd_init(struct device *dev, int base, int irq, int dma, ...@@ -1705,8 +1705,6 @@ static int wbsd_init(struct device *dev, int base, int irq, int dma,
wbsd_release_resources(host); wbsd_release_resources(host);
wbsd_free_mmc(dev); wbsd_free_mmc(dev);
mmc_free_host(mmc);
return ret; return ret;
} }
......
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