diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2011-03-03 17:40:10 -0500 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-03-07 16:55:44 -0500 |
commit | 34497913f2936fd43c86b007da7224bb8e77fd15 (patch) | |
tree | 359c992cbe0bd6b29c2708cad3c5e76dd3d7beaf | |
parent | 214d93b02c4fe93638ad268613c9702a81ed9192 (diff) |
mmc: sdio: Allow sdio operations in other threads during sdio_add_func()
This fixes a bug introduced by 807e8e40673d ("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 <dimitrysh@google.com>
Reviewed-and-Tested-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r-- | drivers/mmc/core/sdio.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 5c4a54d9b6a4..ebc62ad4cc56 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c | |||
@@ -792,7 +792,6 @@ int mmc_attach_sdio(struct mmc_host *host) | |||
792 | */ | 792 | */ |
793 | mmc_release_host(host); | 793 | mmc_release_host(host); |
794 | err = mmc_add_card(host->card); | 794 | err = mmc_add_card(host->card); |
795 | mmc_claim_host(host); | ||
796 | if (err) | 795 | if (err) |
797 | goto remove_added; | 796 | goto remove_added; |
798 | 797 | ||
@@ -805,12 +804,12 @@ int mmc_attach_sdio(struct mmc_host *host) | |||
805 | goto remove_added; | 804 | goto remove_added; |
806 | } | 805 | } |
807 | 806 | ||
807 | mmc_claim_host(host); | ||
808 | return 0; | 808 | return 0; |
809 | 809 | ||
810 | 810 | ||
811 | remove_added: | 811 | remove_added: |
812 | /* Remove without lock if the device has been added. */ | 812 | /* Remove without lock if the device has been added. */ |
813 | mmc_release_host(host); | ||
814 | mmc_sdio_remove(host); | 813 | mmc_sdio_remove(host); |
815 | mmc_claim_host(host); | 814 | mmc_claim_host(host); |
816 | remove: | 815 | remove: |