All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Ball <cjb@laptop.org>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linux-mmc@vger.kernel.org
Subject: Re: [PATCH] mmc: fix rmmod race for card-detection polling hosts
Date: Thu, 11 Nov 2010 23:45:01 +0000	[thread overview]
Message-ID: <20101111234501.GA18472@void.printf.net> (raw)
In-Reply-To: <Pine.LNX.4.64.1011111730170.15747@axis700.grange>

Hi Guennadi,

On Thu, Nov 11, 2010 at 05:32:25PM +0100, Guennadi Liakhovetski wrote:
> MMC hosts, using polling for card detection by defining the MMC_CAP_NEEDS_POLL
> flag, have a race on rmmod, where the delayed work is cancelled without
> waiting for completed polling. To prevent this a _sync version of the work
> cancellation has to be used.
> 
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> ---
> 
> Chris, if this bug is old enough, this should also go to stable 
> eventually.
> 
>  drivers/mmc/core/core.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 8f86d70..31ae07a 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -1559,7 +1559,7 @@ void mmc_stop_host(struct mmc_host *host)
>  
>  	if (host->caps & MMC_CAP_DISABLE)
>  		cancel_delayed_work(&host->disable);
> -	cancel_delayed_work(&host->detect);
> +	cancel_delayed_work_sync(&host->detect);
>  	mmc_flush_scheduled_work();
>  
>  	/* clear pm flags now and let card drivers set them as needed */

Thanks very much, pushed to for-linus/mmc-next with a Cc: to stable@,
and queued for .37.  The bug is old -- the cancel_delayed_work() call
was introduced in .31, and before that we weren't cancelling it at all.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

      reply	other threads:[~2010-11-11 23:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-11 16:32 [PATCH] mmc: fix rmmod race for card-detection polling hosts Guennadi Liakhovetski
2010-11-11 23:45 ` Chris Ball [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101111234501.GA18472@void.printf.net \
    --to=cjb@laptop.org \
    --cc=g.liakhovetski@gmx.de \
    --cc=linux-mmc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.