From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 389B0C4332F for ; Mon, 6 Nov 2023 12:27:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231688AbjKFM1C (ORCPT ); Mon, 6 Nov 2023 07:27:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229583AbjKFM05 (ORCPT ); Mon, 6 Nov 2023 07:26:57 -0500 Received: from out28-2.mail.aliyun.com (out28-2.mail.aliyun.com [115.124.28.2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E750BBB; Mon, 6 Nov 2023 04:26:52 -0800 (PST) X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07470094|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_regular_dialog|0.0336601-0.000693695-0.965646;FP=0|0|0|0|0|-1|-1|-1;HT=ay29a033018047211;MF=michael@allwinnertech.com;NM=1;PH=DS;RN=12;RT=12;SR=0;TI=SMTPD_---.VGP97NC_1699273606; Received: from 192.168.220.129(mailfrom:michael@allwinnertech.com fp:SMTPD_---.VGP97NC_1699273606) by smtp.aliyun-inc.com; Mon, 06 Nov 2023 20:26:48 +0800 Message-ID: Date: Mon, 6 Nov 2023 20:26:45 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH] mmc: core: Add new flag to force hardware reset Content-Language: en-US To: Ulf Hansson , 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 References: <20230914000348.25790-1-michael@allwinnertech.com> From: Michael Wu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- Regards, Michael Wu