From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 11E733B8D48 for ; Tue, 9 Dec 2025 07:06:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765264021; cv=none; b=F2FXQKFBNQ3dWThXnjbYb2QkWv/06IqacZHDEVt63sunR2nsOowTZ8pZiNEuGNRjbHiJi8HZX16Zwok/TlhqGHe2qqNBVLOOUVvAgKahzDVA3BGLS6mJAsVhhzPLQWM1vjU0xYzjsFzpWgGEQh9QwDXKMYIkz67+SM1RyFVLb18= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765264021; c=relaxed/simple; bh=pXdeTyBp/FfnE6+L+mregiWIvH2CL4porPPTq0qkbRI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=qDasQGcfS/6KJJaBvfTny1XszTBcGyelID4XsMxrEx5d/6s6CAARilVVf4XitjCcKEQfhwVaeBzD8lYK1/PhkFpPbek0kyWENlA1FSM3Q22eFz8Z79rF4r62FJimitPgFrZyjSnBgvnqmN4aR71J5pQWqAKYSOwyDN0RRUAWpVI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VSMCkCSN; arc=none smtp.client-ip=209.85.216.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VSMCkCSN" Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-34381ec9197so4544285a91.1 for ; Mon, 08 Dec 2025 23:06:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765264019; x=1765868819; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/YXcwxUnJQ+S362xxKdo7SZa6folpZloa3pNs+jWKg8=; b=VSMCkCSN7laaNRgho5gUnyaUUbjoN+3cgY9CEZykBJreN/VDLKNIPXn9+npgds4EPu KZozDw48BqAF43RH/CJePy6jiV+s1rrhpblQ0Mw7DcNyIRxwybLwzoPq/BneMWqqs/xR PTXPGEEk3ZaQTX7AiF1M8vFi0897GSwRpGH2GX/DO6D5u1goJfRi6qsG0eko0f0Sc4cn 369wjfefUE0yIlIIvbMQ7YhBbVvOxWABknktxY36kfP2Clrtpe74HPOl9RhBZ/a451sJ fuyBavxzuD+F6JRhrkDPCRbpzkJw7dDp8xbsdCj0i2HpGRdfZH8ghg0wcKUlHlbGJoaI xKTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765264019; x=1765868819; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=/YXcwxUnJQ+S362xxKdo7SZa6folpZloa3pNs+jWKg8=; b=ZXODPJKG/IY6mrR5OE7lsbAaG7jtDXu8HKXytux/8/gWVsnYyND6iwJyIyuFQGGqhJ oX3LlGLePV8cmQDCWjpUkH/8UWlnYNjQdGrk0X0BVUuD38ui8D/zy5/CzE4YRdYQxZcA CJMpaZlvDnRKF3hTu6GpqtmRjsBRIwdZhwVW5y7iH1HuO1ZOM6RTEpJq+fTvrmCt3JUl NZGzOBiJWv3f0C6CkfoPCqiRxj4npws4FPeE6mg7MViCluQTdwycZ0dFfhTP1i51AscZ LmVFRDsOplea3WzhWKvCb4IobddqKB2jwsefjNMCJNsK0NB31PFwc/qLV3V/8S8wIbJ9 9Ddw== X-Gm-Message-State: AOJu0YxQx9gUh4QNb54C2SEybY5LGOIZWX6y1Hmhti4FpmL5ba96xD/J qGsrWBF7VHA3NgAUCNiJPIJ6i+JV1MHi2elGJOtynVUJXE6M8R5k5JnB X-Gm-Gg: ASbGncudMmSXvnrP6v6mVoEyo1ruIRNoP1A0+LokKNZEYOQpacfyB3c/m33cUvbi5xP dY6sbyFizwIpuJrZxpyBeb+7MDU/dvPhF15FLMDlkng5e5XB+lYwgop7KKFvRXFWn3NyLwyiw58 OSYu2xWkN1hPgUfl4fXDtqDVPAUjWrV32xWAg5WKFU1FSgBXj8rdahfw23Vba/4IIRvsXJ8oXLF FgEXyyuaCsHrRTGZwxKmulVeqL5rUDv5A3hiosmfh3JpxJ54V4SUnIvRtQKcYFxsQlpUhF8qYF2 HRCb2Whwt9wzjOUUrpMqbrzv+X6w6/ypy/5za4RIfXvM9gTTfs0P4QNpdNLykirs00Ui35f5/8u oxlkFgXrodVRe71fo8ZTGyAnmEI9KF0196d3gI855A2w1tZQeFTxIpTS6jMcAKBj/4HAI2rV/69 nWy4ke2JQJo4YXtL8rQLe0 X-Google-Smtp-Source: AGHT+IEdKiH2/w1Zyzo0nPW4nC0c5CMhMt7JsBXIOmHOOPxq0ucTuPlf2Sa9gfnM3LABhhMUIuO2bQ== X-Received: by 2002:a17:90b:5546:b0:343:eb40:8e01 with SMTP id 98e67ed59e1d1-349a26223e5mr7488178a91.27.1765264019303; Mon, 08 Dec 2025 23:06:59 -0800 (PST) Received: from DESKTOP-TIT0J8O.dm.ae ([49.47.198.227]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-34a47bc2056sm750894a91.1.2025.12.08.23.06.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Dec 2025 23:06:58 -0800 (PST) From: Ahmed Naseef To: miquel.raynal@bootlin.com Cc: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, naseefkm@gmail.com, richard@nod.at, vigneshr@ti.com Subject: Re: [PATCH] mtd: spinand: add support for Dosilicon DS35Q1GA/DS35M1GA Date: Tue, 9 Dec 2025 11:06:41 +0400 Message-Id: <20251209070641.34589-1-naseefkm@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <87qzt573uo.fsf@bootlin.com> References: <87qzt573uo.fsf@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi Miquèl, Thank you for the review. You were right about the OOB layout - it was incorrect. > These macros have been renamed, please rebase at -rc1. Done, updated in v2. > This is strange, there is usually some spare area used for storing the > ECC. Are you sure none of the bytes in the spare area are being smashed > when you write them? You were correct - the original OOB layout was wrong. I initially misread the datasheet's "hidden spare area" phrase and assumed ECC parity was stored internally by the chip. I've now done hardware testing which proves otherwise. Test procedure (on Genexis Platinum 4410) 1. Erased a block and wrote 0xAA to all 62 OOB bytes (2-63) 2. Read back the page with ECC enabled Result: 00000800 ff ff aa aa aa aa aa aa e5 58 4e 86 77 75 0e f0 00000810 aa aa aa aa aa aa aa aa e5 58 4e 86 77 75 0e f0 ... The R1 regions (bytes 8-15, 24-31, 40-47, 56-63) were overwritten with ECC parity data, while M2+M1 regions preserved the 0xAA pattern. Corrected OOB layout (per datasheet Table 3.7): - 64 bytes total, 4 segments of 16 bytes each - Each segment: bytes 0-7 user data (M2+M1), bytes 8-15 ECC parity (R1) - Free: 30 bytes total (6+8+8+8, accounting for 2-byte BBM) - ECC: 32 bytes total (8 bytes × 4 segments) v2 includes the corrected OOB layout with proper ECC and free region callbacks. Thanks, Ahmed Naseef