Skip to contentSkip to conversation

mmc: core: Allow sdio operations in other thread during sdio_add_func()

PATCH In review Dmitry Shmidt 3 participants 6 messages Feb 12, 2011 – Mar 3, 2011 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: core: Allow sdio operations in other thread during sdio_add_func()

commit 9cb71a1eb86a2acf0762d31af633984cf9e24d32

Author: Dmitry Shmidt <[email protected]>
Date:   Fri Feb 11 16:10:33 2011 -0800

mmc: core: Allow sdio operations in other thread during sdio_add_func()

drivers/mmc/core/sdio.c +1 -3
index dec4290..d4e6e6ef 100644
@@ -834,7 +834,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;
 
@@ -846,13 +845,12 @@ int mmc_attach_sdio(struct mmc_host *host)
                if (err)
                        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:
#1 lore raw
Quoted 37 lines · Dmitry Shmidt

commit 9cb71a1eb86a2acf0762d31af633984cf9e24d32
Author: Dmitry Shmidt <[email protected]>
Date:   Fri Feb 11 16:10:33 2011 -0800

   mmc: core: Allow sdio operations in other thread during sdio_add_func()

drivers/mmc/core/sdio.c +1 -2
index dec4290..d4e6e6ef 100644
@@ -834,7 +834,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;
 
@@ -846,13 +845,12 @@ int mmc_attach_sdio(struct mmc_host *host)
                if (err)
                        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:

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

This is important when wlan driver is doing sdio operations from another
thread during initialization.
This behavior was introduced as a side-effect in patch
807e8e40673d9628fa7dcdd14423424b4ee5f43b
mmc: Fix sd/sdio/mmc initialization frequency retries

#2 lore raw

[Cc += Andy]

Quoted 50 lines · Dmitry Shmidt
Quoted 37 lines · Dmitry Shmidt

commit 9cb71a1eb86a2acf0762d31af633984cf9e24d32
Author: Dmitry Shmidt <[email protected]>
Date:   Fri Feb 11 16:10:33 2011 -0800

   mmc: core: Allow sdio operations in other thread during sdio_add_func()

drivers/mmc/core/sdio.c +1 -2
index dec4290..d4e6e6ef 100644
@@ -834,7 +834,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;
 
@@ -846,13 +845,12 @@ int mmc_attach_sdio(struct mmc_host *host)
                if (err)
                        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:

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

This is important when wlan driver is doing sdio operations from another thread during initialization.
This behavior was introduced as a side-effect in patch 807e8e40673d9628fa7dcdd14423424b4ee5f43b
 mmc: Fix sd/sdio/mmc initialization frequency retries

#4 lore raw
In reply to Andy Ross
Quoted 8 lines · Andy Ross
Quoted 6 lines · Dmitry Shmidt

mmc: core: Allow sdio operations in other thread during sdio_add_func()

This is important when wlan driver is doing sdio operations from another thread during initialization.
This behavior was introduced as a side-effect in patch 807e8e40673d9628fa7dcdd14423424b4ee5f43b

Quoted 5 lines

That patch made similar to mmc_attach_sd() and mmc_attach_mmc().  Do they need to be audited for the same lock contention?

Andy

No, they are not the same. mmc and sd don't have
sdio_add_func(host->card->sdio_func[i]);
so they are Ok.

Dmitry

#3 lore raw
In reply to Dmitry Shmidt
Quoted 6 lines · Dmitry Shmidt

mmc: core: Allow sdio operations in other thread during sdio_add_func()

This is important when wlan driver is doing sdio operations from another thread during initialization.
This behavior was introduced as a side-effect in patch 807e8e40673d9628fa7dcdd14423424b4ee5f43b

That patch made similar to mmc_attach_sd() and mmc_attach_mmc(). Do they need to be audited for the same lock contention?

Andy

#5 lore raw
In reply to Dmitry Shmidt

Hi Dmitry,

Quoted 26 lines · Dmitry Shmidt

commit 9cb71a1eb86a2acf0762d31af633984cf9e24d32

Author: Dmitry Shmidt <[email protected]>
Date:   Fri Feb 11 16:10:33 2011 -0800

mmc: core: Allow sdio operations in other thread during sdio_add_func()

drivers/mmc/core/sdio.c +0 -2
index dec4290..d4e6e6ef 100644
@@ -834,7 +834,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;
 
@@ -846,13 +845,12 @@ int mmc_attach_sdio(struct mmc_host *host)
                if (err)
                        goto remove_added;
        }
-

drivers/mmc/core/sdio.c int mmc_attach_sdio(struct mmc_host *host) · line 856

Quoted 10 lines
drivers/mmc/core/sdio.c +1 -1
+       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:

Thanks, pushed to mmc-next for .39.

- Chris.

Signature · 2 lines
Chris Ball   <[email protected]>
One Laptop Per Child