Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1446034rdd; Wed, 10 Jan 2024 22:05:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IFMBZlJfxF9JXZ9mno3h1QK8H7A8qThmTprdXGGhORS1fs1DmT0Wf3yaOWRIR+/l1gQxLuX X-Received: by 2002:a05:6a20:da9e:b0:199:a3ea:9686 with SMTP id iy30-20020a056a20da9e00b00199a3ea9686mr640382pzb.22.1704953156919; Wed, 10 Jan 2024 22:05:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704953156; cv=none; d=google.com; s=arc-20160816; b=jez/6WBUM1WAYDuvQm4BXx5itiYrqKCUnr1YWJOu/aQ6AAWpLVrxlLhwEzL2bGSiLD b6pNWzQPahPRG8CESx2FjhRI4erbTlp8J+0Rk+TK68tVg5XqbCFWNfR9cCJZTbnDVxU3 PBP0olkX4pTPulX6zlQJZVUY+0vMqvq34HPITLSemSIRXK26jiWBwPARMrTmIYUE5R3k xBfAjUh9WE2joSbsCI+HVVZDTSFWuL6EBPY2Orwpw0BcDiPk8NVf/IPCa/cYJo1GAqH/ MTh/P0t04LRKQVkZnmSCmV52IoE1icHzQ0xFucSlXeuTP185rrqm5N9l1+WPfdpC2of0 wpnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=lHGoXIC2FCB2mAKhVqh6NZDuE4LJRbl6RDfBQ0QRmmo=; fh=Vwjxte+jU3k8K4Je2yjb1vZ6B7rfu6iAcXNWENlUHcY=; b=CT2yk6xyuCNvpU1uk8MNIACGaBgL+F4TrPVvad2pY1KT77K1hDQKfw53KlldazU1Rz 6TuIizCcdAs9tiRyFPBpbVDwQAVgaznodolsNL+H/eZsCZMefYXkk+RIHytnzEsaHhuI KeVdY7mZpVzWKI2D7fo72UDG0U9BmW0iJVcR+a7iKfVM+wbya9TkpeW64RhGkVXYbqPo 1b97Cb0I3JctQWXWxiUiGfXMAZbAVoesO2i6IPy1UnegK3MKY81TaVqO7pVbKlTV6w0o BwSv0sD0HHWY0P6ELrRkidBVyit9YC3gYA0vpPRy8a74h2twVhOLOFATyiZLlgKvq1Jl qlxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Q+HKG1xL; spf=pass (google.com: domain of linux-kernel+bounces-23079-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23079-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a11-20020a056a001d0b00b006d99c132debsi398301pfx.69.2024.01.10.22.05.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 22:05:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23079-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Q+HKG1xL; spf=pass (google.com: domain of linux-kernel+bounces-23079-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23079-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 90156281C51 for ; Thu, 11 Jan 2024 06:05:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7DD0D23CD; Thu, 11 Jan 2024 06:05:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Q+HKG1xL" Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5BACD2101; Thu, 11 Jan 2024 06:05:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1d3e8a51e6bso39835755ad.3; Wed, 10 Jan 2024 22:05:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704953146; x=1705557946; 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=lHGoXIC2FCB2mAKhVqh6NZDuE4LJRbl6RDfBQ0QRmmo=; b=Q+HKG1xLsbBoITDb4YUFsnxMoHpaDEpTOCJwjCqbddCUCI4vcDZ7UWEgokaZHIemXP un/ycE8w5aj6RZVA4Uty5xrL1AZa2RFkgkC5nu8UK1oWcQ2TR5iz86JypqfDWf5MipTX NLFg6XbjJodNGzrMGxeJFg3KHfXBuMbzfWHA4w/yZStQ0amfQWJ6Dwr2GCGKzxf1Jbho PuWcBMlzal+ng/l/TroO4A4/4scy+izDdJ4Fg7Q3H+i3S4nqZXdhbbU/izuMshttjEGh 8skdF1g/78HIRkGEJFntsY/Mc+CKX0KxnOdzlE54lfI46sOAhPcDChR53caCOj6vJ8g7 SeRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704953146; x=1705557946; 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=lHGoXIC2FCB2mAKhVqh6NZDuE4LJRbl6RDfBQ0QRmmo=; b=SHGuloj9jn+Oye+Q8eOMnFQYivjuQHjdPhBVziyY8I8lt04B/61eqKSWe6sjPbrAZB pqobOceuHXtZSijPbQmTWsfJM5W6zd4+U9MvsKtErAQeCIZs9E062silyriS+u1nK0a/ qhiq0RUPpeA/ssFnqaMXBx1EcjgYutkVRCPWSNgGyilk+wLC7r47EF2uzrN/v2GFROSu DD7wFwPPjY+sLMvQ9pThBEJ4yIJZcEu7gCCvgr2xBmkt1v132kahboPnMcy8tFC9h5j6 ohejipr0T/bArW7v/5Go7NVrXzfir/t7TBMt7q9Igyt4zdRBZzN5PdCG2ePwtQQw7uF1 T2VQ== X-Gm-Message-State: AOJu0YxmExeGcZFS2ZtPZQCYQEU+xZZI0+8lOYUIiDDWqpsLbL2QJ3YB fH777uQEg9NpKnkE2LNJDZjizKmHRsUIvp9YsZ4= X-Received: by 2002:a17:90a:f513:b0:28d:b4f8:5104 with SMTP id cs19-20020a17090af51300b0028db4f85104mr498035pjb.48.1704953146596; Wed, 10 Jan 2024 22:05:46 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20230914000348.25790-1-michael@allwinnertech.com> In-Reply-To: From: Wenchao Chen Date: Thu, 11 Jan 2024 14:05:35 +0800 Message-ID: Subject: Re: [PATCH] mmc: core: Add new flag to force hardware reset To: Ulf Hansson Cc: Michael Wu , 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" On Mon, 6 Nov 2023 at 22:20, Ulf Hansson wrote: > > 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 Sartak Any updates? > 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/