Skip to content

Commit

Permalink
mmc: sdio: Allow sdio operations in other threads during sdio_add_func()
Browse files Browse the repository at this point in the history
This fixes a bug introduced by 807e8e4 ("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: Dmitry Shmidt <[email protected]>
Reviewed-and-Tested-by: Chris Ball <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
  • Loading branch information
Dmitry Shmidt authored and cjb committed Mar 7, 2011
1 parent 214d93b commit 3449791
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/mmc/core/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,6 @@ int mmc_attach_sdio(struct mmc_host *host)
*/
mmc_release_host(host);
err = mmc_add_card(host->card);
mmc_claim_host(host);
if (err)
goto remove_added;

Expand All @@ -805,12 +804,12 @@ int mmc_attach_sdio(struct mmc_host *host)
goto remove_added;
}

mmc_claim_host(host);
return 0;


remove_added:
/* Remove without lock if the device has been added. */
mmc_release_host(host);
mmc_sdio_remove(host);
mmc_claim_host(host);
remove:
Expand Down

0 comments on commit 3449791

Please sign in to comment.