Skip to content

Commit 6275c7b

Browse files
BWhittenstorulf
authored andcommitted
mmc: dw_mmc: allow biu and ciu clocks to defer
Fix a race condition if the clock provider comes up after mmc is probed, this causes mmc to fail without retrying. When given the DEFER error from the clk source, pass it on up the chain. Fixes: f90a061 ("mmc: dw_mmc: lookup for optional biu and ciu clocks") Signed-off-by: Ben Whitten <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 9374ae9 commit 6275c7b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/mmc/host/dw_mmc.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3299,6 +3299,10 @@ int dw_mci_probe(struct dw_mci *host)
32993299
host->biu_clk = devm_clk_get(host->dev, "biu");
33003300
if (IS_ERR(host->biu_clk)) {
33013301
dev_dbg(host->dev, "biu clock not available\n");
3302+
ret = PTR_ERR(host->biu_clk);
3303+
if (ret == -EPROBE_DEFER)
3304+
return ret;
3305+
33023306
} else {
33033307
ret = clk_prepare_enable(host->biu_clk);
33043308
if (ret) {
@@ -3310,6 +3314,10 @@ int dw_mci_probe(struct dw_mci *host)
33103314
host->ciu_clk = devm_clk_get(host->dev, "ciu");
33113315
if (IS_ERR(host->ciu_clk)) {
33123316
dev_dbg(host->dev, "ciu clock not available\n");
3317+
ret = PTR_ERR(host->ciu_clk);
3318+
if (ret == -EPROBE_DEFER)
3319+
goto err_clk_biu;
3320+
33133321
host->bus_hz = host->pdata->bus_hz;
33143322
} else {
33153323
ret = clk_prepare_enable(host->ciu_clk);

0 commit comments

Comments
 (0)