Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1241746rdh; Mon, 25 Sep 2023 07:14:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGaHhQHfeG2+TWfo8WeHXDcNazwRkMSsuOGW1ru0FRM8XHJd7aHsZe+r/Ig3rMFCAeQFnu0 X-Received: by 2002:a92:c263:0:b0:351:165b:8b80 with SMTP id h3-20020a92c263000000b00351165b8b80mr8943634ild.31.1695651243027; Mon, 25 Sep 2023 07:14:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695651242; cv=none; d=google.com; s=arc-20160816; b=uviPVlK+4iFq2MEjTDQnQHV+c/gQspZTSxAQKW4S5ujvBWGTprV3RTqrPghebmHVtH tIBFSy931g2JqbIyPQbaWyo7TOkYRCaSxcgS5rwDvlF1oEHm9ahuormLUzZeCUJbxFGV 1lxWfF3lYZn4QVnj/6vR4rbvLir0JdqVYW7183f2iRvIfATvS+fAeSvdKDjBR7t8is6H mDPgJJKg9bbd1p4vkx/xLCWZt/+bXDtp+dNlR7xdGtLmG0gCnbwFIk+ytNenE3ZyrCF2 1VUlOdn55dlLO605G7lS4vj4OzPZF56oxm+/zGQsb2WJCFCxiAsPz9TsTqiK1hMIMWqZ axWQ== 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=simHxQla0UGgl7e9uhulgQd+yieE8p7l9WM34RpzBNo=; fh=chdDGo840WjOa20PbnP3yfKpxWvj2YmR9UIGNcdnvdo=; b=xzFhI6Wv+yuuSGLqVZEbkWEv36pI0CcGdR1y2mSH7OgC0F43ny0+hoLKOap5kY8w+/ 72mzUPOBantreSgmJL4bSGdRkGSzvP32zGpFIh4jYUt8fjhdOo7Z1p2FhajaL4bLx4pu zVYHT8hE0sY95Xi7MY1DfvOS0Lbz1vxvhlbbAUHHYAfD9Q+RqgrRVc8fXc2ES0FMSIng rpNEl7vnDGn2kV0FwFFNyqS7kHUYmti6oFRjWTkWglcEeTgTxfKIRUl332buCtmjsiz0 me4+Kzqfi/XBPgY8DkkHWaqSuyhSyJ0k+/2MBINWY2u8YF+5bu/wtLiCgLbkPe8iaAU7 nCvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MVvms30G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id bv124-20020a632e82000000b0056da0ae25cfsi9848348pgb.196.2023.09.25.07.14.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:14:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MVvms30G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 519C7804ACDD; Mon, 25 Sep 2023 07:00:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231226AbjIYOAX (ORCPT + 99 others); Mon, 25 Sep 2023 10:00:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229788AbjIYOAV (ORCPT ); Mon, 25 Sep 2023 10:00:21 -0400 Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4ADEC0 for ; Mon, 25 Sep 2023 07:00:14 -0700 (PDT) Received: by mail-yb1-xb31.google.com with SMTP id 3f1490d57ef6-d86a0c97ae6so2660344276.2 for ; Mon, 25 Sep 2023 07:00:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695650414; x=1696255214; 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=simHxQla0UGgl7e9uhulgQd+yieE8p7l9WM34RpzBNo=; b=MVvms30Gt+kQ1W/QtgHK6ZP7eyNvylwgYKzQvpsVRY5JRpZTkvJoIwlBzc5YSwAYIp 5Q355GWgY/y4k8KuwRozwwOvYRU0mpdZ9DGKzQ0EELfprTt9u9eQ5RBCwRAsg0gpna1+ BkJS2sA7Xp235MixqUM3k3Fwe5SIG8iKPxe5r+KCmbZ6qKEWKM11nVc5rQrPGNZh9t/a SBy9zQIiIKO5RQhsN2BxA72ej9g7HUAMv+QKY4Rbc/G5mg0zOMSt3hdfIfGloLMQYfUC DnfSwpxDbEYP7I71+5q8vlOvnvoOPViY7qCfCyLUd+BRR6mGCqL990pNdoMYXyiNQOmY kccw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695650414; x=1696255214; 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=simHxQla0UGgl7e9uhulgQd+yieE8p7l9WM34RpzBNo=; b=Nn69f4r9wJ9F9fwKSq1iyqwUo+70a0cyR09qq5IjHsk6qH8lM1G5Tt0Hztjcg2l0Xr XQiUjqy6UAEnWwIqVhLcL5ntxsKyhGUvnFMAa/hoYYV5F4i0yxdYjDtyrwrhrqaJzWQO MGtSNCTHC61Wu3uFOinU31T8ufOF8lYzk5yquGjXGpCSWijRyh/G59wQsuP6z6+CkwFW FzU6x22h9JVTBkStXtdcMJyQPhrFjmAgB3BtXKGewhkTUYN7hJ7zyjXvvvbX+ueM6h10 zGE4Xd/d5kWI7E7EAQLjIq/uSRxXa927T5xiHgftF0kZA3DvPM7upVGmOhIUISjZa6ia 45ww== X-Gm-Message-State: AOJu0Yyy+NERa5FeT8wbuLWQ/I+1O+PEHawXLzPzUYVLX/wgGr0qWNsF mGL72/CtemcJKuXlwnZHpGDIDArpsVQF/KdDkfg6Xw== X-Received: by 2002:a25:264b:0:b0:d4c:2a34:e577 with SMTP id m72-20020a25264b000000b00d4c2a34e577mr6557478ybm.19.1695650413981; Mon, 25 Sep 2023 07:00:13 -0700 (PDT) MIME-Version: 1.0 References: <20230914000348.25790-1-michael@allwinnertech.com> In-Reply-To: From: Ulf Hansson Date: Mon, 25 Sep 2023 15:59:37 +0200 Message-ID: Subject: Re: [PATCH] mmc: core: Add new flag to force hardware reset To: Michael Wu , Wenchao Chen Cc: 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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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 lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 25 Sep 2023 07:00:28 -0700 (PDT) - 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 > >