From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2E9D6CCF9F8 for ; Wed, 5 Nov 2025 09:36:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=E7TSS51H6Zot2yjguXpDXWA7Mf+A8KFV8euyCp0zXbg=; b=P1Phc4yaX76wut zKDUSkh9DYGJs7yxDTedZLeaQVEMUZxyQyaIGEkw56ptJ0heN3N9ifpSZn2xhSQfOzTw76JDhn8qa Fewodk4zAWWt/KDNHajy1ZZ0YIyahomVVueo1IlRWMJJw96+7lbJ/ZrMC4Bfyu8ERF/DPfLkvSx1z B9NAnCwriAAbHwCmfxtlZQ6vpdFzNz64UXfqsvsvhmgpCKITow+uVzx0/M0XrA6erWy3Eov2TW8fx /AQx5GJzWz6+pT6GPX6uikIduzZ9bhf6Ce3JRcw7XhyWcpxOz6s1C+CwFxPwU6nlrNfRZ+wYebU7i gEl/XbqvWgyBhOtkks5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vGZw4-0000000DOfM-1p9m; Wed, 05 Nov 2025 09:36:12 +0000 Received: from smtpout-04.galae.net ([185.171.202.116]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vGZvx-0000000DOdN-3TCs for linux-mtd@lists.infradead.org; Wed, 05 Nov 2025 09:36:10 +0000 Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 751F8C0E61E; Wed, 5 Nov 2025 09:35:39 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 46ED560693; Wed, 5 Nov 2025 09:36:00 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 70CEA10B51A41; Wed, 5 Nov 2025 10:35:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1762335359; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=AWeVjAfEvwayrrcgeg/g3uKL1HZRS3340/63t2geN6g=; b=oyb86cw/BzojwJZ92zdlAfbHZrS8ukqgwp/wMRBsJo/g1M2ARfyxMT3IDPA5VxtdCBjL7e /74P04K3HbKdQVkylkn9zWf8ebOiA0eOq7PM6Ekqrjhg93NprxDdebhHME9QOBz88VU8kb Z95rSJS18vUuVp0TD/yt9mqZhlcCWHH2RgqsAz2r7gqrpQKpr4YHFf/3tZmaA55g9L3yS0 AWDOIqedVWeoTVdWfay1f+O1iqL/szEK4PACbQRfKgKU91CEFj/Eo2Q3GqM9LBhtpIz+dn lh0cchJIIlsnq/kIW/HevJPhGiB014f/FoOaT6aY276SR2XUDybFWNTJCqd/Uw== From: Miquel Raynal To: Santhosh Kumar K Cc: , , , , , , , , , , , , Subject: Re: [RFC PATCH 01/10] spi: spi-mem: Introduce support for tuning controller In-Reply-To: (Santhosh Kumar K.'s message of "Wed, 5 Nov 2025 14:25:58 +0530") References: <20250811193219.731851-1-s-k6@ti.com> <20250811193219.731851-2-s-k6@ti.com> <87seguemzu.fsf@bootlin.com> <87qzunt4n4.fsf@bootlin.com> User-Agent: mu4e 1.12.7; emacs 30.2 Date: Wed, 05 Nov 2025 10:35:55 +0100 Message-ID: <87ecqcakjo.fsf@bootlin.com> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251105_013606_093670_8E9FF9D5 X-CRM114-Status: GOOD ( 13.27 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org SGVsbG8gU2FudGhvc2gsCgo+Pj4gICAgIC0gT24gdHVuaW5nIGZhaWx1cmUsIHJldHJ5IGJ5IHJl LXJ1bm5pbmcgc3BpX21lbV9uZWVkc190dW5pbmcoKSB3aXRoCj4+PiB0aGUgc2Vjb25kIGJlc3Qg c2V0IG9mIG9wcyAobWF4IHRocm91Z2hwdXQgLSAxKQo+PiBJIHdvdWxkIGxpa2UgdG8gY2hhbGxl bmdlIHRoaXMgbmVlZC4gQ2FuIHRoZSBzYW1lIGNhbGlicmF0aW9uIGZhaWwgaWYKPj4gYXR0ZW1w dGVkIG11bHRpcGxlIHRpbWVzIChlZy4gYmVjYXVzZSBvZiB0aGUgaGVhdD8pIElmIHllcywgdGhl biB3ZSBuZWVkCj4+IGEgZmFsbGJhY2sgaW5kZWVkLiBPdGhlcndpc2UsIEknZCBiZSBpbiBmYXZv ciBvZiBqdXN0IGZhaWxpbmcgdGhlCj4+IHByb2JlLiBDYWxpYnJhdGlvbiBpcyBhbiBvcHQtaW4g LT4gdXNlcnMgbXVzdCBhbGxvdyBhIGhpZ2hlciBmcmVxdWVuY3kKPj4gdG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Qub3JnL21haWxtYW4vbGlzdGluZm8vbGludXgt bXRkLwo= From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 646032FD688 for ; Wed, 5 Nov 2025 09:36:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762335365; cv=none; b=tOl0LbOB+dG+cdLcR5gQ8HOtxK2X0RoOFz0CTveJDEL+WRVCg2XObNNlowz06DqwksuFoy9ZmP84CChZKq5l8qnw0UJfdfCMy9g+dzCXVmsz7n+VkmxwIw+aG2u8/uDhmYMvPsdlyKI1YaZ1HfTizLQYrkeOtou5Ou9wdRkRTTs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762335365; c=relaxed/simple; bh=1qvFsopmwgdAu8iPaOHE29Ts9hz3+IPTTaCjSjI9u0c=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=s8/DUzpTS0mw4EByrfKnuYrftMT188DyvO1TpFDabdrMkGg6BcQ8/Selo+7KfjAgSscD3RSlyIYQeaiybEahgmAfOrnSzUXvlBnlJarnaAQXL/fEyBaEZwwod+pq1gjmrNyEtxVOHiFuScO7soS7szQJ5nne4K8SKY9tJYsNvHg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=oyb86cw/; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="oyb86cw/" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 8FD8D4E41512; Wed, 5 Nov 2025 09:36:00 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 46ED560693; Wed, 5 Nov 2025 09:36:00 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 70CEA10B51A41; Wed, 5 Nov 2025 10:35:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1762335359; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=AWeVjAfEvwayrrcgeg/g3uKL1HZRS3340/63t2geN6g=; b=oyb86cw/BzojwJZ92zdlAfbHZrS8ukqgwp/wMRBsJo/g1M2ARfyxMT3IDPA5VxtdCBjL7e /74P04K3HbKdQVkylkn9zWf8ebOiA0eOq7PM6Ekqrjhg93NprxDdebhHME9QOBz88VU8kb Z95rSJS18vUuVp0TD/yt9mqZhlcCWHH2RgqsAz2r7gqrpQKpr4YHFf/3tZmaA55g9L3yS0 AWDOIqedVWeoTVdWfay1f+O1iqL/szEK4PACbQRfKgKU91CEFj/Eo2Q3GqM9LBhtpIz+dn lh0cchJIIlsnq/kIW/HevJPhGiB014f/FoOaT6aY276SR2XUDybFWNTJCqd/Uw== From: Miquel Raynal To: Santhosh Kumar K Cc: , , , , , , , , , , , , Subject: Re: [RFC PATCH 01/10] spi: spi-mem: Introduce support for tuning controller In-Reply-To: (Santhosh Kumar K.'s message of "Wed, 5 Nov 2025 14:25:58 +0530") References: <20250811193219.731851-1-s-k6@ti.com> <20250811193219.731851-2-s-k6@ti.com> <87seguemzu.fsf@bootlin.com> <87qzunt4n4.fsf@bootlin.com> User-Agent: mu4e 1.12.7; emacs 30.2 Date: Wed, 05 Nov 2025 10:35:55 +0100 Message-ID: <87ecqcakjo.fsf@bootlin.com> Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Hello Santhosh, >>> - On tuning failure, retry by re-running spi_mem_needs_tuning() with >>> the second best set of ops (max throughput - 1) >> I would like to challenge this need. Can the same calibration fail if >> attempted multiple times (eg. because of the heat?) If yes, then we need >> a fallback indeed. Otherwise, I'd be in favor of just failing the >> probe. Calibration is an opt-in -> users must allow a higher frequency >> than they use to in order to enable the feature? > > It's possible the same calibration will fail intermittently for > different reasons (temperature changes, as you mentioned). If tuning > fails, the driver should fallback to the non-PHY frequency so the flash > continues operating with slower reads/writes rather than failing the > probe (availability should be prioritized, right?). Agreed, if the tuning may fail we must fallback in this case. However there is another situation that must be handled in this case: once tuning is done and we want to use PHY-optimized paths, we must fallback to more basic/slower reads if for some external reason, they start failing, right? The obvious choice in this case would be to let this error handling to the controller driver. Re-using the same operation at a lower speed would be suboptimal, because the fastest operation at a high speed might not be the most efficient at slower speeds due to the number of dummy cycles needed,. But I believe this is negligible based on the fact that we already are in degraded mode at that stage. However, this may conflict with: - read retries - continuous reads (?) So in practice the fallback might be needed on the SPI NAND/NOR side (this can be further discussed). But once we solve this, comes a similar problem on the write side. How do we know if a write will or did fail because of a temperature change? What may be the heuristics to fallback in this case? Thanks, Miqu=C3=A8l