Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp949259rwb; Fri, 7 Oct 2022 06:20:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6CrFsBly93kBdvRzpgvpdVpP4zLP77ZFo365a/98JlG453Cy7cnO4Q7da8+ozFRfpcGLXE X-Received: by 2002:a17:907:1c8f:b0:781:de51:f808 with SMTP id nb15-20020a1709071c8f00b00781de51f808mr4056834ejc.733.1665148833851; Fri, 07 Oct 2022 06:20:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665148833; cv=none; d=google.com; s=arc-20160816; b=i5GtUsUbGcuHA6Uub8yPkQKBIQ0aps1LOU0/jXF2nlsEgO9KfHKCRRGBBQpHM5xqb/ uk6nRC2lO670tN9X7qUNhxRiCCljKuLlOCfUdUiVjU/xZqiJdnQ/SgRT45iav7UVvGkz IN1lrVojkIVDxc/duQXTNDQVbKXGlvUULOMsZYssPygpbdruvLPHTNjfky6htjb7ggNx mI4W7YBxZxyuz/6KCMh9NQhILtAGeUh2FlZwcXuLfzr9QEzL4l3ll7wQXF7uEu62ewiG OS8VldQpE2hHwVCMfotzhA0upXWQiZYeEXzOP0O9shqpjvWaXqjLv9FnFKStRl7DKW3I HyIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Bx1A8VZz2C9MrIadfwpDwtJ95gIG5yP6liuo34oI2JU=; b=arClCOrOUfAsE1kAqT9kCrH2fFnkOU7Ao20GiMn4HeHDjCweyX5aznwPcczLcum69+ QUFReCXIg/oK4Ajjsp5S8dPxd98x15EfS6i8lu1JbpCgpS00GuywTPuXn2nOf1JZYTax 7aSVPCymMVUDwlMVMl1pxGlgJO2QLtV9hgoFCKx8EdhqOaw9TJkSe/k4ljXsL4c8FI8P A7Gv0DQ5Aj3OJBxKr8TYF+oi0TL1ObrXSgYQRP/8LCGzK7d0aW4mnymUBWlG+zfUwdmv pt84J9SEtVVvOk3v+1nnpTCTl5zgmf3o/lfpClP+XNspqL+BuN/6CoICmbTfeNpVCnBI UshA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=klfdocq1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d27-20020a056402401b00b00456ed5c909bsi2211451eda.590.2022.10.07.06.20.07; Fri, 07 Oct 2022 06:20:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=klfdocq1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229834AbiJGNNR (ORCPT + 99 others); Fri, 7 Oct 2022 09:13:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229819AbiJGNNP (ORCPT ); Fri, 7 Oct 2022 09:13:15 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45931CBFF3 for ; Fri, 7 Oct 2022 06:13:14 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id o9-20020a17090a0a0900b0020ad4e758b3so4693752pjo.4 for ; Fri, 07 Oct 2022 06:13:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Bx1A8VZz2C9MrIadfwpDwtJ95gIG5yP6liuo34oI2JU=; b=klfdocq1WkN/CJB6VFdoFVsNBhv2or+S6nkqOOeN+5/2YRV/U4XmlES4zvcZfA4a4k DvSgiVZMPhP979+YaFDhbOxrLiAFhYlF2L8NnPuocmimP0nMRALkcWwBhzo1N5sqEF50 Sup7/NvbiGeRh97GYXxzXxN2VgBmdByVeugdayYBWYoMIa9h7x2S6oldfIlzx9seWajQ tXiekocjVamz9qFgCqeDele+fBqURG1PIZ7kWPLgLannPAIlsfqwP08nWsZCqCT91DDW XCmPtKGcJJMx/n1D89j15MOfGwDr/XkxuKuVLdN3OKFbekMEFTDbT3NEiOsj80xYEeZG i6qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Bx1A8VZz2C9MrIadfwpDwtJ95gIG5yP6liuo34oI2JU=; b=AySDS5W/Wpj333hqN/WtzHl01xkEO2QVO/X+h7VjpQOhXMKiIEnoVB9PrFJkcCyTXl tF+zjl4ZphTbuxRwvI4GlBnqbVIotmv7Tkz7cXGDxFEPcdpFPbmiB/kDCvrcGF5By+00 PnuB8E/UCc7LXsKGIxtCDx0Ghin+6LIaWEzda1bhl2qN+dvyybCio4fjaqlD+bqGPdBn aupddJfGIkJjD/V44NDLDa51rRTsRhaQ9a+bDZGzLj9tY4ZhvPqN1C1JyMp2UOuUkfNi zdWHYBdQNQg3T49J7yrSWt4/5Ezck34ENTsEFdUvbU5eGB84c64SMOqhAC4OJRiS0TZZ pGmQ== X-Gm-Message-State: ACrzQf3MefQiNNhzZ0eGCiRSRBa8xBThMZOI9QFLqxRVbo7AjEfy3KhR efnE4OUwtAppUDhJ/XLKRV0nn8Z4Ejfl6Rz9oI7BzA== X-Received: by 2002:a17:90b:4d07:b0:1ef:521c:f051 with SMTP id mw7-20020a17090b4d0700b001ef521cf051mr16774732pjb.164.1665148393003; Fri, 07 Oct 2022 06:13:13 -0700 (PDT) MIME-Version: 1.0 References: <08aac29e2d8545a6b56e092bc508409e@hyperstone.com> In-Reply-To: <08aac29e2d8545a6b56e092bc508409e@hyperstone.com> From: Ulf Hansson Date: Fri, 7 Oct 2022 15:12:36 +0200 Message-ID: Subject: Re: [PATCH 2/2] mmc: queue: Flush recovery work on cleanup To: Adrian Hunter , =?UTF-8?Q?Christian_L=C3=B6hle?= Cc: Linux MMC List , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 6 Oct 2022 at 15:39, Christian L=C3=B6hle = 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 > --- > 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) reques= t 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