public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: core: Allow sdio operations in other thread during sdio_add_func()
@ 2011-02-12  0:25 Dmitry Shmidt
  2011-02-12  2:34 ` Dmitry Shmidt
  2011-03-03 22:42 ` Chris Ball
  0 siblings, 2 replies; 6+ messages in thread
From: Dmitry Shmidt @ 2011-02-12  0:25 UTC (permalink / raw)
  To: linux-mmc

commit 9cb71a1eb86a2acf0762d31af633984cf9e24d32
Author: Dmitry Shmidt <dimitrysh@google.com>
Date:   Fri Feb 11 16:10:33 2011 -0800

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

    Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index dec4290..d4e6e6ef 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -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:



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] mmc: core: Allow sdio operations in other thread during sdio_add_func()
  2011-02-12  0:25 [PATCH] mmc: core: Allow sdio operations in other thread during sdio_add_func() Dmitry Shmidt
@ 2011-02-12  2:34 ` Dmitry Shmidt
  2011-02-15 18:08   ` Dmitry Shmidt
  2011-03-03 22:42 ` Chris Ball
  1 sibling, 1 reply; 6+ messages in thread
From: Dmitry Shmidt @ 2011-02-12  2:34 UTC (permalink / raw)
  To: linux-mmc

On Fri, Feb 11, 2011 at 4:25 PM, Dmitry Shmidt <dimitrysh@android.com> wrote:
> commit 9cb71a1eb86a2acf0762d31af633984cf9e24d32
> Author: Dmitry Shmidt <dimitrysh@google.com>
> Date:   Fri Feb 11 16:10:33 2011 -0800
>
>    mmc: core: Allow sdio operations in other thread during sdio_add_func()
>
>    Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
>
> diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
> index dec4290..d4e6e6ef 100644
> --- a/drivers/mmc/core/sdio.c
> +++ b/drivers/mmc/core/sdio.c
> @@ -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:
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mmc: core: Allow sdio operations in other thread during sdio_add_func()
  2011-02-12  2:34 ` Dmitry Shmidt
@ 2011-02-15 18:08   ` Dmitry Shmidt
  2011-02-15 19:26     ` Andy Ross
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Shmidt @ 2011-02-15 18:08 UTC (permalink / raw)
  To: linux-mmc; +Cc: Andy Ross

[Cc += Andy]

On Fri, Feb 11, 2011 at 6:34 PM, Dmitry Shmidt <dimitrysh@android.com> wrote:
> On Fri, Feb 11, 2011 at 4:25 PM, Dmitry Shmidt <dimitrysh@android.com> wrote:
>> commit 9cb71a1eb86a2acf0762d31af633984cf9e24d32
>> Author: Dmitry Shmidt <dimitrysh@google.com>
>> Date:   Fri Feb 11 16:10:33 2011 -0800
>>
>>    mmc: core: Allow sdio operations in other thread during sdio_add_func()
>>
>>    Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
>>
>> diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
>> index dec4290..d4e6e6ef 100644
>> --- a/drivers/mmc/core/sdio.c
>> +++ b/drivers/mmc/core/sdio.c
>> @@ -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:
>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
>> the body of a message to majordomo@vger.kernel.org
>> 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
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mmc: core: Allow sdio operations in other thread during sdio_add_func()
  2011-02-15 18:08   ` Dmitry Shmidt
@ 2011-02-15 19:26     ` Andy Ross
  2011-02-15 19:32       ` Dmitry Shmidt
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Ross @ 2011-02-15 19:26 UTC (permalink / raw)
  To: Dmitry Shmidt; +Cc: linux-mmc

On 02/15/2011 10:08 AM, Dmitry Shmidt wrote:
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mmc: core: Allow sdio operations in other thread during sdio_add_func()
  2011-02-15 19:26     ` Andy Ross
@ 2011-02-15 19:32       ` Dmitry Shmidt
  0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Shmidt @ 2011-02-15 19:32 UTC (permalink / raw)
  To: Andy Ross; +Cc: linux-mmc

On Tue, Feb 15, 2011 at 11:26 AM, Andy Ross <andy.ross@windriver.com> wrote:
> On 02/15/2011 10:08 AM, Dmitry Shmidt wrote:
>> 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
>
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mmc: core: Allow sdio operations in other thread during sdio_add_func()
  2011-02-12  0:25 [PATCH] mmc: core: Allow sdio operations in other thread during sdio_add_func() Dmitry Shmidt
  2011-02-12  2:34 ` Dmitry Shmidt
@ 2011-03-03 22:42 ` Chris Ball
  1 sibling, 0 replies; 6+ messages in thread
From: Chris Ball @ 2011-03-03 22:42 UTC (permalink / raw)
  To: Dmitry Shmidt; +Cc: linux-mmc

Hi Dmitry,

On Fri, Feb 11 2011, Dmitry Shmidt wrote:
> commit 9cb71a1eb86a2acf0762d31af633984cf9e24d32
> Author: Dmitry Shmidt <dimitrysh@google.com>
> Date:   Fri Feb 11 16:10:33 2011 -0800
>
>     mmc: core: Allow sdio operations in other thread during sdio_add_func()
>
>     Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
>
> diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
> index dec4290..d4e6e6ef 100644
> --- a/drivers/mmc/core/sdio.c
> +++ b/drivers/mmc/core/sdio.c
> @@ -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:
>

Thanks, pushed to mmc-next for .39.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>
One Laptop Per Child

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-03-03 22:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-12  0:25 [PATCH] mmc: core: Allow sdio operations in other thread during sdio_add_func() Dmitry Shmidt
2011-02-12  2:34 ` Dmitry Shmidt
2011-02-15 18:08   ` Dmitry Shmidt
2011-02-15 19:26     ` Andy Ross
2011-02-15 19:32       ` Dmitry Shmidt
2011-03-03 22:42 ` Chris Ball

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox