From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 0BCED26B08F for ; Tue, 11 Aug 2026 12:41:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786452062; cv=none; b=u1A15aptOOGiMf0xBdAgdI6080KNa3feNysrWxJtuudXmA9m6DZaDNDl7UlZyi2I9ii5V4D7LVOW9GrJxW/kn5a4iX+gfeTNW78XnND8WNsXzkOj8W3BXmrYRhyEwoHVQEUvVAnxCLgbuqndExcCiywbCJuwNjSaTxeFrCGiEa0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786452062; c=relaxed/simple; bh=0o2VpitmxmVP7x2nTI2+udiE1m/3Ph6Wzh2hx0Pa6wI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TzxrrFVm6ekuaPFd4Lg63sOWHlpxcVvdUVQuKWgD9Lg+XfyAh7R8J+pkMDC0J5gRJuXPD3MFaNrpXzJgbvjueD6MCju2tlKdA02z+570CIE2i+cvU/t4Gp/KgFwaK+M/kMn9rLTTe2O+ry4SQrvO3LjC3Ocgt1vzNy0HHEF7Zk4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=J+2VLHJd; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Np3VZRku; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="J+2VLHJd"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Np3VZRku" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67BCRDA2543212 for ; Tue, 11 Aug 2026 12:41:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= tJnYSvYfU7LxnA/XyzAaPB5ddQEKobczktNxC+wMcRc=; b=J+2VLHJdNcIWe9UX eXRgif1GHpuRXrxq262yzgNM4COtvGoOPYpxShXElnKJpd2LoManSOkmhpTSW4Wb vrDQOLDmnwNjDM0NO8VM8jtY1gUH5iJpuGPK5uTehcbKU24lWx9wfusgCAAHXzJA whC0/YO4VMNOoud5EkOdPpsxnik77SOc4I35F6pvIX24QsP8LDOD6C0atF/B50ZF n5BHlE3YLKC+8YsVw5sZb+IHPNHrThXcwq4VPlU5O64ppv3RPxpNh7I0GTxGI0RO Bk2vIP/XTRPa11i4yNnerdbTcF98uvrUDWq9aaSVwRCp/0rKlfRsZVUCrY5GBlX3 7K4c9Q== Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fyjjv41wf-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 11 Aug 2026 12:40:59 +0000 (GMT) Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-cb835525b10so3969112a12.2 for ; Tue, 11 Aug 2026 05:40:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786452059; x=1787056859; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=tJnYSvYfU7LxnA/XyzAaPB5ddQEKobczktNxC+wMcRc=; b=Np3VZRkuby91O2G/2YXotqBIK3CQO9zq0M8DztKI7cTK4Jmcijh1oLaf0evR4Lvg6j 8LbfCjuZtTKrjvhU0/E/DGPSdL8LUCPVweLjqFGrLFb1SFsKA4vxTxO6o7vIHPHxIOXc znetGQXdlL+xbh7j8DHCqQ1V2jRWmPjtuiSkDF3Pl54Q1R0Ac5GHIWIzgk0jrOWVTy3A DBiO2kmoYwxwdLUDAogsHc7XUj5pn/8VHZXjhH10LzGW5nZxHwhjdN1gDK7W/Kq5fNDC vq+0ww+M9IaOA5n9UW7UUVBocbiHKHsSqS++3+N92tIgmOmeRdTpyTHn9Niv03fsoygi gtZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786452059; x=1787056859; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=tJnYSvYfU7LxnA/XyzAaPB5ddQEKobczktNxC+wMcRc=; b=IH9un+5hi2Rez2dYkAKmWxPDkFKF0pEWEy1PFIFntpqcKCWM1Kxbt6p9Rb9MMpeBiH U7zrDpsn7IVWJiYSpWd1qFWYSQPHeuw5PcpKUBgsV4XdC2B2fVVCyHSwQts/JogsklM6 4s5DXRTL4C5QNjGU2VFQPi47oMjTgEYYglnUr1EZumuEUPHjRA3oGkDNdPpEVXPTWPO6 C2kauvAJ1Ung7zODL2LCk+z0Q5EC3SAyYSAi4z2NC3y7zsqIofni4q0FPqnR1OPIeuhm 9Rq5IOwrVm+CDSvPizvdWvXdX+sHp6o5FIYgOZDoEMUfGmf43X52fQMzr9L5i3dxnzkP sWew== X-Forwarded-Encrypted: i=1; AHgh+RreHv8YSwnTDJfyD4ff9wdlkAg2HIWqZ7AJcM43gkMZQr9WT2nbO5i+ZzGwZldd9mv+m0kvIPfSyNTRFrk=@vger.kernel.org X-Gm-Message-State: AOJu0YwSlgIKRvX2mlOLAtTRm+NqlDKYd6l/IkPfxceM91NhIjlTp4QC xhR7cFhUjq4NDdqVeq1YDEK/6LlVQyF46IVHISchN5JhS90YU6LX5Lf1rhuC4LBYfQMSLjrYvDY E/qbC5jW1nbUE7hVthVcAN8ub5q/dTBk6APvH9TcI9leNMJjZL+bg516J9t5ApcHNafE= X-Gm-Gg: AR+sD13cCX9tRimiDZKcXfAo+yiP61pKIWdlh+CRdk6ROOeyAQacXD+0K8G/bjN0ONV 7TWQFIAAA7S186EIzUN31f/eTvNJ1gdoaULn+MbQVpypaEExNLaIAIa5c133Tjaf/zRMbAoCOzP HX6iBJ+YwxPj9a8v058LQ72IwemNW542EtK0jnPX5JWrNb0gxlqI4/SMPhM1Kd/pDVVX1TNRfIF 3UipZFyz4vHVcx779On8HpfHsPJ1vZ9jNPll74CX19/JZTjDpsOZsoxXTuZcIyV1/5DpU+vDn3f GkxTAZnmJZi5oy7mMAjHYBSp+0ZWntGjP176LZIpNPHBPp7Cb6+hsBMK83V4osZ3ZYo4DLRBZ4K RW6WX5ZHEbdwArzSeeT20zwsb29VVl3LbH4PZCigUop8/R1kqXPx4SCC2XJDPUFY19BV7WJJKnX dhfRSPkfkazIc= X-Received: by 2002:a05:6a21:1b81:b0:3bf:7c02:c46f with SMTP id adf61e73a8af0-3cc2b853809mr4120367637.14.1786452058606; Tue, 11 Aug 2026 05:40:58 -0700 (PDT) X-Received: by 2002:a05:6a21:1b81:b0:3bf:7c02:c46f with SMTP id adf61e73a8af0-3cc2b853809mr4120293637.14.1786452057976; Tue, 11 Aug 2026 05:40:57 -0700 (PDT) Received: from hu-mdalam-blr.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-31c61cd491csm5392299eec.7.2026.08.11.05.40.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Aug 2026 05:40:57 -0700 (PDT) Date: Tue, 11 Aug 2026 18:10:50 +0530 From: Md Sadre Alam To: Dominique MARTINET Cc: miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, tudor.ambarus@linaro.org, s-k6@ti.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, varadarajan.narayanan@oss.qualcomm.com Subject: Re: [PATCH 1/2] mtd: spinand: winbond: add support for W25N04LW Message-ID: References: <20260807064339.1632249-1-md.alam@oss.qualcomm.com> <20260807064339.1632249-2-md.alam@oss.qualcomm.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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODExMDEwNSBTYWx0ZWRfX+llUJ37k2ALb R3bYL3cbAAp/zEaR+cS8prjuIixah5A+71Xbu7hd33HAKH4b4phaogymx80tNpfdVQ30ZfF0Snk lqV2M5daPI4OxLQB42RyWE2PZL1WMcWiI2EQe0oLsZw9LDTbGHyccv9FZxfJ0Smk1IKMB0rjpue DbqVvhUKHoDj3toASHU1KuYFL5XCYeHpbOsRrM+CiwHbXhKPP5CrIVl4iX8udMK1K2xK+OKw4rd VHVAfunex5ab/1JoDs7INnuSEaZa/287VXMe+UZGJaNgcar8PunIu7DHxczZNmOlRB09kslwFd/ bLM/ALl1kdEkJtoHLXPD+fBk2XQHEqM5inaJiynZ1wFMMc1YlvMJfqVZ+F0ANY9QIK77bcIzqu8 KiLKL1V37cdtmiz9l77jPOSLcOkOAA+N5LWhJbbphjFQ4+wBL7Qabwj+n7M7gDc3lYOzYu1CkQB yP9haQ1HfhHxvK68DzA== X-Proofpoint-ORIG-GUID: 2bZjWBOJVsIL55M2ATQddLAcGExih3ym X-Authority-Analysis: v=2.4 cv=KLtqylFo c=1 sm=1 tr=0 ts=6a7b185b cx=c_pps a=Oh5Dbbf/trHjhBongsHeRQ==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=8nJEP1OIZ-IA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=lLZmtIKjAAAA:8 a=VwQbUJbxAAAA:8 a=P-IC7800AAAA:8 a=RZJGasmsuR9KREMzlRsA:9 a=3ZKOabzyN94A:10 a=wPNLvfGTeEIA:10 a=_Vgx9l1VpLgwpw_dHYaR:22 a=q5Nj8NTjyn2D8kUwajRn:22 a=d3PnA9EDa4IxuAV0gXij:22 X-Proofpoint-GUID: 2bZjWBOJVsIL55M2ATQddLAcGExih3ym X-Proofpoint-Spam-Info: AW1haW4tMjYwODExMDEwNSBTYWx0ZWRfX4Hl7hkoUL1R+ l3Qj38jcP4b183fPCW3KsY/Br4MH8uDD7a9XiyC/C6JFKAa9o6qa43u1L+EgEJQGkQ1pqRk89On C1ThvTxdIF1+bHacEx0Wd71XWZOswIU= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-11_02,2026-08-10_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 priorityscore=1501 bulkscore=0 spamscore=0 adultscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608110105 On Mon, Aug 10, 2026 at 05:28:32PM +0900, Dominique MARTINET wrote: > Md Sadre Alam wrote on Fri, Aug 07, 2026 at 12:13:38PM +0530: > > Add support for Winbond W25N04LW 4Gbit SPI-NAND. > > It has 8-bit on-die ECC and a 4096+256 byte page > > (4096 byte main area, 128 byte usable OOB once > > on-chip ECC hides the 128 byte parity area), > > organized as 2048 blocks of 64 pages each, unlike > > the existing 2048 byte page W25N04KV/W25N04KW parts. > > This is pretty good timing, I was just looking at sending a patch for > W25N04LW myself! > > I agree with Miquèl that your patch looks odd, you wrote > > + NAND_MEMORG(1, 4096, 128, 64, 2048, 40, 1, 1, 1), > but the erase blocks are 256K long so it should be > + NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1), > > did you actually test this device? > > If it helps, the datasheet for W25N04LWZExx / W25N04LWTBxx is freely > available from digikey here[1] > [1] https://mm.digikey.com/Volume0/opasdata/d220001/medias/docus/7182/W25N04LWZExx_W25N04LWTBxx_RevD_2025-08-05.pdf > > (And it also supports continuous read, so I'm curious to see if it'd > work with the recent continous read support from Miquèl[2] merged in > 7.2... I'm not familiar with the subsystem so will need a bit of time to > plug all the hooks in properly) > [2] https://lore.kernel.org/linux-mtd/20260429-winbond-v6-18-rc1-cont-read-v3-0-0f38b3c229ad@bootlin.com/ > > > FWIW, I've confirmed it works with the following diff (at least up to > the point of creating an ubi volume and booting from it); happy to send > this as a patch if this has indeed not been tested This device was supported in our downstream tree and was tested there. I picked that patch and posted it upstream assuming the configuration was already correct. The `128` in: NAND_MEMORG(1, 4096, 128, 64, 2048, 40, 1, 1, 1) was my mistake. It should indeed be `256`, matching the 4096 + 256 page layout in the W25N04LW datasheet. Please go ahead and post your tested patch. I do not currently have this device available to retest the upstream version. Thanks, Alam.