From patchwork Thu May 23 21:45:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 13672338 Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.144.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 33082AD2C; Thu, 23 May 2024 21:52:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.19.144.209 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716501170; cv=none; b=cUxPNBP4TvRFe4akH4XskHadFb3nUUcHuIdZ0M31cl3uIiZSvFjB18yjTIYnIcm9ac8pPC2JZpmYGiPT92erC7SeL9kUdwOrgXDVf2XeaAN/XRWSn9WQGtohNB5UNUaePpkOvytwdin4vt4Dc0qbjp2b5Tkx/JgkjW2XaouzGiI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716501170; c=relaxed/simple; bh=+eikmCjYdDu6H3MgfTHvENYmy2Ei3dxKeO83qfE20cQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ij1oiYfinV6PKEEBaJpQ0S7qrbysHYSbUrkp2O1FBIysXQmBwyTUfD6kSIVAjU8Bmil/6gDWpkouCZ3Rldre03/i3cEHfs5/ZevUbh2BfESmZ/BJZC31P/toASDMUBzfpM+IieIZSCU7w79WxqhoXFtD1ieYbLMw2xWEHAeDZWU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=hGJjOX8n; arc=none smtp.client-ip=192.19.144.209 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="hGJjOX8n" Received: from mail-lvn-it-01.lvn.broadcom.net (mail-lvn-it-01.lvn.broadcom.net [10.36.132.253]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id 862F7C0000E7; Thu, 23 May 2024 14:45:28 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 862F7C0000E7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1716500728; bh=+eikmCjYdDu6H3MgfTHvENYmy2Ei3dxKeO83qfE20cQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hGJjOX8nsxvJcqH6sVhtNhf8hHk35XYTKDCgXgGXfRxkOnp4BW/ije/nvz/wuOo1+ 3q4SdGYckjqLv1c7qnG4WtSDCkWI/XoG/ynRu1EFVW6xV++cabZRtqXg5JPwJ+dDWz AM/L7cNmTbGkUUHOOIbZgtZnqLmS8d9HuHuL1l0c= Received: from stbirv-lnx-1.igp.broadcom.net (stbirv-lnx-1.igp.broadcom.net [10.67.48.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail-lvn-it-01.lvn.broadcom.net (Postfix) with ESMTPSA id 7CFAF18041CAC8; Thu, 23 May 2024 14:45:26 -0700 (PDT) From: Florian Fainelli To: stable@vger.kernel.org Cc: Jorge Ramirez-Ortiz , Avri Altman , Adrian Hunter , Ulf Hansson , Florian Fainelli , Greg Kroah-Hartman , Geert Uytterhoeven , linux-mmc@vger.kernel.org (open list:MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND...), linux-kernel@vger.kernel.org (open list) Subject: [PATCH stable 5.4] mmc: core: Do not force a retune before RPMB switch Date: Thu, 23 May 2024 14:45:23 -0700 Message-Id: <20240523214525.200347-4-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240523214525.200347-1-florian.fainelli@broadcom.com> References: <20240523214525.200347-1-florian.fainelli@broadcom.com> Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jorge Ramirez-Ortiz commit 67380251e8bbd3302c64fea07f95c31971b91c22 upstream 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 retune request prior to switching to the RPMB partition: mmc_retune_pause() no longer triggers a retune before the pause period begins. 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. With this commit, systems that were utilizing OP-TEE to access RPMB variables will experience an enhanced performance. Specifically, when OP-TEE is configured to employ RPMB as a secure storage solution, it not only writes the data but also the secure filesystem within the partition. As a result, retrieving any variable involves multiple RPMB reads, typically around five. For context, on ZynqMP, each retune request consumed approximately 8ms. Consequently, reading any RPMB variable used to take at the very minimum 40ms. After droping the need to retune before switching to the RPMB partition, this is no longer the case. Signed-off-by: Jorge Ramirez-Ortiz Acked-by: Avri Altman Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20240103112911.2954632-1-jorge@foundries.io Signed-off-by: Ulf Hansson Signed-off-by: Florian Fainelli --- drivers/mmc/core/host.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index 2d63c0f188e1..c4b40c06de22 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -111,13 +111,12 @@ 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. */ void mmc_retune_pause(struct mmc_host *host) { if (!host->retune_paused) { host->retune_paused = 1; - mmc_retune_needed(host); mmc_retune_hold(host); } }