From nobody Mon Feb 9 01:45:11 2026 Received: from pdx-out-004.esa.us-west-2.outbound.mail-perimeter.amazon.com (pdx-out-004.esa.us-west-2.outbound.mail-perimeter.amazon.com [44.246.77.92]) (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 D1E581E505 for ; Fri, 30 Jan 2026 01:33:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=44.246.77.92 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769736823; cv=none; b=YS5QnPlj0h8PYuB6P6rRJtagjEywW+dtkKQuAYpslNUu+LH+YKcc4HacpDgO+bfenwv96IswoSUXrJVYj+BqmTZc6TOIrL7i2eCSP8/XabljI/kwmUR+KnyYenEXZMyTjgVXZlsadE1nwDbyZH6neAKpfc4rtnmVMgn+6EUQCSA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769736823; c=relaxed/simple; bh=nYz5GwZvRauaov4a88NZVdSFwQu5+mODyZ8xHeRt7os=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=dqlOHPgmEXP1hr0oR8HreFoSqDSN+46wQy1WFL1PJy19zoQTeKN3RaNucbdgw+s++J1ikHVHx9mDe7SgCq5ae57eNxUzz4LkI3p8J5WzuSdqMe5s9w1m0Ipn0fi6WtxefhW5/F5+zphQlH+Hrm3jKGfXF4SNTRLJSkXgcLAFOWI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.com; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b=XclBaFQv; arc=none smtp.client-ip=44.246.77.92 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b="XclBaFQv" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1769736821; x=1801272821; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=PC3sh08XqknfE1Fy9RIuBcYqxa7ZpUJE3jkTRSUpshc=; b=XclBaFQvJwJn2WMSMxIwvdxdXBWN7CyMS1zMfYRdv8d0PWqS5kKp96hv jwa3Q31Ww1fT3PLil8ots9g7FaYAgJVduYG9CPlGVQdQQPt8DaaKuvszG 0PI43og421Xs3EGb38RBLiZsVp2zrM5PhULDgZ9oUAbBLg0pFBV5QncyD 9WtKXTwhbgwqJxEHQBb/MMu9zYaPqQZMzdltAEECcCEQsAFYOtc1xytgl roYqw7et5Y999yyzrktHextprmdj34oDtyk3umFWcBSpM0C3H4ausmJL4 1QuWfIvZkDp2DvcPhyAj/NbiXOxJyVz5aeWCWv0t6bK/wLNqcOPD39viA g==; X-CSE-ConnectionGUID: GZL0syTtSAypUj0mcRqMrw== X-CSE-MsgGUID: ROnXOPF3Tc+c9kZ2ZTilog== X-IronPort-AV: E=Sophos;i="6.21,262,1763424000"; d="scan'208";a="11883224" Received: from ip-10-5-12-219.us-west-2.compute.internal (HELO smtpout.naws.us-west-2.prod.farcaster.email.amazon.dev) ([10.5.12.219]) by internal-pdx-out-004.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2026 01:33:41 +0000 Received: from EX19MTAUWA002.ant.amazon.com [205.251.233.234:18786] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.53.147:2525] with esmtp (Farcaster) id be9bdce5-5bcc-4da0-aac5-543c5eac1b37; Fri, 30 Jan 2026 01:33:41 +0000 (UTC) X-Farcaster-Flow-ID: be9bdce5-5bcc-4da0-aac5-543c5eac1b37 Received: from EX19D001UWA001.ant.amazon.com (10.13.138.214) by EX19MTAUWA002.ant.amazon.com (10.250.64.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.35; Fri, 30 Jan 2026 01:33:41 +0000 Received: from 842f574e803f.amazon.com (10.142.151.209) by EX19D001UWA001.ant.amazon.com (10.13.138.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.35; Fri, 30 Jan 2026 01:33:40 +0000 From: David LaPorte To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Tudor Ambarus , Martin Kurbanov , Mikhail Kshevetskiy , Cheng Ming Lin , Pratyush Yadav , , CC: David LaPorte , Gunnar Kudrjavets Subject: [PATCH v2] mtd: spinand: Disable continuous read during probe Date: Thu, 29 Jan 2026 17:33:22 -0800 Message-ID: <20260130013334.72135-1-dalaport@amazon.com> X-Mailer: git-send-email 2.50.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: EX19D044UWA001.ant.amazon.com (10.13.139.100) To EX19D001UWA001.ant.amazon.com (10.13.138.214) Content-Type: text/plain; charset="utf-8" Macronix serial NAND devices with continuous read support do not clear the configuration register on soft reset and lack a hardware reset pin. When continuous read is interrupted (e.g., during reboot), the feature remains enabled at the device level. With continuous read enabled, the OOB area becomes inaccessible and all reads are instead directed to the main area. As a result, during partition allocation as part of MTD device registration, the first two bytes of the main area for the master block are read and indicate that the block is bad. This process repeats for every subsequent block for the partition. All reads and writes that reference the BBT find no good blocks and fail. The only paths for recovery from this state are triggering the continuous read feature by way of raw MTD reads or through a NAND device power drain. Disable continuous read explicitly during spinand probe to ensure quiescent feature state. Fixes: 631cfdd0520d ("mtd: spi-nand: Add continuous read support") Signed-off-by: David LaPorte Reviewed-by: Gunnar Kudrjavets Reviewed-by: Mikhail Kshevetskiy --- Changes in V2: - Added comments to explain why cont_read is disabled here - Link to v1: https://lore.kernel.org/all/20260129221606.35158-1-dalaport@a= mazon.com/ --- Testing details: - Instrumented feature enablement and verified fix on internal kernel v6.12.64 build with affected Macronix MX35UF4GE4AD-Z4I hardware: warm reboot without patch marks all 2048 blocks bad during partition allocation; with patch applied, device registers cleanly with no bad blocks marked - Patch cherry-picks cleanly to mainline v6.19-rc6 and builds without warnings - Boot tested mainline + patch on aarch64 host without SPI interface --- drivers/mtd/nand/spi/core.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index d207286572d8..9540fd04156c 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -859,6 +859,14 @@ static void spinand_cont_read_init(struct spinand_devi= ce *spinand) (engine_type =3D=3D NAND_ECC_ENGINE_TYPE_ON_DIE || engine_type =3D=3D NAND_ECC_ENGINE_TYPE_NONE)) { spinand->cont_read_possible =3D true; + + /* + * Ensure continuous read is disabled on probe. + * Some devices retain this state across soft reset, + * which leaves the OOB area inaccessible and results + * in false positive returns from spinand_isbad(). + */ + spinand_cont_read_enable(spinand, false); } } -- 2.43.0