Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4081303rdb; Mon, 11 Dec 2023 08:18:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IFrJqKv84uwa4w2ZBs/e18vJUunVyfVmFk0CxA8BbvSs0TO5HBR2eWqXaeu+vT8cyjMWLRR X-Received: by 2002:a05:6a20:918b:b0:18f:97c:5b7e with SMTP id v11-20020a056a20918b00b0018f097c5b7emr1906683pzd.76.1702311526826; Mon, 11 Dec 2023 08:18:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702311526; cv=none; d=google.com; s=arc-20160816; b=F+7GeFGQSPhjKrjIltOpJEpzWbWR2zvHQtkis7CS0PnmlzfDh98Mi+/d1sogPV46A9 tff+o0BlGKGOOZYHunPw8aU9nriKxvHKneo0wa+IdKG8EJFdRnSohm3AdchpGzyitjZr 4RzpL9AWIZN8e+3w9MBk6HXrGEKQuy5Z1O9qCnP0n5cUGMW2NNTe18myjij0cq+ljIjL eSEdbsfvfCUCqpfY3Y1xY0xYgPJnX3sPZKzqKdmxKEnSrRIp7NJ/pQOndvOPVvrUoDOS aeuuDvlcIbKDFNwgDZd5dNC5BZY+VUFnE4Zoc/Pm6LYQEvolNP3T/aEZb9E4T+lWmmCD l1lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=WVGpWdVHRr5qwyVF87eDhHdOu8Ifs73wbxO/Y9qHJVs=; fh=b1wLsKO7h4RsH0HG5AnQjJJZ5jTMkmcvVB/41zH4QRU=; b=GzDGjTCnkF8+NdquNU79CExJUU0Cqmarvwf1cQNub0XZCAQOTLIofCqAzkDZjoD+4e SOa3bxPKUD3FIPv1BFGkH2qr7VLFuDu1pkL9x9ufIHl9jmSirhaLHBdG96wyar11sh4M /Wo6gn75DsoTg2Isn4wwg0xhF69j72SOibpc4fMRdWzMvV2ZrJOnMTHhIF3TvcRZifn2 LjU7m30Rq9qUhFbupam6vHxi24PvgxJmwZsOA+ygiUteohMAMmyFoThlKz+bYEPgAdk4 V1uKzdDbXfFSdFC8UbsaFDKs+bjxM/yMgwq6vcTY/TP2iE4bagh6KIa4T98ZuvqKn6Hg w4TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=G2diwhM3; 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=intel.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id d11-20020a056a00244b00b006cbf2bc6eaesi6278247pfj.188.2023.12.11.08.18.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 08:18:46 -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=@intel.com header.s=Intel header.b=G2diwhM3; 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=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 07A1880784F6; Mon, 11 Dec 2023 08:18:43 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343898AbjLKQS3 (ORCPT + 99 others); Mon, 11 Dec 2023 11:18:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235050AbjLKQSP (ORCPT ); Mon, 11 Dec 2023 11:18:15 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6403121; Mon, 11 Dec 2023 08:18:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702311483; x=1733847483; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=pq3tQro7AfQqawP/TcYhRcCE5EHiRcvkpl2Wjvc64Hc=; b=G2diwhM3IrEbzTG7kpWneBvbpsBPECnHEAuQbKCEGUQZ6OBQDYUH1xuu ibJ8QWzn9hN1inCfIz/bBhCZEgLR1/52xPrBxtt8kE3Nx5HHZ3Z+gE5Uw WQmPg8z17F5rX5dJXOjf4d2N+Hq8owfPU8G8Keorl1MtjVI+j39czjjLh P16diuvHYzQ/E4drtIAwy8EY1a8ZwtaQOtv69Oapl7iFUQ1sCNnLcJlS0 3e4iasI8aeaZoH+v2vgP58eTg3ay08qzfu6vTnTVYLwUKhn3FKfCpGpX8 J9a8I14fOMTg24At6nuqQegMEv76C9zqMbT1l8vvB1zoml1BdUK/C2Kvz w==; X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="1741822" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="1741822" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 08:18:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10921"; a="916907512" X-IronPort-AV: E=Sophos;i="6.04,268,1695711600"; d="scan'208";a="916907512" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.252.46.23]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Dec 2023 08:18:00 -0800 Message-ID: <71fad7ef-01a1-4dc5-8d02-6339ca77ca6c@intel.com> Date: Mon, 11 Dec 2023 18:17:56 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mmc: rpmb: do not force a retune before RPMB switch Content-Language: en-US To: Jorge Ramirez-Ortiz , Avri.Altman@wdc.com, ulf.hansson@linaro.org, christian.loehle@arm.com Cc: linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org References: <20231204172243.3382495-1-jorge@foundries.io> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: <20231204172243.3382495-1-jorge@foundries.io> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,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, 11 Dec 2023 08:18:43 -0800 (PST) On 4/12/23 19:22, Jorge Ramirez-Ortiz wrote: > Requesting a retune before switching to the RPMB partition has been > observed to cause CRC errors on the RPMB reads (-EILSEQ). > > Since RPMB reads can not be retried, the clients would be directly > affected by the errors. > > This commit disables the request prior to RPMB switching while allowing > the pause interface to still request a retune before the pause for other > use cases. > > This was verified with the sdhci-of-arasan driver (ZynqMP) configured > for HS200 using two separate eMMC cards (DG4064 and 064GB2). In both > cases, the error was easy to reproduce triggering every few tenths of > reads. > > Signed-off-by: Jorge Ramirez-Ortiz > Acked-by: Avri Altman > > --- > drivers/mmc/core/block.c | 2 +- > drivers/mmc/core/host.c | 7 ++++--- > drivers/mmc/core/host.h | 2 +- > 3 files changed, 6 insertions(+), 5 deletions(-) > > diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c > index f9a5cffa64b1..1d69078ad9b2 100644 > --- a/drivers/mmc/core/block.c > +++ b/drivers/mmc/core/block.c > @@ -859,7 +859,7 @@ static int mmc_blk_part_switch_pre(struct mmc_card *card, > if (ret) > return ret; > } > - mmc_retune_pause(card->host); > + mmc_retune_pause(card->host, false); > } > > return ret; > diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c > index 096093f7be00..a9b95aaa2235 100644 > --- a/drivers/mmc/core/host.c > +++ b/drivers/mmc/core/host.c > @@ -119,13 +119,14 @@ void mmc_retune_enable(struct mmc_host *host) > > /* > * Pause re-tuning for a small set of operations. The pause begins after the > - * next command and after first doing re-tuning. > + * next command and, if retune is set, after first doing re-tuning. > */ > -void mmc_retune_pause(struct mmc_host *host) > +void mmc_retune_pause(struct mmc_host *host, bool retune) > { > if (!host->retune_paused) { > host->retune_paused = 1; > - mmc_retune_needed(host); > + if (retune) > + mmc_retune_needed(host); Better to just drop mmc_retune_needed(host); > mmc_retune_hold(host); > } > } > diff --git a/drivers/mmc/core/host.h b/drivers/mmc/core/host.h > index 48c4952512a5..321776b52270 100644 > --- a/drivers/mmc/core/host.h > +++ b/drivers/mmc/core/host.h > @@ -18,7 +18,7 @@ void mmc_retune_disable(struct mmc_host *host); > void mmc_retune_hold(struct mmc_host *host); > void mmc_retune_release(struct mmc_host *host); > int mmc_retune(struct mmc_host *host); > -void mmc_retune_pause(struct mmc_host *host); > +void mmc_retune_pause(struct mmc_host *host, bool retune); > void mmc_retune_unpause(struct mmc_host *host); > > static inline void mmc_retune_clear(struct mmc_host *host) > -- > 2.34.1