From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A70221448EB; Thu, 13 Jun 2024 11:44:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718279067; cv=none; b=G2/2ilIrQCJw4EYTtoRAgczuzMyR2Y3bUhUIKTZaZfxEMGBUhi4JJJF70YVs+qtcIGv4wwI/khVRMoFlY1BGr+t45u0a47Id6e8cC02LcXzk108JWmKfEkasjmKFAJmPVxX1w5k3JcefYqbG4unIee81ra14L02WQxEzFYcqP+E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718279067; c=relaxed/simple; bh=tcsj1cmlURostA04I+6AQUpy1JVfxr5QC/OYy9w+Prc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jIf0z3UUv236R3w6nJsfGTyCoc+qH5q1XwCi5a06aZlkvXGSSXv1q29cnJKpmQb+eOQTQyvgLmtjwuBx8YKwBWiRwSNLQLGwCTj6iCLsUSMqCwpPJXgih8/Bmy5ZqTU9P7M91zHCijnuK32l/20SrPtjfNs+cCbPVcy5c8WpR6Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=IkiQ050T; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="IkiQ050T" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2EFFFC4AF1C; Thu, 13 Jun 2024 11:44:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718279067; bh=tcsj1cmlURostA04I+6AQUpy1JVfxr5QC/OYy9w+Prc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IkiQ050TU8wL4HylOfpTxjptZoIQ1m5Ly1Qi9Rp6DLTZ8HHzfEF41mYPslv/XYV0e zmCbdVEPk06CUb30U22pss5xeRYBhpr5QhlDiC46Dn87Q51ef0ikhG4TYmUKIVLZiZ tP5KnDrI7aVEM/T52quiYCpu49EY29oBEtK9t3eI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jorge Ramirez-Ortiz , Avri Altman , Adrian Hunter , Ulf Hansson , Florian Fainelli Subject: [PATCH 4.19 147/213] mmc: core: Do not force a retune before RPMB switch Date: Thu, 13 Jun 2024 13:33:15 +0200 Message-ID: <20240613113233.661410900@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240613113227.969123070@linuxfoundation.org> References: <20240613113227.969123070@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/core/host.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -68,13 +68,12 @@ void mmc_retune_enable(struct mmc_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); } }