Commit 34497913 authored by Dmitry Shmidt's avatar Dmitry Shmidt Committed by Chris Ball
Browse files

mmc: sdio: Allow sdio operations in other threads during sdio_add_func()

This fixes a bug introduced by 807e8e40

 ("mmc: Fix sd/sdio/mmc
initialization frequency retries") that prevented SDIO drivers from
performing SDIO commands in their probe routines -- the above patch
called mmc_claim_host() before sdio_add_func(), which causes a deadlock
if an external SDIO driver calls sdio_claim_host().

Fix tested on an OLPC XO-1.75 with libertas on SDIO.

Signed-off-by: default avatarDmitry Shmidt <dimitrysh@google.com>
Reviewed-and-Tested-by: default avatarChris Ball <cjb@laptop.org>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 214d93b0
...@@ -792,7 +792,6 @@ int mmc_attach_sdio(struct mmc_host *host) ...@@ -792,7 +792,6 @@ int mmc_attach_sdio(struct mmc_host *host)
*/ */
mmc_release_host(host); mmc_release_host(host);
err = mmc_add_card(host->card); err = mmc_add_card(host->card);
mmc_claim_host(host);
if (err) if (err)
goto remove_added; goto remove_added;
...@@ -805,12 +804,12 @@ int mmc_attach_sdio(struct mmc_host *host) ...@@ -805,12 +804,12 @@ int mmc_attach_sdio(struct mmc_host *host)
goto remove_added; goto remove_added;
} }
mmc_claim_host(host);
return 0; return 0;
remove_added: remove_added:
/* Remove without lock if the device has been added. */ /* Remove without lock if the device has been added. */
mmc_release_host(host);
mmc_sdio_remove(host); mmc_sdio_remove(host);
mmc_claim_host(host); mmc_claim_host(host);
remove: remove:
......
Supports Markdown
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