Skip to content

Commit 88d4a16

Browse files
committed
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
2 parents f33fd7e + 58abdd8 commit 88d4a16

File tree

4 files changed

+24
-22
lines changed

4 files changed

+24
-22
lines changed

drivers/mmc/core/block.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2097,14 +2097,14 @@ static void mmc_blk_mq_poll_completion(struct mmc_queue *mq,
20972097
mmc_blk_urgent_bkops(mq, mqrq);
20982098
}
20992099

2100-
static void mmc_blk_mq_dec_in_flight(struct mmc_queue *mq, struct request *req)
2100+
static void mmc_blk_mq_dec_in_flight(struct mmc_queue *mq, enum mmc_issue_type issue_type)
21012101
{
21022102
unsigned long flags;
21032103
bool put_card;
21042104

21052105
spin_lock_irqsave(&mq->lock, flags);
21062106

2107-
mq->in_flight[mmc_issue_type(mq, req)] -= 1;
2107+
mq->in_flight[issue_type] -= 1;
21082108

21092109
put_card = (mmc_tot_in_flight(mq) == 0);
21102110

@@ -2117,6 +2117,7 @@ static void mmc_blk_mq_dec_in_flight(struct mmc_queue *mq, struct request *req)
21172117
static void mmc_blk_mq_post_req(struct mmc_queue *mq, struct request *req,
21182118
bool can_sleep)
21192119
{
2120+
enum mmc_issue_type issue_type = mmc_issue_type(mq, req);
21202121
struct mmc_queue_req *mqrq = req_to_mmc_queue_req(req);
21212122
struct mmc_request *mrq = &mqrq->brq.mrq;
21222123
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,
21362137
blk_mq_complete_request(req);
21372138
}
21382139

2139-
mmc_blk_mq_dec_in_flight(mq, req);
2140+
mmc_blk_mq_dec_in_flight(mq, issue_type);
21402141
}
21412142

21422143
void mmc_blk_mq_recovery(struct mmc_queue *mq)

drivers/mmc/host/sdhci_f_sdh30.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,16 @@ static int sdhci_f_sdh30_remove(struct platform_device *pdev)
210210
{
211211
struct sdhci_host *host = platform_get_drvdata(pdev);
212212
struct f_sdhost_priv *priv = sdhci_f_sdhost_priv(host);
213-
214-
reset_control_assert(priv->rst);
215-
clk_disable_unprepare(priv->clk);
216-
clk_disable_unprepare(priv->clk_iface);
213+
struct clk *clk_iface = priv->clk_iface;
214+
struct reset_control *rst = priv->rst;
215+
struct clk *clk = priv->clk;
217216

218217
sdhci_pltfm_unregister(pdev);
219218

219+
reset_control_assert(rst);
220+
clk_disable_unprepare(clk);
221+
clk_disable_unprepare(clk_iface);
222+
220223
return 0;
221224
}
222225

drivers/mmc/host/sunplus-mmc.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -863,11 +863,9 @@ static int spmmc_drv_probe(struct platform_device *pdev)
863863
struct spmmc_host *host;
864864
int ret = 0;
865865

866-
mmc = mmc_alloc_host(sizeof(*host), &pdev->dev);
867-
if (!mmc) {
868-
ret = -ENOMEM;
869-
goto probe_free_host;
870-
}
866+
mmc = devm_mmc_alloc_host(&pdev->dev, sizeof(struct spmmc_host));
867+
if (!mmc)
868+
return -ENOMEM;
871869

872870
host = mmc_priv(mmc);
873871
host->mmc = mmc;
@@ -902,7 +900,7 @@ static int spmmc_drv_probe(struct platform_device *pdev)
902900

903901
ret = mmc_of_parse(mmc);
904902
if (ret)
905-
goto probe_free_host;
903+
goto clk_disable;
906904

907905
mmc->ops = &spmmc_ops;
908906
mmc->f_min = SPMMC_MIN_CLK;
@@ -911,7 +909,7 @@ static int spmmc_drv_probe(struct platform_device *pdev)
911909

912910
ret = mmc_regulator_get_supply(mmc);
913911
if (ret)
914-
goto probe_free_host;
912+
goto clk_disable;
915913

916914
if (!mmc->ocr_avail)
917915
mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
@@ -927,14 +925,17 @@ static int spmmc_drv_probe(struct platform_device *pdev)
927925
host->tuning_info.enable_tuning = 1;
928926
pm_runtime_set_active(&pdev->dev);
929927
pm_runtime_enable(&pdev->dev);
930-
mmc_add_host(mmc);
928+
ret = mmc_add_host(mmc);
929+
if (ret)
930+
goto pm_disable;
931931

932-
return ret;
932+
return 0;
933933

934-
probe_free_host:
935-
if (mmc)
936-
mmc_free_host(mmc);
934+
pm_disable:
935+
pm_runtime_disable(&pdev->dev);
937936

937+
clk_disable:
938+
clk_disable_unprepare(host->clk);
938939
return ret;
939940
}
940941

@@ -948,7 +949,6 @@ static int spmmc_drv_remove(struct platform_device *dev)
948949
pm_runtime_put_noidle(&dev->dev);
949950
pm_runtime_disable(&dev->dev);
950951
platform_set_drvdata(dev, NULL);
951-
mmc_free_host(host->mmc);
952952

953953
return 0;
954954
}

drivers/mmc/host/wbsd.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,8 +1705,6 @@ static int wbsd_init(struct device *dev, int base, int irq, int dma,
17051705

17061706
wbsd_release_resources(host);
17071707
wbsd_free_mmc(dev);
1708-
1709-
mmc_free_host(mmc);
17101708
return ret;
17111709
}
17121710

0 commit comments

Comments
 (0)