linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: "Adrian Hunter" <adrian.hunter@intel.com>,
	"Christian Löhle" <CLoehle@hyperstone.com>
Cc: Linux MMC List <linux-mmc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] mmc: queue: Flush recovery work on cleanup
Date: Fri, 7 Oct 2022 15:12:36 +0200	[thread overview]
Message-ID: <CAPDyKFqw2CNS+M5iMcP-_FyBThrUvGbyECMrEJheUD4YP7fwEw@mail.gmail.com> (raw)
In-Reply-To: <08aac29e2d8545a6b56e092bc508409e@hyperstone.com>

On Thu, 6 Oct 2022 at 15:39, Christian Löhle <CLoehle@hyperstone.com> wrote:
>
> To prevent any recovery work running after the queue cleanup flush it.
> Any recovery running post-cleanup dereferenced mq->card as NULL
> and was not meaningful to begin with.
>
> Cc: stable@vger.kernel.org
>
> Signed-off-by: Christian Loehle <cloehle@hyperstone.com>
> ---
>  drivers/mmc/core/queue.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
> index fefaa901b50f..a1b985d3dfda 100644
> --- a/drivers/mmc/core/queue.c
> +++ b/drivers/mmc/core/queue.c
> @@ -493,6 +493,13 @@ void mmc_cleanup_queue(struct mmc_queue *mq)
>         if (blk_queue_quiesced(q))
>                 blk_mq_unquiesce_queue(q);
>
> +       /*
> +        * If the recovery completes the last (and only remaining) request in
> +        * the queue, and the card has been removed, we could end up here with
> +        * the recovery not quite finished yet, so flush it.
> +        */
> +       flush_work(&mq->recovery_work);
> +

Not sure if it really matters in this case, but isn't
cancel_work_sync() the more proper thing to call instead?

>         blk_mq_free_tag_set(&mq->tag_set);
>
>         /*

Kind regards
Uffe

      reply	other threads:[~2022-10-07 13:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-06 13:39 [PATCH 2/2] mmc: queue: Flush recovery work on cleanup Christian Löhle
2022-10-07 13:12 ` Ulf Hansson [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=CAPDyKFqw2CNS+M5iMcP-_FyBThrUvGbyECMrEJheUD4YP7fwEw@mail.gmail.com \
    --to=ulf.hansson@linaro.org \
    --cc=CLoehle@hyperstone.com \
    --cc=adrian.hunter@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).