Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1384167rdh; Mon, 25 Sep 2023 11:02:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH1kebB2EQww2Z1gMyJ5W4x0g3wQ6BDhpx8tAUG19AJcMQywEOCUNBsnWLHS2V2hpOoj531 X-Received: by 2002:a17:903:11c6:b0:1c4:4251:68b3 with SMTP id q6-20020a17090311c600b001c4425168b3mr8837411plh.54.1695664932957; Mon, 25 Sep 2023 11:02:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695664932; cv=none; d=google.com; s=arc-20160816; b=0Zds5tllqx7Bxv50MJOmpE4c+l15R5Mo9J3XH/Hq2+uOzxxiG2uJXEHbqX5hlR5M12 utkvUx3t/Zwv6GOs9qEyVq3UoDbHVfdMWP4s+36LZPpA7BZpD/LlnnP3vuv0gmkjH2ui UeKqHEmu54FuOtiJOM4JJLwQBLd/AfuH0hc6m7ZGV52aK2YQLWHbO3R92Ba/xmdwI0nq gSdKBTNEKcZlN3T5orvneiipMSayQSyh5diL63XOi5S53dC76spGlFCjFfVXedZMBnb4 +F6Nmt0wDq1Eh91conujkdCMb/njxtal5mYGoPCqYEfApmTyDVNd6yQw5YeMpYN7HSl+ NCdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=pbeInWKlUN3Z2QQBrR4UtpzNoToZLCsYpJRewAj23h8=; fh=TRN1TXWiFd3OvAVWEiax81muEXdVxfteWX6ynVUChlI=; b=QvG1v4Sn4l7zjPR6+zdcA2uuHU0A/4r4QWDWGVBKyeJkOssgYPcrs4Akz6Q7g4NoHd QP1CPlctWtO4ncwU/Tk+PtjbgLfhjtM5octyhVEQYAnDtCRvluUcLPAd1GhoamNAoc6X FGYu3wEHRScK1S7w4xulJhkp8JUmiM2JfNTOT4qkAUoZYDacJZEWxrDt7tCarAJ7pO7F 2aPfo+Uc/rwPPlPEQqYJI10wHXyyFBlJv9NxvvcuBLPWcdDaAljyeGBOmzoNNGX3zZPr faLZWXFD91b/EYiRfY+pVmeiQ6mUtnrZLm+pMQsPlmy/tmg2f14UA9Gqzut5mqgjie84 SfCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u6KT1EOy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id c4-20020a170902d48400b001c3fa9a1e3esi11237369plg.493.2023.09.25.11.02.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 11:02:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u6KT1EOy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 2FFF68098423; Mon, 25 Sep 2023 07:07:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232091AbjIYOHS (ORCPT + 99 others); Mon, 25 Sep 2023 10:07:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229584AbjIYOHR (ORCPT ); Mon, 25 Sep 2023 10:07:17 -0400 Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com [IPv6:2607:f8b0:4864:20::b32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E513C0 for ; Mon, 25 Sep 2023 07:07:11 -0700 (PDT) Received: by mail-yb1-xb32.google.com with SMTP id 3f1490d57ef6-d81f079fe73so7392335276.3 for ; Mon, 25 Sep 2023 07:07:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695650830; x=1696255630; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=pbeInWKlUN3Z2QQBrR4UtpzNoToZLCsYpJRewAj23h8=; b=u6KT1EOy4DnS7okQTzXwROIFx2P8jddoRYL+AKF9JeJKCFdlFeZ1mz8ZmqzNoLjtKA 1ux1WoOTPuvTMB1EZXr982mOOOxj89bC+SNRrFWtB6IMGJwqLENeWovlgeyBmFmLK5Kl GzP9/9gPBmw3qe50jgBsnCdJg93PAeo1LkNWWoCoZwsfW/YBQKL6nG8xgTgC9N0Yvgrf Mcb/Xn4/3CZlxmfxiFXkTA5rCT4l6YY5lLu92g5buyRh0nSGfFdFdKu7aeR65y04P0YM aS7BAVKv+jRpsxdkT9SRanDPGkqXjNIYAVkKMWI72p9C2PCNq1cUtjir5+H0mLLdK53n q/Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695650830; x=1696255630; h=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=pbeInWKlUN3Z2QQBrR4UtpzNoToZLCsYpJRewAj23h8=; b=mCEafJOJI+PGwKE2vf+SwwIXk5/IKTLR27/+zxEQo6d76N5AkWz9qAH8HjH/mxv4hX bzWxzCAnXp2BLx9UHx11XOC7aGNXnN2eDilvUc3GGoDpnJNG8DzhRXgYdy2jdLkam1Cl 4jKxVJqVdJvj30GLEaP4T18gq4OsoUIMAswIXJT/XdQtwP2FCn+boYSmVzWXlxq1NV3H oUnIFGHy0UKJum2ulo9HShRi9sQOIxmg2Li1YMgsZMRherjNtLYHscSGFi7MEVrKyIXC TLMFZarTCuY3SeeaU1J8V3KdyinvnAUznqcW+irLM7wkyWIrNK2H0Uyk/ZRlXYaS1fkt X+EQ== X-Gm-Message-State: AOJu0YxVzpsOUZP0h5/JmhOE7Ce1gNadGzEjQ6x6VL2f9+8IrYmPHT22 6Ji8AgAfbh3haCqhsrNOsT40WqZ1aaXdzda7Io4PMkLwSWsSCfokW1Q= X-Received: by 2002:a25:ce4c:0:b0:d80:9ef:928e with SMTP id x73-20020a25ce4c000000b00d8009ef928emr5922448ybe.33.1695650830416; Mon, 25 Sep 2023 07:07:10 -0700 (PDT) MIME-Version: 1.0 References: <20230921203426.638262-1-beanhuo@iokpp.de> In-Reply-To: <20230921203426.638262-1-beanhuo@iokpp.de> From: Ulf Hansson Date: Mon, 25 Sep 2023 16:06:34 +0200 Message-ID: Subject: Re: [PATCH v3] mmc: Add quirk MMC_QUIRK_BROKEN_CACHE_FLUSH for Micron eMMC Q2J54A To: Bean Huo Cc: adrian.hunter@intel.com, beanhuo@micron.com, jakub.kwapisz@toradex.com, rafael.beims@toradex.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 25 Sep 2023 07:07:19 -0700 (PDT) On Thu, 21 Sept 2023 at 22:35, Bean Huo wrote: > > From: Bean Huo > > Micron MTFC4GACAJCN eMMC supports cache but requires that flush cache > operation be allowed only after a write has occurred. Otherwise, the > cache flush command or subsequent commands will time out. > > Signed-off-by: Bean Huo > Co-developed-by: Rafael Beims > Cc: stable@vger.kernel.org > --- > Changelog: > > v2--v3: > 1. Set card->written_flag in mmc_blk_mq_issue_rq(). > v1--v2: > 1. Add Rafael's test-tag, and Co-developed-by. > 2. Check host->card whether NULL or not in __mmc_start_request() before asserting host->card->->quirks > --- > drivers/mmc/core/block.c | 4 ++++ > drivers/mmc/core/mmc.c | 5 +++++ > drivers/mmc/core/quirks.h | 7 ++++--- > include/linux/mmc/card.h | 2 ++ > 4 files changed, 15 insertions(+), 3 deletions(-) > > diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c > index 3a8f27c3e310..14d0dc7942de 100644 > --- a/drivers/mmc/core/block.c > +++ b/drivers/mmc/core/block.c > @@ -2387,6 +2387,10 @@ enum mmc_issued mmc_blk_mq_issue_rq(struct mmc_queue *mq, struct request *req) > ret = mmc_blk_cqe_issue_rw_rq(mq, req); > else > ret = mmc_blk_mq_issue_rw_rq(mq, req); > + > + if (host->card->quirks & MMC_QUIRK_BROKEN_CACHE_FLUSH && Please add an inline helper function for this in drivers/mmc/core/card.h, along with the others. [...] Kind regards Uffe