Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2155223rdf; Mon, 6 Nov 2023 06:20:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IFV4jDj77R/LW460UPfhBG5OhSqYFEo3f50idtHP16LCF4CmYEJN2qXvxKWJqxNEz6QLtkW X-Received: by 2002:a05:6300:8005:b0:180:e4c1:3e7b with SMTP id an5-20020a056300800500b00180e4c13e7bmr16528437pzc.34.1699280441074; Mon, 06 Nov 2023 06:20:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699280441; cv=none; d=google.com; s=arc-20160816; b=ml8bqgsqFtEd2sJ3rQUE7/P0SesopgiFSw9TCRLY9m98tKo/idxkeI9fyQNKk0+jSR hp3pFycWqq68Xp7iLZZSWaXPjV1WRv8aZqo74298F95SPFSftYLrwb29co0UOb/KSCpO HzBMxQEUPjGDbFYu6BgJhE0WvI1WAR4Qi4Y8LAJQeJ+dHBE2SPEjss20AaayuGPNYg8I WM240rgJpfcp8LYmqh0/vPvFPWKGmw5f3CeeXo1QRQM9033+Gp1rdpibxkLTd/NJKYf8 bLRByxzMT2h+uaN6Wu0YX+wKvKcKCtGF8YOIVQJ5Y5H60xZD6FLRNtn2Vx3CAPSv6gnN IAeA== 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=RLr2bQVZO5vELBcg960tlJRT0FhBkpzjwU4puAyAeTw=; fh=wdSE4lIFVxVkzdflChKgFAgyRZgIVLBmShNAr3R2oCA=; b=PRvw5Ghx5YMkbHCznjxbO33Q6/LUr2f2HBrumw6/QzQwSf/ZuFs7mdyblDDE80+CC2 OKRzTCYQ0hZ0huzevLGrWaXsP3KBLoVKKvh38jIhZ85qFF0Ki3jZR4095wilqWUSH8ET YzIKEohJAXBRCQ9LZT4+R2YmfAW0I3vZcxaGukrD3KkYBlNMV60yqjWOnN6oEeN9d9D9 JZ2Wo8TMV5f5C8+GrvyCS7YPjgojI+ejwZjJk3Nv7WjfMyu6zUkhDlo4MmWr97kDTPWr XMIMjuRYhQKtPerNqMnhHCdldAFrGejkbMoD0bkBLdTV/SkhZx21zMT6GePB+JIdFW10 FGhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e1Xr5o5f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id i5-20020a170902cf0500b001cc1af09466si9082953plg.125.2023.11.06.06.20.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 06:20:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e1Xr5o5f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 04232807E88E; Mon, 6 Nov 2023 06:20:24 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229563AbjKFOUR (ORCPT + 99 others); Mon, 6 Nov 2023 09:20:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbjKFOUQ (ORCPT ); Mon, 6 Nov 2023 09:20:16 -0500 Received: from mail-yw1-x1129.google.com (mail-yw1-x1129.google.com [IPv6:2607:f8b0:4864:20::1129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DA03BB for ; Mon, 6 Nov 2023 06:20:13 -0800 (PST) Received: by mail-yw1-x1129.google.com with SMTP id 00721157ae682-5a81ab75f21so54092457b3.2 for ; Mon, 06 Nov 2023 06:20:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699280412; x=1699885212; 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=RLr2bQVZO5vELBcg960tlJRT0FhBkpzjwU4puAyAeTw=; b=e1Xr5o5f8Hl/00fAv4oFSNrxG7mpRUouvd6m9+jKH5fRkU3b9nH5TWsNgE4R0I1Z3M 1WeLlPyzk80CtcBpvB+wL/QUvBWN9soN9t9tnSl2vaGs+uzIIOa2XNwCM+Z+Q7zED/pl 1SV34ohwtdjaY3KZRNvCJrjuhU5SA1gtpGwaueg0enl9MUG4cYGXrvOfehwcVCJLla0t 5XAe63oWWysS9JAVZuAjwr6F0J6S3ChG5fGnlgbvPncVf4yD/r+RDZjRNSvBJXaG/htL K2hxT3UptoFmESd8i9yMvytqkPbKeIJH96TNNCg1hSCKVaq40SBu5XwSzkzJRF5RYPm/ aA4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699280412; x=1699885212; 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=RLr2bQVZO5vELBcg960tlJRT0FhBkpzjwU4puAyAeTw=; b=oHF2OLF7rPeTHz8DQXSjoYyOf4f5IbVGMpXZ6MIN6h6JsyWkavJMoGx563Pc0LqWsd pAXBW02iBz1aEKbzO7Ct226DM/yjaUTtpvJ4HAtjdic9V2uYD6cCqHVV/rqLmOEKrYNv hoFArtTBOrXYzLF2uFbA5PYibSTpPo+7BW9U1Xzwn8pdnZmN2cTAQSOF1RHTmqZz9kbN WVCbJJv50LJsG7JhaQ8TeaMCIRUqSxRrQX/03Cm3rXDYc8iN3kVoKAnttPuke6RDrxFw DzAiivwIHgaQpM9HcFFyfy3FXkw4U5rcGcG9xbQkkLaRkLeh/CH0jaow2lv4QGnSa1Z/ 6TZA== X-Gm-Message-State: AOJu0Yxfz51Bxct4A9i7PQmoxmFxW5BhD+9vMa1zK1BzbAVy4J4q5Ick O5XkZXiRVE+B/p+/rZAR5azsLaHjrQm1AwGdhPAi/Xa0lIh9qz0A X-Received: by 2002:a81:a0ca:0:b0:5a8:3550:61b2 with SMTP id x193-20020a81a0ca000000b005a8355061b2mr12196848ywg.29.1699280412564; Mon, 06 Nov 2023 06:20:12 -0800 (PST) MIME-Version: 1.0 References: <20230914000348.25790-1-michael@allwinnertech.com> In-Reply-To: From: Ulf Hansson Date: Mon, 6 Nov 2023 15:19:36 +0100 Message-ID: Subject: Re: [PATCH] mmc: core: Add new flag to force hardware reset To: Michael Wu Cc: Wenchao Chen , adrian.hunter@intel.com, jinpu.wang@ionos.com, victor.shih@genesyslogic.com.tw, avri.altman@wdc.com, asuk4.q@gmail.com, f.fainelli@gmail.com, beanhuo@micron.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Sarthak Garg 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 06 Nov 2023 06:20:24 -0800 (PST) On Mon, 6 Nov 2023 at 13:26, Michael Wu wrote: > > On 9/25/2023 9:59 PM, Ulf Hansson wrote: > > - trimmed cc-list, + Sartak Garg > > > > On Thu, 14 Sept 2023 at 10:00, Wenchao Chen wrote: > >> > >> On Thu, 14 Sept 2023 at 08:04, Michael Wu wrote: > >>> > >>> Entering the recovery system itself indicates a transmission error. > >>> In this situation, we intend to execute the mmc_blk_reset function > >>> to clear any anomalies that may be caused by errors. We have previously > >>> discussed with several MMC device manufacturers, and they expressed > >>> their desire for us to reset the device when errors occur to ensure > >>> stable operation. We aim to make this code compatible with all devices > >>> and ensure its stable performance, so we would like to add this patch > >>> > >>> Signed-off-by: Michael Wu > >> > >> like: https://lore.kernel.org/linux-mmc/20220603051534.22672-1-quic_sartgarg@quicinc.com/ > > > > Looks like this series didn't make it. I was awaiting a rebase from > > Sartak to apply it, but apparently something got in his way for a new > > submission. > > > >> > >> You should enable it in the vendor host. > > > > Yes! We don't want unused code in the core. We need a user of it too. > > > > May I suggest that you pick up Sartak's patch for the core and thus > > add another patch for the host driver you care about and then > > re-submit it as a small series. > > > > Kind regards > > Uffe > > > >> > >>> --- > >>> drivers/mmc/core/block.c | 2 +- > >>> include/linux/mmc/host.h | 1 + > >>> 2 files changed, 2 insertions(+), 1 deletion(-) > >>> > >>> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c > >>> index b5b414a71e0b..29fbe0ddeadb 100644 > >>> --- a/drivers/mmc/core/block.c > >>> +++ b/drivers/mmc/core/block.c > >>> @@ -1503,7 +1503,7 @@ void mmc_blk_cqe_recovery(struct mmc_queue *mq) > >>> pr_debug("%s: CQE recovery start\n", mmc_hostname(host)); > >>> > >>> err = mmc_cqe_recovery(host); > >>> - if (err) > >>> + if (err || host->cqe_recovery_reset_always) > >>> mmc_blk_reset(mq->blkdata, host, MMC_BLK_CQE_RECOVERY); > >>> mmc_blk_reset_success(mq->blkdata, MMC_BLK_CQE_RECOVERY); > >>> > >>> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h > >>> index 62a6847a3b6f..f578541a06b5 100644 > >>> --- a/include/linux/mmc/host.h > >>> +++ b/include/linux/mmc/host.h > >>> @@ -518,6 +518,7 @@ struct mmc_host { > >>> int cqe_qdepth; > >>> bool cqe_enabled; > >>> bool cqe_on; > >>> + bool cqe_recovery_reset_always; > >>> > >>> /* Inline encryption support */ > >>> #ifdef CONFIG_MMC_CRYPTO > >>> -- > >>> 2.29.0 > >>> > Dear Ulf, > I have tested Sartak's patch and it is also able to resolve the issue we > are currently facing. Therefore, I would like to inquire about the > expected timeline for merging Sartak's patch. Hi Michael, There is another series [1] that Adrian is working on that is related to the problem in $subject patch. Perhaps you can take a look and try it out instead of Sartak's patch, which seems to have gotten stalled. Kind regards Uffe [1] https://lore.kernel.org/all/20231103084720.6886-1-adrian.hunter@intel.com/