Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp181314lqb; Thu, 23 May 2024 14:50:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVzRXVFJvPUBmSS7Ys8SroN/sABjHA6QtzWpZR045tHEWUqlychqVdsVwP/DaNJ4x1/9eHlr5IuAV7CajN/zgeY5k9Injiuk+sJwY1tXQ== X-Google-Smtp-Source: AGHT+IGEFHE/gL151vwTmGqtk5UNUW1HQLRHlJdmLAUhVoKRtGPHBUh2+DmF8kPU3elI5kKGUgIR X-Received: by 2002:a05:6214:5781:b0:6ab:99df:40fc with SMTP id 6a1803df08f44-6abcd19e33cmr3688016d6.46.1716501053598; Thu, 23 May 2024 14:50:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716501053; cv=pass; d=google.com; s=arc-20160816; b=NRbhJC/pJSuiikHyKxqzLHN7aE+Vp7TJS9cKMiPlu4+1CPCiUTgmhUQgPJvfmIoxyW R4Q/ujsN4zbHH9v43CIab73tPh8ZrjW3Di5aT+2+evdIebkgu8Ci9Eojy/iwnjtWRRbB s8nOMG0pDWHKLxZZ7rgRSeKgKxOJaCbOnGWnWawLD7SIZRyt5FO4YejQNd/gzm+1bNnn +/59o7ivLBW7RmPh7MKumBJxdW4+AMit1SPu0/cPiHnNMPOGauuqfjJnuLITRIwlTenV 8gkkelJqKvQwfhp1ltzGImV7cteqjN0Mx+yZthlMnbapUu/rhObaahKD5UYqUun8MYQq ZG6w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter; bh=UjGEN4a6rcaJ1UwDYzSce16LUBQO7bvPy3hya8NSdwE=; fh=rvzDUbqnxlh8sEHDGz6auxZWwqvJl/BHQSKrXBRes0w=; b=fwdAstxbQ6QNpTSM7n5KyJXaY/PbHZy6FgMsJjppAbWmfY3WJj6rygcS+mrB0qi0Aa Vm9NBVwxyKBkweF4bKvvV5XFzqNw+GVzFfF34l0tmz8tBGEDhalBHq6x3qdhur+D8SmW dfF2pJFwtH5ZIkKR+Dn39GpAge+U29Y2zv0+sYdhdATjvYr43zEwNhDXyYEgEtIusaL9 JR8x1P6gnjuUyO8jrXoME26/jYxna2JyDjPBKPwU1/mE5QgaCxTdBehuW+CUvC2Q3QFH USzU0RC7rjVKKsN9WliV6gdCkWVo+4DM73H4+nvcCwiri3pMe4cxgoroS/566tMN3AWi rl6g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b=WIzkQ0oV; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-188055-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188055-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43fb18cacd2si2344351cf.687.2024.05.23.14.50.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 14:50:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-188055-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b=WIzkQ0oV; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-188055-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188055-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 56BD51C2080D for ; Thu, 23 May 2024 21:50:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E4F6383CD6; Thu, 23 May 2024 21:50:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="WIzkQ0oV" Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.144.207]) (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 7BFE0AD2C; Thu, 23 May 2024 21:50:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.19.144.207 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716501045; cv=none; b=SGeRRlMw/1OFOxPvTHQJkUk1O5xMYHUBKhsi/8wxdvcT141YxqoCPhGweKp/T46oRG2cKu/3awthuaDn4guoPNL3PFSnzBmPUDq5udIxRKYmcG5bQWNNqVKHrsjFvfeiH/orCcEYNeO5OPLdHyvellFtcjaChvgVklAI2ibrb0E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716501045; c=relaxed/simple; bh=QY5gAbZY+4cKbXsw0bbAcrIJOcFMAssBPba5NZSvh8M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=LeXbYYY+vRjcCwd44eVYJFoczZW9JaGn0rmouL2Vbwu4QUjXqW+9p6M0BFuZEYwbc+NiBlvCTRXhn8capHcxpihOtIFO3eZAscVi75tRloKd65R37qV2Zw9wBQUQViFnS1Ubt1uOi81lhvgucL/HujBls3+iDXrPhKC8rt0t6fg= 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=WIzkQ0oV; arc=none smtp.client-ip=192.19.144.207 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 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 A0AF4C0000D4; Thu, 23 May 2024 14:45:28 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com A0AF4C0000D4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1716500728; bh=QY5gAbZY+4cKbXsw0bbAcrIJOcFMAssBPba5NZSvh8M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WIzkQ0oV+HCEkZwGQp1hF/3DIzIgPL+r4Fwo1mTbB/vXHY/1aGny5pH1of350/urs 8snlxB6oALA8zr+L3QwbgMyljHZe4rb99Pa5BtdupsMvBzTfUxDIRk0dNo7LmrImLl l23JQ/xg7gJcB2fQu0Huw+y6ZBqOA4QMNcfoCgFc= 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 A039418041CAC4; 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 6.1] mmc: core: Do not force a retune before RPMB switch Date: Thu, 23 May 2024 14:45:24 -0700 Message-Id: <20240523214525.200347-5-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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 25c152ef5d60..67230d486c28 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -119,13 +119,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); } } -- 2.34.1