From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=68.232.154.123 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796024724; b=IHctKT4L19fQvEGN3A9ja1koVUn1F+eROt0uNOkC3pHmJAcGWpB7P4Q61p2Owg4QgZus oGqPHh5UhXwCwizht06/0fa7yJyiqREqlzc4noouMVcfPAXEB/7nAs24dvgxgNmMVt16z uK5zzoWktmJLXQlyNNasZjaMj+14BJmV60tqBiCgGbqw1jrIPjNS2UCijOdMo3uWbLIwf WOwRTssEftZfvzCdO629I+J1BkbTWiOrvzelXJf+cu2OmPV4KA1SUVE4qFzegJQPhxa7b vMn1KVOkgk8tBCbL2oLoBZjQcIciHVYcrGW08nG56zRsV5DPjCv5qNhDODX6krOsKzw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796024724; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-Amp-Result:Received:Received:Received:From:To:CC: Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:Content-Type; bh=kfBhQXtewf2sYF4OnIuGKGbuWrG4bScGYmAvEpA0coI=; b=CBvxhaQr5KkKFeXSidQAIXjhbLOF3ktoNYIq4tuyZoBntbKWAtT06yy+gInXEE9eDonP J1ontWK3A3eWvylKZe1sJ1dc1r7uIib5MMsPtxDc7L2qKq8dYHPr/2BFNJwv9aikbrUMI XanXxxroqNVUtLbRJclxWjrFu+ni4JgN4A4D2yiUngVa9HnwptYd/VlEYfIni4dIw+6fG e+20I/UnXIygL0IV+kVPzdtQRiMQ7eLwhKujb0E0II/mB1iVCuIp34HaNVPplH7mAuxqQ 3J5wsnha7/xcsM3IJtcLQRlf8w4h0xMy0WHCrvQfyZ2bgCnpPytr7+1UKLtN8WnX+VA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b="p/zS7WJP"; arc=none smtp.remote-ip=68.232.154.123 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A133D606A325 for ; Mon, 30 Nov 2026 07:45:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A133D606A325 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=p/zS7WJP DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1796024723; x=1827560723; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mzGjinilvOutaS1mf3W2GwPTk8NgmvlWOWxtPp4bLgs=; b=p/zS7WJP5n0Sw+gTrYIxng1aJh3OqiQul6OsxFXlOqxaH5yAkUkh25pd j80XrpFIm5mPW8sWSk9BxlhSBzMES8ixgHMhDA1R8nV54g1O8+S103L9B ukU7FoKnBd6WkBMD/Ky82s7RNBcDHcx+6CT8d3G9o8ciIICE52n1Zx/08 ViwoqXuPiXpKwnPYMY9hN/OSVpx8ST7tRXxogOpEnXYREUiSF1CMMwAs3 bHX+Zrj4Ym14vK6Z9iTRqPjsL4d1m68Rho0K3hzPcVELgUTQZSW3TdHEX m2j90i1LlY0cz6aGPH28fg/3a8bR2y4B8Pu/Vt3ysmQdb8KDcjhZePBAW A==; X-CSE-ConnectionGUID: zhXJhovVRLGqdTSNx4qzMw== X-CSE-MsgGUID: RZgGFJrQQxmYwMWzmagYkg== X-IronPort-AV: E=Sophos;i="6.27,242,1787036400"; d="scan'208";a="67434734" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2026 00:45:23 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.87.152) by chn-vm-ex4.mchp-main.com (10.10.87.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.2562.57; Mon, 30 Nov 2026 00:45:22 -0700 Received: from che-ll-i67131.microchip.com (10.10.85.11) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.58 via Frontend Transport; Mon, 30 Nov 2026 00:45:19 -0700 From: Manikandan Muralidharan To: , , , , , , , , CC: Subject: [PATCH v2 2/2] nvmem: core: stop deferring for a cell after the deferred probe timeout Date: Mon, 30 Nov 2026 13:15:07 +0530 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain nvmem_cell_get() returns -EPROBE_DEFER for as long as the nvmem device providing a DT cell is not registered. When that device never shows up, for instance because the flash holding the cell is not populated on the board, the consumer is deferred forever instead of falling back to another source. Once the deferred probe timeout has expired, as reported by driver_deferred_probe_check_state(), return -ENOENT instead, so that the consumer treats the cell as missing. A provider that is merely late is still waited for until then. Signed-off-by: Manikandan Muralidharan --- drivers/nvmem/core.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index a755cc4318dc..a1208663b50e 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -1508,6 +1508,15 @@ struct nvmem_cell *nvmem_cell_get(struct device *dev, const char *id) if (dev->of_node) { /* try dt first */ cell = of_nvmem_cell_get(dev->of_node, id); + /* + * Don't wait forever for a provider that never shows up, e.g. + * when the device holding it is not populated. Once the + * deferred probe timeout has expired, report the cell as + * missing so that the consumer can fall back. + */ + if (PTR_ERR(cell) == -EPROBE_DEFER && + driver_deferred_probe_check_state(dev) != -EPROBE_DEFER) + return ERR_PTR(-ENOENT); if (!IS_ERR(cell) || PTR_ERR(cell) == -EPROBE_DEFER) return cell; } -- 2.43.0